查询科室及其下属话术、手术数量信息,手术管理模块修改,话术管理模块修改

This commit is contained in:
youxilong 2024-02-28 13:06:05 +08:00
parent 500720f8b5
commit b1518f44a2
14 changed files with 331 additions and 107 deletions

View File

@ -3,6 +3,7 @@ package com.xinelu.manage.controller.department;
import com.xinelu.common.annotation.Log; import com.xinelu.common.annotation.Log;
import com.xinelu.common.core.controller.BaseController; import com.xinelu.common.core.controller.BaseController;
import com.xinelu.common.core.domain.AjaxResult; 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.core.page.TableDataInfo;
import com.xinelu.common.enums.BusinessType; import com.xinelu.common.enums.BusinessType;
import com.xinelu.common.utils.poi.ExcelUtil; import com.xinelu.common.utils.poi.ExcelUtil;
@ -93,4 +94,23 @@ public class DepartmentController extends BaseController {
public AjaxResult remove(@PathVariable Long[] ids) { public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(departmentService.deleteDepartmentByIds(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);
}
} }

View File

@ -25,7 +25,7 @@ import java.util.List;
*/ */
@Api(tags = "手术信息控制器") @Api(tags = "手术信息控制器")
@RestController @RestController
@RequestMapping("/operationInfo/operationInfo") @RequestMapping("/manage/operationInfo")
public class OperationInfoController extends BaseController { public class OperationInfoController extends BaseController {
@Resource @Resource
private IOperationInfoService operationInfoService; private IOperationInfoService operationInfoService;
@ -93,9 +93,9 @@ public class OperationInfoController extends BaseController {
@ApiOperation("删除手术信息") @ApiOperation("删除手术信息")
@PreAuthorize("@ss.hasPermi('operationInfo:operationInfo:remove')") @PreAuthorize("@ss.hasPermi('operationInfo:operationInfo:remove')")
@Log(title = "手术信息", businessType = BusinessType.DELETE) @Log(title = "手术信息", businessType = BusinessType.DELETE)
@DeleteMapping("remove/{id}") @DeleteMapping("remove/{ids}")
public AjaxResult remove(@PathVariable Long id) { public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(operationInfoService.deleteOperationInfoById(id)); return toAjax(operationInfoService.deleteOperationInfoByIds(ids));
} }
} }

View File

@ -71,7 +71,7 @@ public class ScriptInfoController extends BaseController {
@ApiOperation("新增话术信息") @ApiOperation("新增话术信息")
@PreAuthorize("@ss.hasPermi('manage:script:add')") @PreAuthorize("@ss.hasPermi('manage:script:add')")
@Log(title = "话术信息", businessType = BusinessType.INSERT) @Log(title = "话术信息", businessType = BusinessType.INSERT)
@PostMapping @PostMapping(value = "/add")
public AjaxResult add(@RequestBody ScriptInfo scriptInfo) { public AjaxResult add(@RequestBody ScriptInfo scriptInfo) {
return toAjax(scriptInfoService.insertScriptInfo(scriptInfo)); return toAjax(scriptInfoService.insertScriptInfo(scriptInfo));
} }
@ -79,9 +79,10 @@ public class ScriptInfoController extends BaseController {
/** /**
* 修改话术信息 * 修改话术信息
*/ */
@ApiOperation("修改话术信息")
@PreAuthorize("@ss.hasPermi('manage:script:edit')") @PreAuthorize("@ss.hasPermi('manage:script:edit')")
@Log(title = "话术信息", businessType = BusinessType.UPDATE) @Log(title = "话术信息", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping(value = "/edit")
public AjaxResult edit(@RequestBody ScriptInfo scriptInfo) { public AjaxResult edit(@RequestBody ScriptInfo scriptInfo) {
return toAjax(scriptInfoService.updateScriptInfo(scriptInfo)); return toAjax(scriptInfoService.updateScriptInfo(scriptInfo));
} }
@ -89,9 +90,10 @@ public class ScriptInfoController extends BaseController {
/** /**
* 删除话术信息 * 删除话术信息
*/ */
@ApiOperation("删除话术信息")
@PreAuthorize("@ss.hasPermi('manage:script:remove')") @PreAuthorize("@ss.hasPermi('manage:script:remove')")
@Log(title = "话术信息", businessType = BusinessType.DELETE) @Log(title = "话术信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}") @DeleteMapping("remove/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) { public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(scriptInfoService.deleteScriptInfoByIds(ids)); return toAjax(scriptInfoService.deleteScriptInfoByIds(ids));
} }

View File

@ -176,6 +176,12 @@ public class Department extends BaseEntity {
@Excel(name = "撤销日期", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "撤销日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date revokeDate; private Date revokeDate;
/**
* 包含附属数量比如科室下所含话术数量
*/
@ApiModelProperty(value = "包含附属数量")
private Integer countNum;
@Override @Override
public String toString() { public String toString() {
@ -201,6 +207,7 @@ public class Department extends BaseEntity {
.append("departmentMail", getDepartmentMail()) .append("departmentMail", getDepartmentMail())
.append("establishDate", getEstablishDate()) .append("establishDate", getEstablishDate())
.append("revokeDate", getRevokeDate()) .append("revokeDate", getRevokeDate())
.append("countNum", getCountNum())
.append("createBy", getCreateBy()) .append("createBy", getCreateBy())
.append("createTime", getCreateTime()) .append("createTime", getCreateTime())
.append("updateBy", getUpdateBy()) .append("updateBy", getUpdateBy())

View File

@ -2,6 +2,8 @@ package com.xinelu.manage.domain.scriptInfo;
import com.xinelu.common.annotation.Excel; import com.xinelu.common.annotation.Excel;
import com.xinelu.common.core.domain.BaseEntity; 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.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
@ -10,6 +12,9 @@ import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
/** /**
* 话术信息对象 script_info * 话术信息对象 script_info
@ -35,6 +40,7 @@ public class ScriptInfo extends BaseEntity {
*/ */
@ApiModelProperty(value = "所属科室id") @ApiModelProperty(value = "所属科室id")
@Excel(name = "所属科室id") @Excel(name = "所属科室id")
@NotBlank(message = "科室id不能为空")
private Long departmentId; private Long departmentId;
/** /**
@ -42,6 +48,7 @@ public class ScriptInfo extends BaseEntity {
*/ */
@ApiModelProperty(value = "所属科室名称") @ApiModelProperty(value = "所属科室名称")
@Excel(name = "所属科室名称") @Excel(name = "所属科室名称")
@NotBlank(message = "科室名称不能为空")
private String departmentName; private String departmentName;
/** /**
@ -63,6 +70,8 @@ public class ScriptInfo extends BaseEntity {
*/ */
@ApiModelProperty(value = "通用话术名称") @ApiModelProperty(value = "通用话术名称")
@Excel(name = "通用话术名称") @Excel(name = "通用话术名称")
@NotBlank(message = "通用话术名称不能为空", groups = {Insert.class, Update.class})
@Length(max = 100, message = "通用话术名称名称不能超过100个字符", groups = {Insert.class, Update.class})
private String commonScriptName; private String commonScriptName;
/** /**
@ -70,6 +79,8 @@ public class ScriptInfo extends BaseEntity {
*/ */
@ApiModelProperty(value = "话术名称") @ApiModelProperty(value = "话术名称")
@Excel(name = "话术名称") @Excel(name = "话术名称")
@NotBlank(message = "话术名称不能为空", groups = {Insert.class, Update.class})
@Length(max = 100, message = "话术名称不能超过100个字符", groups = {Insert.class, Update.class})
private String scriptName; private String scriptName;
/** /**
@ -77,6 +88,7 @@ public class ScriptInfo extends BaseEntity {
*/ */
@ApiModelProperty(value = "话术ID") @ApiModelProperty(value = "话术ID")
@Excel(name = "话术ID") @Excel(name = "话术ID")
@NotBlank(message = "话术ID不能为空", groups = {Insert.class, Update.class})
private String scriptId; private String scriptId;
/** /**
@ -84,6 +96,7 @@ public class ScriptInfo extends BaseEntity {
*/ */
@ApiModelProperty(value = "平台ID") @ApiModelProperty(value = "平台ID")
@Excel(name = "平台ID") @Excel(name = "平台ID")
@NotBlank(message = "平台ID不能为空", groups = {Insert.class, Update.class})
private String platformId; private String platformId;
/** /**
@ -91,6 +104,7 @@ public class ScriptInfo extends BaseEntity {
*/ */
@ApiModelProperty(value = "话术状态正常NORMAL下架OFF_SHELF暂停SUSPEND") @ApiModelProperty(value = "话术状态正常NORMAL下架OFF_SHELF暂停SUSPEND")
@Excel(name = "话术状态正常NORMAL下架OFF_SHELF暂停SUSPEND") @Excel(name = "话术状态正常NORMAL下架OFF_SHELF暂停SUSPEND")
@NotBlank(message = "话术状态不能为空", groups = {Insert.class, Update.class})
private String scriptStatus; private String scriptStatus;
/** /**
@ -98,6 +112,8 @@ public class ScriptInfo extends BaseEntity {
*/ */
@ApiModelProperty(value = "话术简介") @ApiModelProperty(value = "话术简介")
@Excel(name = "话术简介") @Excel(name = "话术简介")
@NotBlank(message = "话术简介不能为空", groups = {Insert.class, Update.class})
@Length(max = 100, message = "话术简介不能超过200个字符", groups = {Insert.class, Update.class})
private String scriptIntroduction; private String scriptIntroduction;
/** /**

View File

@ -59,4 +59,18 @@ public interface DepartmentMapper {
* @return 结果 * @return 结果
*/ */
int deleteDepartmentByIds(Long[] ids); int deleteDepartmentByIds(Long[] ids);
/**
* 查询科室信息列表及包含话术数量
* @param department
* @return
*/
List<Department> selectDepartmentListScriptNum(Department department);
/**
* 查询科室信息列表及包含手术数量
* @param department
* @return
*/
List<Department> selectDepartmentListOperationNum(Department department);
} }

View File

@ -60,13 +60,10 @@ public interface ScriptInfoMapper {
*/ */
public int deleteScriptInfoByIds(Long[] ids); public int deleteScriptInfoByIds(Long[] ids);
/** /**
* 根据通用话术名称和话术ID判断通用话术名称是否存在 * 判断通用话术名称是否存在
* @param commonScriptName * @param scriptInfo
* @param scriptId
* @return * @return
*/ */
int countByCommonScriptNameAndScriptId(@Param("commonScriptName") String commonScriptName, @Param("scriptId") String scriptId); int countByScriptInfo(ScriptInfo scriptInfo);
} }

View File

@ -59,4 +59,18 @@ public interface IDepartmentService {
* @return 结果 * @return 结果
*/ */
int deleteDepartmentById(Long id); int deleteDepartmentById(Long id);
/**
* 查询科室信息列表及包含话术数量
* @param department
* @return
*/
List<Department> selectDepartmentListScriptNum(Department department);
/**
* 查询科室信息列表及包含手术数量
* @param department
* @return
*/
List<Department> selectDepartmentListOperationNum(Department department);
} }

View File

@ -88,4 +88,26 @@ public class DepartmentServiceImpl implements IDepartmentService {
public int deleteDepartmentById(Long id) { public int deleteDepartmentById(Long id) {
return departmentMapper.deleteDepartmentById(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);
}
} }

View File

@ -51,11 +51,4 @@ public interface IOperationInfoService {
*/ */
public int deleteOperationInfoByIds(Long[] ids); public int deleteOperationInfoByIds(Long[] ids);
/**
* 删除手术信息信息
*
* @param id 手术信息主键
* @return 结果
*/
public int deleteOperationInfoById(Long id);
} }

View File

@ -111,21 +111,4 @@ public class OperationInfoServiceImpl implements IOperationInfoService {
public int deleteOperationInfoByIds(Long[] ids) { public int deleteOperationInfoByIds(Long[] ids) {
return operationInfoMapper.deleteOperationInfoByIds(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);
}
} }

View File

@ -3,11 +3,9 @@ package com.xinelu.manage.service.scriptInfo.impl;
import com.xinelu.common.exception.ServiceException; import com.xinelu.common.exception.ServiceException;
import com.xinelu.common.utils.DateUtils; import com.xinelu.common.utils.DateUtils;
import com.xinelu.common.utils.SecurityUtils; import com.xinelu.common.utils.SecurityUtils;
import com.xinelu.common.utils.StringUtils;
import com.xinelu.manage.domain.scriptInfo.ScriptInfo; import com.xinelu.manage.domain.scriptInfo.ScriptInfo;
import com.xinelu.manage.mapper.scriptInfo.ScriptInfoMapper; import com.xinelu.manage.mapper.scriptInfo.ScriptInfoMapper;
import com.xinelu.manage.service.scriptInfo.IScriptInfoService; import com.xinelu.manage.service.scriptInfo.IScriptInfoService;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
@ -54,28 +52,8 @@ public class ScriptInfoServiceImpl implements IScriptInfoService {
*/ */
@Override @Override
public int insertScriptInfo(ScriptInfo scriptInfo) { 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 (scriptInfoMapper.countByScriptInfo(scriptInfo) > 0) {
if (existingNameCount > 0) {
throw new ServiceException("通用话术名称已存在"); throw new ServiceException("通用话术名称已存在");
} }
// 设置创建人与创建时间 // 设置创建人与创建时间
@ -92,6 +70,12 @@ public class ScriptInfoServiceImpl implements IScriptInfoService {
*/ */
@Override @Override
public int updateScriptInfo(ScriptInfo scriptInfo) { public int updateScriptInfo(ScriptInfo scriptInfo) {
// 判断通用话术名称是否存在
if (scriptInfoMapper.countByScriptInfo(scriptInfo) > 0) {
throw new ServiceException("通用话术名称已存在");
}
// 设置修改人和修改时间
scriptInfo.setUpdateBy(SecurityUtils.getUsername());
scriptInfo.setUpdateTime(DateUtils.getNowDate()); scriptInfo.setUpdateTime(DateUtils.getNowDate());
return scriptInfoMapper.updateScriptInfo(scriptInfo); return scriptInfoMapper.updateScriptInfo(scriptInfo);
} }

View File

@ -65,64 +65,94 @@
<include refid="selectDepartmentVo"/> <include refid="selectDepartmentVo"/>
<where> <where>
<if test="parentDepartmentId != null "> <if test="parentDepartmentId != null ">
and parent_department_id = #{parentDepartmentId} and parent_department_id =
#{parentDepartmentId}
</if> </if>
<if test="agencyId != null "> <if test="agencyId != null ">
and agency_id = #{agencyId} and agency_id =
#{agencyId}
</if> </if>
<if test="agencyName != null and agencyName != ''"> <if test="agencyName != null and agencyName != ''">
and agency_name like concat('%', #{agencyName}, '%') and agency_name like concat('%',
#{agencyName},
'%'
)
</if> </if>
<if test="departmentName != null and departmentName != ''"> <if test="departmentName != null and departmentName != ''">
and department_name like concat('%', #{departmentName}, '%') and department_name like concat('%',
#{departmentName},
'%'
)
</if> </if>
<if test="departmentCode != null and departmentCode != ''"> <if test="departmentCode != null and departmentCode != ''">
and department_code = #{departmentCode} and department_code =
#{departmentCode}
</if> </if>
<if test="departmentType != null and departmentType != ''"> <if test="departmentType != null and departmentType != ''">
and department_type = #{departmentType} and department_type =
#{departmentType}
</if> </if>
<if test="departmentAbbreviation != null and departmentAbbreviation != ''"> <if test="departmentAbbreviation != null and departmentAbbreviation != ''">
and department_abbreviation = #{departmentAbbreviation} and department_abbreviation =
#{departmentAbbreviation}
</if> </if>
<if test="departmentPersonId != null "> <if test="departmentPersonId != null ">
and department_person_id = #{departmentPersonId} and department_person_id =
#{departmentPersonId}
</if> </if>
<if test="departmentPersonName != null and departmentPersonName != ''"> <if test="departmentPersonName != null and departmentPersonName != ''">
and department_person_name like concat('%', #{departmentPersonName}, '%') and department_person_name like concat('%',
#{departmentPersonName},
'%'
)
</if> </if>
<if test="nodeType != null and nodeType != ''"> <if test="nodeType != null and nodeType != ''">
and node_type = #{nodeType} and node_type =
#{nodeType}
</if> </if>
<if test="provideServiceCategory != null and provideServiceCategory != ''"> <if test="provideServiceCategory != null and provideServiceCategory != ''">
and provide_service_category = #{provideServiceCategory} and provide_service_category =
#{provideServiceCategory}
</if> </if>
<if test="subdivisionCategoryId != null "> <if test="subdivisionCategoryId != null ">
and subdivision_category_id = #{subdivisionCategoryId} and subdivision_category_id =
#{subdivisionCategoryId}
</if> </if>
<if test="subdivisionCategoryName != null and subdivisionCategoryName != ''"> <if test="subdivisionCategoryName != null and subdivisionCategoryName != ''">
and subdivision_category_name like concat('%', #{subdivisionCategoryName}, '%') and subdivision_category_name like concat('%',
#{subdivisionCategoryName},
'%'
)
</if> </if>
<if test="normDepartmentCompareId != null "> <if test="normDepartmentCompareId != null ">
and norm_department_compare_id = #{normDepartmentCompareId} and norm_department_compare_id =
#{normDepartmentCompareId}
</if> </if>
<if test="normDepartmentCompareName != null and normDepartmentCompareName != ''"> <if test="normDepartmentCompareName != null and normDepartmentCompareName != ''">
and norm_department_compare_name like concat('%', #{normDepartmentCompareName}, '%') and norm_department_compare_name like concat('%',
#{normDepartmentCompareName},
'%'
)
</if> </if>
<if test="prepareBedsCount != null "> <if test="prepareBedsCount != null ">
and prepare_beds_count = #{prepareBedsCount} and prepare_beds_count =
#{prepareBedsCount}
</if> </if>
<if test="departmentPhone != null and departmentPhone != ''"> <if test="departmentPhone != null and departmentPhone != ''">
and department_phone = #{departmentPhone} and department_phone =
#{departmentPhone}
</if> </if>
<if test="departmentMail != null and departmentMail != ''"> <if test="departmentMail != null and departmentMail != ''">
and department_mail = #{departmentMail} and department_mail =
#{departmentMail}
</if> </if>
<if test="establishDate != null "> <if test="establishDate != null ">
and establish_date = #{establishDate} and establish_date =
#{establishDate}
</if> </if>
<if test="revokeDate != null "> <if test="revokeDate != null ">
and revoke_date = #{revokeDate} and revoke_date =
#{revokeDate}
</if> </if>
</where> </where>
</select> </select>
@ -133,6 +163,140 @@
where id = #{id} where id = #{id}
</select> </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" <insert id="insertDepartment" parameterType="Department" useGeneratedKeys="true"
keyProperty="id"> keyProperty="id">
insert into department insert into department
@ -242,76 +406,76 @@
update department update department
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="parentDepartmentId != null">parent_department_id = <if test="parentDepartmentId != null">parent_department_id =
#{parentDepartmentId}, #{parentDepartmentId},
</if> </if>
<if test="agencyId != null">agency_id = <if test="agencyId != null">agency_id =
#{agencyId}, #{agencyId},
</if> </if>
<if test="agencyName != null">agency_name = <if test="agencyName != null">agency_name =
#{agencyName}, #{agencyName},
</if> </if>
<if test="departmentName != null">department_name = <if test="departmentName != null">department_name =
#{departmentName}, #{departmentName},
</if> </if>
<if test="departmentCode != null">department_code = <if test="departmentCode != null">department_code =
#{departmentCode}, #{departmentCode},
</if> </if>
<if test="departmentType != null">department_type = <if test="departmentType != null">department_type =
#{departmentType}, #{departmentType},
</if> </if>
<if test="departmentAbbreviation != null">department_abbreviation = <if test="departmentAbbreviation != null">department_abbreviation =
#{departmentAbbreviation}, #{departmentAbbreviation},
</if> </if>
<if test="departmentPersonId != null">department_person_id = <if test="departmentPersonId != null">department_person_id =
#{departmentPersonId}, #{departmentPersonId},
</if> </if>
<if test="departmentPersonName != null">department_person_name = <if test="departmentPersonName != null">department_person_name =
#{departmentPersonName}, #{departmentPersonName},
</if> </if>
<if test="nodeType != null">node_type = <if test="nodeType != null">node_type =
#{nodeType}, #{nodeType},
</if> </if>
<if test="provideServiceCategory != null">provide_service_category = <if test="provideServiceCategory != null">provide_service_category =
#{provideServiceCategory}, #{provideServiceCategory},
</if> </if>
<if test="subdivisionCategoryId != null">subdivision_category_id = <if test="subdivisionCategoryId != null">subdivision_category_id =
#{subdivisionCategoryId}, #{subdivisionCategoryId},
</if> </if>
<if test="subdivisionCategoryName != null">subdivision_category_name = <if test="subdivisionCategoryName != null">subdivision_category_name =
#{subdivisionCategoryName}, #{subdivisionCategoryName},
</if> </if>
<if test="normDepartmentCompareId != null">norm_department_compare_id = <if test="normDepartmentCompareId != null">norm_department_compare_id =
#{normDepartmentCompareId}, #{normDepartmentCompareId},
</if> </if>
<if test="normDepartmentCompareName != null">norm_department_compare_name = <if test="normDepartmentCompareName != null">norm_department_compare_name =
#{normDepartmentCompareName}, #{normDepartmentCompareName},
</if> </if>
<if test="prepareBedsCount != null">prepare_beds_count = <if test="prepareBedsCount != null">prepare_beds_count =
#{prepareBedsCount}, #{prepareBedsCount},
</if> </if>
<if test="departmentPhone != null">department_phone = <if test="departmentPhone != null">department_phone =
#{departmentPhone}, #{departmentPhone},
</if> </if>
<if test="departmentMail != null">department_mail = <if test="departmentMail != null">department_mail =
#{departmentMail}, #{departmentMail},
</if> </if>
<if test="establishDate != null">establish_date = <if test="establishDate != null">establish_date =
#{establishDate}, #{establishDate},
</if> </if>
<if test="revokeDate != null">revoke_date = <if test="revokeDate != null">revoke_date =
#{revokeDate}, #{revokeDate},
</if> </if>
<if test="createBy != null">create_by = <if test="createBy != null">create_by =
#{createBy}, #{createBy},
</if> </if>
<if test="createTime != null">create_time = <if test="createTime != null">create_time =
#{createTime}, #{createTime},
</if> </if>
<if test="updateBy != null">update_by = <if test="updateBy != null">update_by =
#{updateBy}, #{updateBy},
</if> </if>
<if test="updateTime != null">update_time = <if test="updateTime != null">update_time =
#{updateTime}, #{updateTime},
</if> </if>
</trim> </trim>
where id = #{id} where id = #{id}

View File

@ -112,11 +112,19 @@
<include refid="selectScriptInfoVo"/> <include refid="selectScriptInfoVo"/>
where id = #{id} where id = #{id}
</select> </select>
<select id="countByCommonScriptNameAndScriptId" resultType="java.lang.Integer">
<select id="countByScriptInfo" resultType="java.lang.Integer"
parameterType="com.xinelu.manage.domain.scriptInfo.ScriptInfo">
select count(*) select count(*)
from script_info from script_info
where common_script_name = #{commonScriptName} <where>
and script_id = #{scriptId} department_id = #{departmentId}
and common_script_name = #{commonScriptName}
<if test="diseaseTypeId != null ">
and disease_type_id =
#{diseaseTypeId}
</if>
</where>
</select> </select>
<insert id="insertScriptInfo" parameterType="ScriptInfo" useGeneratedKeys="true" <insert id="insertScriptInfo" parameterType="ScriptInfo" useGeneratedKeys="true"