查询科室及其下属话术、手术数量信息,手术管理模块修改,话术管理模块修改
This commit is contained in:
parent
500720f8b5
commit
b1518f44a2
@ -3,6 +3,7 @@ package com.xinelu.manage.controller.department;
|
||||
import com.xinelu.common.annotation.Log;
|
||||
import com.xinelu.common.core.controller.BaseController;
|
||||
import com.xinelu.common.core.domain.AjaxResult;
|
||||
import com.xinelu.common.core.domain.R;
|
||||
import com.xinelu.common.core.page.TableDataInfo;
|
||||
import com.xinelu.common.enums.BusinessType;
|
||||
import com.xinelu.common.utils.poi.ExcelUtil;
|
||||
@ -93,4 +94,23 @@ public class DepartmentController extends BaseController {
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(departmentService.deleteDepartmentByIds(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询科室信息列表及包含话术数量
|
||||
*/
|
||||
@GetMapping("/listScriptNum")
|
||||
public R<List<Department>> listScriptNum(Department department) {
|
||||
List<Department> list = departmentService.selectDepartmentListScriptNum(department);
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询科室信息列表及包含手术数量
|
||||
*/
|
||||
@GetMapping("/listOperationNum")
|
||||
public R<List<Department>> listOperationNum(Department department) {
|
||||
List<Department> list = departmentService.selectDepartmentListOperationNum(department);
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -25,7 +25,7 @@ import java.util.List;
|
||||
*/
|
||||
@Api(tags = "手术信息控制器")
|
||||
@RestController
|
||||
@RequestMapping("/operationInfo/operationInfo")
|
||||
@RequestMapping("/manage/operationInfo")
|
||||
public class OperationInfoController extends BaseController {
|
||||
@Resource
|
||||
private IOperationInfoService operationInfoService;
|
||||
@ -93,9 +93,9 @@ public class OperationInfoController extends BaseController {
|
||||
@ApiOperation("删除手术信息")
|
||||
@PreAuthorize("@ss.hasPermi('operationInfo:operationInfo:remove')")
|
||||
@Log(title = "手术信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("remove/{id}")
|
||||
public AjaxResult remove(@PathVariable Long id) {
|
||||
return toAjax(operationInfoService.deleteOperationInfoById(id));
|
||||
@DeleteMapping("remove/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(operationInfoService.deleteOperationInfoByIds(ids));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -71,7 +71,7 @@ public class ScriptInfoController extends BaseController {
|
||||
@ApiOperation("新增话术信息")
|
||||
@PreAuthorize("@ss.hasPermi('manage:script:add')")
|
||||
@Log(title = "话术信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
@PostMapping(value = "/add")
|
||||
public AjaxResult add(@RequestBody ScriptInfo scriptInfo) {
|
||||
return toAjax(scriptInfoService.insertScriptInfo(scriptInfo));
|
||||
}
|
||||
@ -79,9 +79,10 @@ public class ScriptInfoController extends BaseController {
|
||||
/**
|
||||
* 修改话术信息
|
||||
*/
|
||||
@ApiOperation("修改话术信息")
|
||||
@PreAuthorize("@ss.hasPermi('manage:script:edit')")
|
||||
@Log(title = "话术信息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
@PutMapping(value = "/edit")
|
||||
public AjaxResult edit(@RequestBody ScriptInfo scriptInfo) {
|
||||
return toAjax(scriptInfoService.updateScriptInfo(scriptInfo));
|
||||
}
|
||||
@ -89,9 +90,10 @@ public class ScriptInfoController extends BaseController {
|
||||
/**
|
||||
* 删除话术信息
|
||||
*/
|
||||
@ApiOperation("删除话术信息")
|
||||
@PreAuthorize("@ss.hasPermi('manage:script:remove')")
|
||||
@Log(title = "话术信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
@DeleteMapping("remove/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(scriptInfoService.deleteScriptInfoByIds(ids));
|
||||
}
|
||||
|
||||
@ -176,6 +176,12 @@ public class Department extends BaseEntity {
|
||||
@Excel(name = "撤销日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date revokeDate;
|
||||
|
||||
/**
|
||||
* 包含附属数量:比如科室下所含话术数量
|
||||
*/
|
||||
@ApiModelProperty(value = "包含附属数量")
|
||||
private Integer countNum;
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
@ -201,6 +207,7 @@ public class Department extends BaseEntity {
|
||||
.append("departmentMail", getDepartmentMail())
|
||||
.append("establishDate", getEstablishDate())
|
||||
.append("revokeDate", getRevokeDate())
|
||||
.append("countNum", getCountNum())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
|
||||
@ -2,6 +2,8 @@ package com.xinelu.manage.domain.scriptInfo;
|
||||
|
||||
import com.xinelu.common.annotation.Excel;
|
||||
import com.xinelu.common.core.domain.BaseEntity;
|
||||
import com.xinelu.common.custominterface.Insert;
|
||||
import com.xinelu.common.custominterface.Update;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
@ -10,6 +12,9 @@ import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
/**
|
||||
* 话术信息对象 script_info
|
||||
@ -35,6 +40,7 @@ public class ScriptInfo extends BaseEntity {
|
||||
*/
|
||||
@ApiModelProperty(value = "所属科室id")
|
||||
@Excel(name = "所属科室id")
|
||||
@NotBlank(message = "科室id不能为空")
|
||||
private Long departmentId;
|
||||
|
||||
/**
|
||||
@ -42,6 +48,7 @@ public class ScriptInfo extends BaseEntity {
|
||||
*/
|
||||
@ApiModelProperty(value = "所属科室名称")
|
||||
@Excel(name = "所属科室名称")
|
||||
@NotBlank(message = "科室名称不能为空")
|
||||
private String departmentName;
|
||||
|
||||
/**
|
||||
@ -63,6 +70,8 @@ public class ScriptInfo extends BaseEntity {
|
||||
*/
|
||||
@ApiModelProperty(value = "通用话术名称")
|
||||
@Excel(name = "通用话术名称")
|
||||
@NotBlank(message = "通用话术名称不能为空", groups = {Insert.class, Update.class})
|
||||
@Length(max = 100, message = "通用话术名称名称不能超过100个字符", groups = {Insert.class, Update.class})
|
||||
private String commonScriptName;
|
||||
|
||||
/**
|
||||
@ -70,6 +79,8 @@ public class ScriptInfo extends BaseEntity {
|
||||
*/
|
||||
@ApiModelProperty(value = "话术名称")
|
||||
@Excel(name = "话术名称")
|
||||
@NotBlank(message = "话术名称不能为空", groups = {Insert.class, Update.class})
|
||||
@Length(max = 100, message = "话术名称不能超过100个字符", groups = {Insert.class, Update.class})
|
||||
private String scriptName;
|
||||
|
||||
/**
|
||||
@ -77,6 +88,7 @@ public class ScriptInfo extends BaseEntity {
|
||||
*/
|
||||
@ApiModelProperty(value = "话术ID")
|
||||
@Excel(name = "话术ID")
|
||||
@NotBlank(message = "话术ID不能为空", groups = {Insert.class, Update.class})
|
||||
private String scriptId;
|
||||
|
||||
/**
|
||||
@ -84,6 +96,7 @@ public class ScriptInfo extends BaseEntity {
|
||||
*/
|
||||
@ApiModelProperty(value = "平台ID")
|
||||
@Excel(name = "平台ID")
|
||||
@NotBlank(message = "平台ID不能为空", groups = {Insert.class, Update.class})
|
||||
private String platformId;
|
||||
|
||||
/**
|
||||
@ -91,6 +104,7 @@ public class ScriptInfo extends BaseEntity {
|
||||
*/
|
||||
@ApiModelProperty(value = "话术状态,正常:NORMAL,下架:OFF_SHELF,暂停:SUSPEND")
|
||||
@Excel(name = "话术状态,正常:NORMAL,下架:OFF_SHELF,暂停:SUSPEND")
|
||||
@NotBlank(message = "话术状态不能为空", groups = {Insert.class, Update.class})
|
||||
private String scriptStatus;
|
||||
|
||||
/**
|
||||
@ -98,6 +112,8 @@ public class ScriptInfo extends BaseEntity {
|
||||
*/
|
||||
@ApiModelProperty(value = "话术简介")
|
||||
@Excel(name = "话术简介")
|
||||
@NotBlank(message = "话术简介不能为空", groups = {Insert.class, Update.class})
|
||||
@Length(max = 100, message = "话术简介不能超过200个字符", groups = {Insert.class, Update.class})
|
||||
private String scriptIntroduction;
|
||||
|
||||
/**
|
||||
|
||||
@ -59,4 +59,18 @@ public interface DepartmentMapper {
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteDepartmentByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 查询科室信息列表及包含话术数量
|
||||
* @param department
|
||||
* @return
|
||||
*/
|
||||
List<Department> selectDepartmentListScriptNum(Department department);
|
||||
|
||||
/**
|
||||
* 查询科室信息列表及包含手术数量
|
||||
* @param department
|
||||
* @return
|
||||
*/
|
||||
List<Department> selectDepartmentListOperationNum(Department department);
|
||||
}
|
||||
|
||||
@ -60,13 +60,10 @@ public interface ScriptInfoMapper {
|
||||
*/
|
||||
public int deleteScriptInfoByIds(Long[] ids);
|
||||
|
||||
|
||||
/**
|
||||
* 根据通用话术名称和话术ID判断通用话术名称是否存在
|
||||
* @param commonScriptName
|
||||
* @param scriptId
|
||||
* 判断通用话术名称是否存在
|
||||
* @param scriptInfo
|
||||
* @return
|
||||
*/
|
||||
int countByCommonScriptNameAndScriptId(@Param("commonScriptName") String commonScriptName, @Param("scriptId") String scriptId);
|
||||
|
||||
int countByScriptInfo(ScriptInfo scriptInfo);
|
||||
}
|
||||
|
||||
@ -59,4 +59,18 @@ public interface IDepartmentService {
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteDepartmentById(Long id);
|
||||
|
||||
/**
|
||||
* 查询科室信息列表及包含话术数量
|
||||
* @param department
|
||||
* @return
|
||||
*/
|
||||
List<Department> selectDepartmentListScriptNum(Department department);
|
||||
|
||||
/**
|
||||
* 查询科室信息列表及包含手术数量
|
||||
* @param department
|
||||
* @return
|
||||
*/
|
||||
List<Department> selectDepartmentListOperationNum(Department department);
|
||||
}
|
||||
|
||||
@ -88,4 +88,26 @@ public class DepartmentServiceImpl implements IDepartmentService {
|
||||
public int deleteDepartmentById(Long id) {
|
||||
return departmentMapper.deleteDepartmentById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询科室信息列表及包含话术数量
|
||||
*
|
||||
* @param department
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<Department> selectDepartmentListScriptNum(Department department) {
|
||||
return departmentMapper.selectDepartmentListScriptNum(department);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询科室信息列表及包含手术数量
|
||||
*
|
||||
* @param department
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<Department> selectDepartmentListOperationNum(Department department) {
|
||||
return departmentMapper.selectDepartmentListOperationNum(department);
|
||||
}
|
||||
}
|
||||
|
||||
@ -51,11 +51,4 @@ public interface IOperationInfoService {
|
||||
*/
|
||||
public int deleteOperationInfoByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除手术信息信息
|
||||
*
|
||||
* @param id 手术信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteOperationInfoById(Long id);
|
||||
}
|
||||
|
||||
@ -111,21 +111,4 @@ public class OperationInfoServiceImpl implements IOperationInfoService {
|
||||
public int deleteOperationInfoByIds(Long[] ids) {
|
||||
return operationInfoMapper.deleteOperationInfoByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除手术信息
|
||||
*
|
||||
* @param id 手术信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteOperationInfoById(Long id) {
|
||||
// 根据id查询手术信息是否存在
|
||||
OperationInfo operationInfo = operationInfoMapper.selectOperationInfoById(id);
|
||||
if (ObjectUtils.isEmpty(operationInfo)) {
|
||||
throw new ServiceException("要删除的手术信息不存在");
|
||||
}
|
||||
return operationInfoMapper.deleteOperationInfoById(id);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -3,11 +3,9 @@ package com.xinelu.manage.service.scriptInfo.impl;
|
||||
import com.xinelu.common.exception.ServiceException;
|
||||
import com.xinelu.common.utils.DateUtils;
|
||||
import com.xinelu.common.utils.SecurityUtils;
|
||||
import com.xinelu.common.utils.StringUtils;
|
||||
import com.xinelu.manage.domain.scriptInfo.ScriptInfo;
|
||||
import com.xinelu.manage.mapper.scriptInfo.ScriptInfoMapper;
|
||||
import com.xinelu.manage.service.scriptInfo.IScriptInfoService;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@ -54,28 +52,8 @@ public class ScriptInfoServiceImpl implements IScriptInfoService {
|
||||
*/
|
||||
@Override
|
||||
public int insertScriptInfo(ScriptInfo scriptInfo) {
|
||||
// 入参非空性判断
|
||||
if (StringUtils.isEmpty(scriptInfo.getCommonScriptName())) {
|
||||
throw new ServiceException("通用话术名称不能为空");
|
||||
}
|
||||
if (StringUtils.isEmpty(scriptInfo.getScriptName())) {
|
||||
throw new ServiceException("话术名称不能为空");
|
||||
}
|
||||
if (ObjectUtils.isEmpty(scriptInfo.getScriptId())) {
|
||||
throw new ServiceException("话术ID不能为空");
|
||||
}
|
||||
if (ObjectUtils.isEmpty(scriptInfo.getPlatformId())) {
|
||||
throw new ServiceException("平台ID不能为空");
|
||||
}
|
||||
if (StringUtils.isEmpty(scriptInfo.getScriptStatus())) {
|
||||
throw new ServiceException("话术状态不能为空");
|
||||
}
|
||||
if (StringUtils.isEmpty(scriptInfo.getScriptIntroduction())) {
|
||||
throw new ServiceException("话术简介不能为空");
|
||||
}
|
||||
// 判断通用话术名称是否存在
|
||||
int existingNameCount = scriptInfoMapper.countByCommonScriptNameAndScriptId(scriptInfo.getCommonScriptName(), scriptInfo.getScriptId());
|
||||
if (existingNameCount > 0) {
|
||||
if (scriptInfoMapper.countByScriptInfo(scriptInfo) > 0) {
|
||||
throw new ServiceException("通用话术名称已存在");
|
||||
}
|
||||
// 设置创建人与创建时间
|
||||
@ -92,6 +70,12 @@ public class ScriptInfoServiceImpl implements IScriptInfoService {
|
||||
*/
|
||||
@Override
|
||||
public int updateScriptInfo(ScriptInfo scriptInfo) {
|
||||
// 判断通用话术名称是否存在
|
||||
if (scriptInfoMapper.countByScriptInfo(scriptInfo) > 0) {
|
||||
throw new ServiceException("通用话术名称已存在");
|
||||
}
|
||||
// 设置修改人和修改时间
|
||||
scriptInfo.setUpdateBy(SecurityUtils.getUsername());
|
||||
scriptInfo.setUpdateTime(DateUtils.getNowDate());
|
||||
return scriptInfoMapper.updateScriptInfo(scriptInfo);
|
||||
}
|
||||
|
||||
@ -65,64 +65,94 @@
|
||||
<include refid="selectDepartmentVo"/>
|
||||
<where>
|
||||
<if test="parentDepartmentId != null ">
|
||||
and parent_department_id = #{parentDepartmentId}
|
||||
and parent_department_id =
|
||||
#{parentDepartmentId}
|
||||
</if>
|
||||
<if test="agencyId != null ">
|
||||
and agency_id = #{agencyId}
|
||||
and agency_id =
|
||||
#{agencyId}
|
||||
</if>
|
||||
<if test="agencyName != null and agencyName != ''">
|
||||
and agency_name like concat('%', #{agencyName}, '%')
|
||||
and agency_name like concat('%',
|
||||
#{agencyName},
|
||||
'%'
|
||||
)
|
||||
</if>
|
||||
<if test="departmentName != null and departmentName != ''">
|
||||
and department_name like concat('%', #{departmentName}, '%')
|
||||
and department_name like concat('%',
|
||||
#{departmentName},
|
||||
'%'
|
||||
)
|
||||
</if>
|
||||
<if test="departmentCode != null and departmentCode != ''">
|
||||
and department_code = #{departmentCode}
|
||||
and department_code =
|
||||
#{departmentCode}
|
||||
</if>
|
||||
<if test="departmentType != null and departmentType != ''">
|
||||
and department_type = #{departmentType}
|
||||
and department_type =
|
||||
#{departmentType}
|
||||
</if>
|
||||
<if test="departmentAbbreviation != null and departmentAbbreviation != ''">
|
||||
and department_abbreviation = #{departmentAbbreviation}
|
||||
and department_abbreviation =
|
||||
#{departmentAbbreviation}
|
||||
</if>
|
||||
<if test="departmentPersonId != null ">
|
||||
and department_person_id = #{departmentPersonId}
|
||||
and department_person_id =
|
||||
#{departmentPersonId}
|
||||
</if>
|
||||
<if test="departmentPersonName != null and departmentPersonName != ''">
|
||||
and department_person_name like concat('%', #{departmentPersonName}, '%')
|
||||
and department_person_name like concat('%',
|
||||
#{departmentPersonName},
|
||||
'%'
|
||||
)
|
||||
</if>
|
||||
<if test="nodeType != null and nodeType != ''">
|
||||
and node_type = #{nodeType}
|
||||
and node_type =
|
||||
#{nodeType}
|
||||
</if>
|
||||
<if test="provideServiceCategory != null and provideServiceCategory != ''">
|
||||
and provide_service_category = #{provideServiceCategory}
|
||||
and provide_service_category =
|
||||
#{provideServiceCategory}
|
||||
</if>
|
||||
<if test="subdivisionCategoryId != null ">
|
||||
and subdivision_category_id = #{subdivisionCategoryId}
|
||||
and subdivision_category_id =
|
||||
#{subdivisionCategoryId}
|
||||
</if>
|
||||
<if test="subdivisionCategoryName != null and subdivisionCategoryName != ''">
|
||||
and subdivision_category_name like concat('%', #{subdivisionCategoryName}, '%')
|
||||
and subdivision_category_name like concat('%',
|
||||
#{subdivisionCategoryName},
|
||||
'%'
|
||||
)
|
||||
</if>
|
||||
<if test="normDepartmentCompareId != null ">
|
||||
and norm_department_compare_id = #{normDepartmentCompareId}
|
||||
and norm_department_compare_id =
|
||||
#{normDepartmentCompareId}
|
||||
</if>
|
||||
<if test="normDepartmentCompareName != null and normDepartmentCompareName != ''">
|
||||
and norm_department_compare_name like concat('%', #{normDepartmentCompareName}, '%')
|
||||
and norm_department_compare_name like concat('%',
|
||||
#{normDepartmentCompareName},
|
||||
'%'
|
||||
)
|
||||
</if>
|
||||
<if test="prepareBedsCount != null ">
|
||||
and prepare_beds_count = #{prepareBedsCount}
|
||||
and prepare_beds_count =
|
||||
#{prepareBedsCount}
|
||||
</if>
|
||||
<if test="departmentPhone != null and departmentPhone != ''">
|
||||
and department_phone = #{departmentPhone}
|
||||
and department_phone =
|
||||
#{departmentPhone}
|
||||
</if>
|
||||
<if test="departmentMail != null and departmentMail != ''">
|
||||
and department_mail = #{departmentMail}
|
||||
and department_mail =
|
||||
#{departmentMail}
|
||||
</if>
|
||||
<if test="establishDate != null ">
|
||||
and establish_date = #{establishDate}
|
||||
and establish_date =
|
||||
#{establishDate}
|
||||
</if>
|
||||
<if test="revokeDate != null ">
|
||||
and revoke_date = #{revokeDate}
|
||||
and revoke_date =
|
||||
#{revokeDate}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
@ -133,6 +163,140 @@
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="selectDepartmentListScriptNum" resultType="com.xinelu.manage.domain.department.Department">
|
||||
select d.id,
|
||||
d.parent_department_id,
|
||||
d.agency_id,
|
||||
d.agency_name,
|
||||
d.department_name,
|
||||
d.department_code,
|
||||
d.department_type,
|
||||
d.department_abbreviation,
|
||||
d.department_person_id,
|
||||
d.department_person_name,
|
||||
d.node_type,
|
||||
d.provide_service_category,
|
||||
d.subdivision_category_id,
|
||||
d.subdivision_category_name,
|
||||
d.norm_department_compare_id,
|
||||
d.norm_department_compare_name,
|
||||
d.prepare_beds_count,
|
||||
d.department_phone,
|
||||
d.department_mail,
|
||||
d.establish_date,
|
||||
d.revoke_date,
|
||||
d.create_by,
|
||||
d.create_time,
|
||||
d.update_by,
|
||||
d.update_time,
|
||||
count(si.id) AS countNum
|
||||
from department d left join script_info si on d.id = si.department_id
|
||||
<where>
|
||||
<if test="departmentCode != null and departmentCode != ''">
|
||||
and d.department_code =
|
||||
#{departmentCode}
|
||||
</if>
|
||||
<if test="departmentName != null and departmentName != ''">
|
||||
and d.department_name like concat('%',
|
||||
#{departmentName},
|
||||
'%'
|
||||
)
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY d.id,
|
||||
d.parent_department_id,
|
||||
d.agency_id,
|
||||
d.agency_name,
|
||||
d.department_name,
|
||||
d.department_code,
|
||||
d.department_type,
|
||||
d.department_abbreviation,
|
||||
d.department_person_id,
|
||||
d.department_person_name,
|
||||
d.node_type,
|
||||
d.provide_service_category,
|
||||
d.subdivision_category_id,
|
||||
d.subdivision_category_name,
|
||||
d.norm_department_compare_id,
|
||||
d.norm_department_compare_name,
|
||||
d.prepare_beds_count,
|
||||
d.department_phone,
|
||||
d.department_mail,
|
||||
d.establish_date,
|
||||
d.revoke_date,
|
||||
d.create_by,
|
||||
d.create_time,
|
||||
d.update_by,
|
||||
d.update_time;
|
||||
</select>
|
||||
|
||||
<select id="selectDepartmentListOperationNum" resultType="com.xinelu.manage.domain.department.Department">
|
||||
select d.id,
|
||||
d.parent_department_id,
|
||||
d.agency_id,
|
||||
d.agency_name,
|
||||
d.department_name,
|
||||
d.department_code,
|
||||
d.department_type,
|
||||
d.department_abbreviation,
|
||||
d.department_person_id,
|
||||
d.department_person_name,
|
||||
d.node_type,
|
||||
d.provide_service_category,
|
||||
d.subdivision_category_id,
|
||||
d.subdivision_category_name,
|
||||
d.norm_department_compare_id,
|
||||
d.norm_department_compare_name,
|
||||
d.prepare_beds_count,
|
||||
d.department_phone,
|
||||
d.department_mail,
|
||||
d.establish_date,
|
||||
d.revoke_date,
|
||||
d.create_by,
|
||||
d.create_time,
|
||||
d.update_by,
|
||||
d.update_time,
|
||||
count(oi.id) AS countNum
|
||||
from department d left join operation_info oi on d.id = oi.department_id
|
||||
<where>
|
||||
<if test="departmentCode != null and departmentCode != ''">
|
||||
and d.department_code =
|
||||
#{departmentCode}
|
||||
</if>
|
||||
<if test="departmentName != null and departmentName != ''">
|
||||
and d.department_name like concat('%',
|
||||
#{departmentName},
|
||||
'%'
|
||||
)
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY d.id,
|
||||
d.parent_department_id,
|
||||
d.agency_id,
|
||||
d.agency_name,
|
||||
d.department_name,
|
||||
d.department_code,
|
||||
d.department_type,
|
||||
d.department_abbreviation,
|
||||
d.department_person_id,
|
||||
d.department_person_name,
|
||||
d.node_type,
|
||||
d.provide_service_category,
|
||||
d.subdivision_category_id,
|
||||
d.subdivision_category_name,
|
||||
d.norm_department_compare_id,
|
||||
d.norm_department_compare_name,
|
||||
d.prepare_beds_count,
|
||||
d.department_phone,
|
||||
d.department_mail,
|
||||
d.establish_date,
|
||||
d.revoke_date,
|
||||
d.create_by,
|
||||
d.create_time,
|
||||
d.update_by,
|
||||
d.update_time;
|
||||
</select>
|
||||
|
||||
<insert id="insertDepartment" parameterType="Department" useGeneratedKeys="true"
|
||||
keyProperty="id">
|
||||
insert into department
|
||||
@ -242,76 +406,76 @@
|
||||
update department
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="parentDepartmentId != null">parent_department_id =
|
||||
#{parentDepartmentId},
|
||||
#{parentDepartmentId},
|
||||
</if>
|
||||
<if test="agencyId != null">agency_id =
|
||||
#{agencyId},
|
||||
#{agencyId},
|
||||
</if>
|
||||
<if test="agencyName != null">agency_name =
|
||||
#{agencyName},
|
||||
#{agencyName},
|
||||
</if>
|
||||
<if test="departmentName != null">department_name =
|
||||
#{departmentName},
|
||||
#{departmentName},
|
||||
</if>
|
||||
<if test="departmentCode != null">department_code =
|
||||
#{departmentCode},
|
||||
#{departmentCode},
|
||||
</if>
|
||||
<if test="departmentType != null">department_type =
|
||||
#{departmentType},
|
||||
#{departmentType},
|
||||
</if>
|
||||
<if test="departmentAbbreviation != null">department_abbreviation =
|
||||
#{departmentAbbreviation},
|
||||
#{departmentAbbreviation},
|
||||
</if>
|
||||
<if test="departmentPersonId != null">department_person_id =
|
||||
#{departmentPersonId},
|
||||
#{departmentPersonId},
|
||||
</if>
|
||||
<if test="departmentPersonName != null">department_person_name =
|
||||
#{departmentPersonName},
|
||||
#{departmentPersonName},
|
||||
</if>
|
||||
<if test="nodeType != null">node_type =
|
||||
#{nodeType},
|
||||
#{nodeType},
|
||||
</if>
|
||||
<if test="provideServiceCategory != null">provide_service_category =
|
||||
#{provideServiceCategory},
|
||||
#{provideServiceCategory},
|
||||
</if>
|
||||
<if test="subdivisionCategoryId != null">subdivision_category_id =
|
||||
#{subdivisionCategoryId},
|
||||
#{subdivisionCategoryId},
|
||||
</if>
|
||||
<if test="subdivisionCategoryName != null">subdivision_category_name =
|
||||
#{subdivisionCategoryName},
|
||||
#{subdivisionCategoryName},
|
||||
</if>
|
||||
<if test="normDepartmentCompareId != null">norm_department_compare_id =
|
||||
#{normDepartmentCompareId},
|
||||
#{normDepartmentCompareId},
|
||||
</if>
|
||||
<if test="normDepartmentCompareName != null">norm_department_compare_name =
|
||||
#{normDepartmentCompareName},
|
||||
#{normDepartmentCompareName},
|
||||
</if>
|
||||
<if test="prepareBedsCount != null">prepare_beds_count =
|
||||
#{prepareBedsCount},
|
||||
#{prepareBedsCount},
|
||||
</if>
|
||||
<if test="departmentPhone != null">department_phone =
|
||||
#{departmentPhone},
|
||||
#{departmentPhone},
|
||||
</if>
|
||||
<if test="departmentMail != null">department_mail =
|
||||
#{departmentMail},
|
||||
#{departmentMail},
|
||||
</if>
|
||||
<if test="establishDate != null">establish_date =
|
||||
#{establishDate},
|
||||
#{establishDate},
|
||||
</if>
|
||||
<if test="revokeDate != null">revoke_date =
|
||||
#{revokeDate},
|
||||
#{revokeDate},
|
||||
</if>
|
||||
<if test="createBy != null">create_by =
|
||||
#{createBy},
|
||||
#{createBy},
|
||||
</if>
|
||||
<if test="createTime != null">create_time =
|
||||
#{createTime},
|
||||
#{createTime},
|
||||
</if>
|
||||
<if test="updateBy != null">update_by =
|
||||
#{updateBy},
|
||||
#{updateBy},
|
||||
</if>
|
||||
<if test="updateTime != null">update_time =
|
||||
#{updateTime},
|
||||
#{updateTime},
|
||||
</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
|
||||
@ -112,11 +112,19 @@
|
||||
<include refid="selectScriptInfoVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
<select id="countByCommonScriptNameAndScriptId" resultType="java.lang.Integer">
|
||||
|
||||
<select id="countByScriptInfo" resultType="java.lang.Integer"
|
||||
parameterType="com.xinelu.manage.domain.scriptInfo.ScriptInfo">
|
||||
select count(*)
|
||||
from script_info
|
||||
where common_script_name = #{commonScriptName}
|
||||
and script_id = #{scriptId}
|
||||
<where>
|
||||
department_id = #{departmentId}
|
||||
and common_script_name = #{commonScriptName}
|
||||
<if test="diseaseTypeId != null ">
|
||||
and disease_type_id =
|
||||
#{diseaseTypeId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<insert id="insertScriptInfo" parameterType="ScriptInfo" useGeneratedKeys="true"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user