话术库管理:查询话术信息列表,新增话术信息,获取话术信息详细信息
This commit is contained in:
parent
8ff37f7d4f
commit
a52bbd168e
@ -0,0 +1,98 @@
|
||||
package com.xinelu.manage.controller.scriptInfo;
|
||||
|
||||
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.page.TableDataInfo;
|
||||
import com.xinelu.common.enums.BusinessType;
|
||||
import com.xinelu.common.utils.poi.ExcelUtil;
|
||||
import com.xinelu.manage.domain.scriptInfo.ScriptInfo;
|
||||
import com.xinelu.manage.service.scriptInfo.IScriptInfoService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 话术信息Controller
|
||||
*
|
||||
* @author xinelu
|
||||
* @date 2024-02-26
|
||||
*/
|
||||
@Api(tags = "话术库控制器")
|
||||
@RestController
|
||||
@RequestMapping("/manage/script")
|
||||
public class ScriptInfoController extends BaseController {
|
||||
@Resource
|
||||
private IScriptInfoService scriptInfoService;
|
||||
|
||||
/**
|
||||
* 查询话术信息列表
|
||||
*/
|
||||
@ApiOperation("查询话术信息列表")
|
||||
@PreAuthorize("@ss.hasPermi('manage:script:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ScriptInfo scriptInfo) {
|
||||
startPage();
|
||||
List<ScriptInfo> list = scriptInfoService.selectScriptInfoList(scriptInfo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出话术信息列表
|
||||
*/
|
||||
@ApiOperation("导出话术信息列表")
|
||||
@PreAuthorize("@ss.hasPermi('manage:script:export')")
|
||||
@Log(title = "话术信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, ScriptInfo scriptInfo) {
|
||||
List<ScriptInfo> list = scriptInfoService.selectScriptInfoList(scriptInfo);
|
||||
ExcelUtil<ScriptInfo> util = new ExcelUtil<ScriptInfo>(ScriptInfo.class);
|
||||
util.exportExcel(response, list, "话术信息数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取话术信息详细信息
|
||||
*/
|
||||
@ApiOperation("获取话术信息详细信息")
|
||||
@PreAuthorize("@ss.hasPermi('manage:script:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return AjaxResult.success(scriptInfoService.selectScriptInfoById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增话术信息
|
||||
*/
|
||||
@ApiOperation("新增话术信息")
|
||||
@PreAuthorize("@ss.hasPermi('manage:script:add')")
|
||||
@Log(title = "话术信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody ScriptInfo scriptInfo) {
|
||||
return toAjax(scriptInfoService.insertScriptInfo(scriptInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改话术信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('manage:script:edit')")
|
||||
@Log(title = "话术信息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody ScriptInfo scriptInfo) {
|
||||
return toAjax(scriptInfoService.updateScriptInfo(scriptInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除话术信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('manage:script:remove')")
|
||||
@Log(title = "话术信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(scriptInfoService.deleteScriptInfoByIds(ids));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,140 @@
|
||||
package com.xinelu.manage.domain.scriptInfo;
|
||||
|
||||
import com.xinelu.common.annotation.Excel;
|
||||
import com.xinelu.common.core.domain.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 话术信息对象 script_info
|
||||
*
|
||||
* @author xinelu
|
||||
* @date 2024-02-26
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel(value = "话术信息对象", description = "script_info")
|
||||
public class ScriptInfo extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 所属科室id
|
||||
*/
|
||||
@ApiModelProperty(value = "所属科室id")
|
||||
@Excel(name = "所属科室id")
|
||||
private Long departmentId;
|
||||
|
||||
/**
|
||||
* 所属科室名称
|
||||
*/
|
||||
@ApiModelProperty(value = "所属科室名称")
|
||||
@Excel(name = "所属科室名称")
|
||||
private String departmentName;
|
||||
|
||||
/**
|
||||
* 病种id
|
||||
*/
|
||||
@ApiModelProperty(value = "病种id")
|
||||
@Excel(name = "病种id")
|
||||
private Long diseaseTypeId;
|
||||
|
||||
/**
|
||||
* 病种名称
|
||||
*/
|
||||
@ApiModelProperty(value = "病种名称")
|
||||
@Excel(name = "病种名称")
|
||||
private String diseaseTypeName;
|
||||
|
||||
/**
|
||||
* 通用话术名称
|
||||
*/
|
||||
@ApiModelProperty(value = "通用话术名称")
|
||||
@Excel(name = "通用话术名称")
|
||||
private String commonScriptName;
|
||||
|
||||
/**
|
||||
* 话术名称
|
||||
*/
|
||||
@ApiModelProperty(value = "话术名称")
|
||||
@Excel(name = "话术名称")
|
||||
private String scriptName;
|
||||
|
||||
/**
|
||||
* 话术ID
|
||||
*/
|
||||
@ApiModelProperty(value = "话术ID")
|
||||
@Excel(name = "话术ID")
|
||||
private String scriptId;
|
||||
|
||||
/**
|
||||
* 平台ID
|
||||
*/
|
||||
@ApiModelProperty(value = "平台ID")
|
||||
@Excel(name = "平台ID")
|
||||
private String platformId;
|
||||
|
||||
/**
|
||||
* 话术状态,正常:NORMAL,下架:OFF_SHELF,暂停:SUSPEND
|
||||
*/
|
||||
@ApiModelProperty(value = "话术状态,正常:NORMAL,下架:OFF_SHELF,暂停:SUSPEND")
|
||||
@Excel(name = "话术状态,正常:NORMAL,下架:OFF_SHELF,暂停:SUSPEND")
|
||||
private String scriptStatus;
|
||||
|
||||
/**
|
||||
* 话术简介
|
||||
*/
|
||||
@ApiModelProperty(value = "话术简介")
|
||||
@Excel(name = "话术简介")
|
||||
private String scriptIntroduction;
|
||||
|
||||
/**
|
||||
* 话术排序
|
||||
*/
|
||||
@ApiModelProperty(value = "话术排序")
|
||||
@Excel(name = "话术排序")
|
||||
private Integer scriptSort;
|
||||
|
||||
/**
|
||||
* 话术备注
|
||||
*/
|
||||
@ApiModelProperty(value = "话术备注")
|
||||
@Excel(name = "话术备注")
|
||||
private String scriptRemark;
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("departmentId", getDepartmentId())
|
||||
.append("departmentName", getDepartmentName())
|
||||
.append("diseaseTypeId", getDiseaseTypeId())
|
||||
.append("diseaseTypeName", getDiseaseTypeName())
|
||||
.append("commonScriptName", getCommonScriptName())
|
||||
.append("scriptName", getScriptName())
|
||||
.append("scriptId", getScriptId())
|
||||
.append("platformId", getPlatformId())
|
||||
.append("scriptStatus", getScriptStatus())
|
||||
.append("scriptIntroduction", getScriptIntroduction())
|
||||
.append("scriptSort", getScriptSort())
|
||||
.append("scriptRemark", getScriptRemark())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,72 @@
|
||||
package com.xinelu.manage.mapper.scriptInfo;
|
||||
|
||||
import com.xinelu.manage.domain.scriptInfo.ScriptInfo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 话术信息Mapper接口
|
||||
*
|
||||
* @author xinelu
|
||||
* @date 2024-02-26
|
||||
*/
|
||||
public interface ScriptInfoMapper {
|
||||
/**
|
||||
* 查询话术信息
|
||||
*
|
||||
* @param id 话术信息主键
|
||||
* @return 话术信息
|
||||
*/
|
||||
public ScriptInfo selectScriptInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 查询话术信息列表
|
||||
*
|
||||
* @param scriptInfo 话术信息
|
||||
* @return 话术信息集合
|
||||
*/
|
||||
public List<ScriptInfo> selectScriptInfoList(ScriptInfo scriptInfo);
|
||||
|
||||
/**
|
||||
* 新增话术信息
|
||||
*
|
||||
* @param scriptInfo 话术信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertScriptInfo(ScriptInfo scriptInfo);
|
||||
|
||||
/**
|
||||
* 修改话术信息
|
||||
*
|
||||
* @param scriptInfo 话术信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateScriptInfo(ScriptInfo scriptInfo);
|
||||
|
||||
/**
|
||||
* 删除话术信息
|
||||
*
|
||||
* @param id 话术信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteScriptInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除话术信息
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteScriptInfoByIds(Long[] ids);
|
||||
|
||||
|
||||
/**
|
||||
* 根据通用话术名称和话术ID判断通用话术名称是否存在
|
||||
* @param commonScriptName
|
||||
* @param scriptId
|
||||
* @return
|
||||
*/
|
||||
int countByCommonScriptNameAndScriptId(@Param("commonScriptName") String commonScriptName, @Param("scriptId") String scriptId);
|
||||
|
||||
}
|
||||
@ -0,0 +1,61 @@
|
||||
package com.xinelu.manage.service.scriptInfo;
|
||||
|
||||
import com.xinelu.manage.domain.scriptInfo.ScriptInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 话术信息Service接口
|
||||
*
|
||||
* @author xinelu
|
||||
* @date 2024-02-26
|
||||
*/
|
||||
public interface IScriptInfoService {
|
||||
/**
|
||||
* 查询话术信息
|
||||
*
|
||||
* @param id 话术信息主键
|
||||
* @return 话术信息
|
||||
*/
|
||||
public ScriptInfo selectScriptInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 查询话术信息列表
|
||||
*
|
||||
* @param scriptInfo 话术信息
|
||||
* @return 话术信息集合
|
||||
*/
|
||||
public List<ScriptInfo> selectScriptInfoList(ScriptInfo scriptInfo);
|
||||
|
||||
/**
|
||||
* 新增话术信息
|
||||
*
|
||||
* @param scriptInfo 话术信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertScriptInfo(ScriptInfo scriptInfo);
|
||||
|
||||
/**
|
||||
* 修改话术信息
|
||||
*
|
||||
* @param scriptInfo 话术信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateScriptInfo(ScriptInfo scriptInfo);
|
||||
|
||||
/**
|
||||
* 批量删除话术信息
|
||||
*
|
||||
* @param ids 需要删除的话术信息主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteScriptInfoByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除话术信息信息
|
||||
*
|
||||
* @param id 话术信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteScriptInfoById(Long id);
|
||||
}
|
||||
@ -0,0 +1,120 @@
|
||||
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;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 话术信息Service业务层处理
|
||||
*
|
||||
* @author xinelu
|
||||
* @date 2024-02-26
|
||||
*/
|
||||
@Service
|
||||
public class ScriptInfoServiceImpl implements IScriptInfoService {
|
||||
@Resource
|
||||
private ScriptInfoMapper scriptInfoMapper;
|
||||
|
||||
/**
|
||||
* 查询话术信息
|
||||
*
|
||||
* @param id 话术信息主键
|
||||
* @return 话术信息
|
||||
*/
|
||||
@Override
|
||||
public ScriptInfo selectScriptInfoById(Long id) {
|
||||
return scriptInfoMapper.selectScriptInfoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询话术信息列表
|
||||
*
|
||||
* @param scriptInfo 话术信息
|
||||
* @return 话术信息
|
||||
*/
|
||||
@Override
|
||||
public List<ScriptInfo> selectScriptInfoList(ScriptInfo scriptInfo) {
|
||||
return scriptInfoMapper.selectScriptInfoList(scriptInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增话术信息
|
||||
*
|
||||
* @param scriptInfo 话术信息
|
||||
* @return 结果
|
||||
*/
|
||||
@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) {
|
||||
throw new ServiceException("通用话术名称已存在");
|
||||
}
|
||||
// 设置创建人与创建时间
|
||||
scriptInfo.setCreateBy(SecurityUtils.getUsername());
|
||||
scriptInfo.setCreateTime(DateUtils.getNowDate());
|
||||
return scriptInfoMapper.insertScriptInfo(scriptInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改话术信息
|
||||
*
|
||||
* @param scriptInfo 话术信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateScriptInfo(ScriptInfo scriptInfo) {
|
||||
scriptInfo.setUpdateTime(DateUtils.getNowDate());
|
||||
return scriptInfoMapper.updateScriptInfo(scriptInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除话术信息
|
||||
*
|
||||
* @param ids 需要删除的话术信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteScriptInfoByIds(Long[] ids) {
|
||||
return scriptInfoMapper.deleteScriptInfoByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除话术信息信息
|
||||
*
|
||||
* @param id 话术信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteScriptInfoById(Long id) {
|
||||
return scriptInfoMapper.deleteScriptInfoById(id);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,262 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.xinelu.manage.mapper.scriptInfo.ScriptInfoMapper">
|
||||
|
||||
<resultMap type="ScriptInfo" id="ScriptInfoResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="departmentId" column="department_id"/>
|
||||
<result property="departmentName" column="department_name"/>
|
||||
<result property="diseaseTypeId" column="disease_type_id"/>
|
||||
<result property="diseaseTypeName" column="disease_type_name"/>
|
||||
<result property="commonScriptName" column="common_script_name"/>
|
||||
<result property="scriptName" column="script_name"/>
|
||||
<result property="scriptId" column="script_id"/>
|
||||
<result property="platformId" column="platform_id"/>
|
||||
<result property="scriptStatus" column="script_status"/>
|
||||
<result property="scriptIntroduction" column="script_introduction"/>
|
||||
<result property="scriptSort" column="script_sort"/>
|
||||
<result property="scriptRemark" column="script_remark"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectScriptInfoVo">
|
||||
select id,
|
||||
department_id,
|
||||
department_name,
|
||||
disease_type_id,
|
||||
disease_type_name,
|
||||
common_script_name,
|
||||
script_name,
|
||||
script_id,
|
||||
platform_id,
|
||||
script_status,
|
||||
script_introduction,
|
||||
script_sort,
|
||||
script_remark,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time
|
||||
from script_info
|
||||
</sql>
|
||||
|
||||
<select id="selectScriptInfoList" parameterType="ScriptInfo" resultMap="ScriptInfoResult">
|
||||
<include refid="selectScriptInfoVo"/>
|
||||
<where>
|
||||
<if test="departmentId != null ">
|
||||
and department_id =
|
||||
#{departmentId}
|
||||
</if>
|
||||
<if test="departmentName != null and departmentName != ''">
|
||||
and department_name like concat('%',
|
||||
#{departmentName},
|
||||
'%'
|
||||
)
|
||||
</if>
|
||||
<if test="diseaseTypeId != null ">
|
||||
and disease_type_id =
|
||||
#{diseaseTypeId}
|
||||
</if>
|
||||
<if test="diseaseTypeName != null and diseaseTypeName != ''">
|
||||
and disease_type_name like concat('%',
|
||||
#{diseaseTypeName},
|
||||
'%'
|
||||
)
|
||||
</if>
|
||||
<if test="commonScriptName != null and commonScriptName != ''">
|
||||
and common_script_name like concat('%',
|
||||
#{commonScriptName},
|
||||
'%'
|
||||
)
|
||||
</if>
|
||||
<if test="scriptName != null and scriptName != ''">
|
||||
and script_name like concat('%',
|
||||
#{scriptName},
|
||||
'%'
|
||||
)
|
||||
</if>
|
||||
<if test="scriptId != null and scriptId != ''">
|
||||
and script_id =
|
||||
#{scriptId}
|
||||
</if>
|
||||
<if test="platformId != null and platformId != ''">
|
||||
and platform_id =
|
||||
#{platformId}
|
||||
</if>
|
||||
<if test="scriptStatus != null and scriptStatus != ''">
|
||||
and script_status =
|
||||
#{scriptStatus}
|
||||
</if>
|
||||
<if test="scriptIntroduction != null and scriptIntroduction != ''">
|
||||
and script_introduction =
|
||||
#{scriptIntroduction}
|
||||
</if>
|
||||
<if test="scriptSort != null ">
|
||||
and script_sort =
|
||||
#{scriptSort}
|
||||
</if>
|
||||
<if test="scriptRemark != null and scriptRemark != ''">
|
||||
and script_remark =
|
||||
#{scriptRemark}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectScriptInfoById" parameterType="Long"
|
||||
resultMap="ScriptInfoResult">
|
||||
<include refid="selectScriptInfoVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
<select id="countByCommonScriptNameAndScriptId" resultType="java.lang.Integer">
|
||||
select count(*)
|
||||
from script_info
|
||||
where common_script_name = #{commonScriptName}
|
||||
and script_id = #{scriptId}
|
||||
</select>
|
||||
|
||||
<insert id="insertScriptInfo" parameterType="ScriptInfo" useGeneratedKeys="true"
|
||||
keyProperty="id">
|
||||
insert into script_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="departmentId != null">department_id,
|
||||
</if>
|
||||
<if test="departmentName != null">department_name,
|
||||
</if>
|
||||
<if test="diseaseTypeId != null">disease_type_id,
|
||||
</if>
|
||||
<if test="diseaseTypeName != null">disease_type_name,
|
||||
</if>
|
||||
<if test="commonScriptName != null">common_script_name,
|
||||
</if>
|
||||
<if test="scriptName != null">script_name,
|
||||
</if>
|
||||
<if test="scriptId != null">script_id,
|
||||
</if>
|
||||
<if test="platformId != null">platform_id,
|
||||
</if>
|
||||
<if test="scriptStatus != null">script_status,
|
||||
</if>
|
||||
<if test="scriptIntroduction != null">script_introduction,
|
||||
</if>
|
||||
<if test="scriptSort != null">script_sort,
|
||||
</if>
|
||||
<if test="scriptRemark != null">script_remark,
|
||||
</if>
|
||||
<if test="createBy != null">create_by,
|
||||
</if>
|
||||
<if test="createTime != null">create_time,
|
||||
</if>
|
||||
<if test="updateBy != null">update_by,
|
||||
</if>
|
||||
<if test="updateTime != null">update_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="departmentId != null">#{departmentId},
|
||||
</if>
|
||||
<if test="departmentName != null">#{departmentName},
|
||||
</if>
|
||||
<if test="diseaseTypeId != null">#{diseaseTypeId},
|
||||
</if>
|
||||
<if test="diseaseTypeName != null">#{diseaseTypeName},
|
||||
</if>
|
||||
<if test="commonScriptName != null">#{commonScriptName},
|
||||
</if>
|
||||
<if test="scriptName != null">#{scriptName},
|
||||
</if>
|
||||
<if test="scriptId != null">#{scriptId},
|
||||
</if>
|
||||
<if test="platformId != null">#{platformId},
|
||||
</if>
|
||||
<if test="scriptStatus != null">#{scriptStatus},
|
||||
</if>
|
||||
<if test="scriptIntroduction != null">#{scriptIntroduction},
|
||||
</if>
|
||||
<if test="scriptSort != null">#{scriptSort},
|
||||
</if>
|
||||
<if test="scriptRemark != null">#{scriptRemark},
|
||||
</if>
|
||||
<if test="createBy != null">#{createBy},
|
||||
</if>
|
||||
<if test="createTime != null">#{createTime},
|
||||
</if>
|
||||
<if test="updateBy != null">#{updateBy},
|
||||
</if>
|
||||
<if test="updateTime != null">#{updateTime},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateScriptInfo" parameterType="ScriptInfo">
|
||||
update script_info
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="departmentId != null">department_id =
|
||||
#{departmentId},
|
||||
</if>
|
||||
<if test="departmentName != null">department_name =
|
||||
#{departmentName},
|
||||
</if>
|
||||
<if test="diseaseTypeId != null">disease_type_id =
|
||||
#{diseaseTypeId},
|
||||
</if>
|
||||
<if test="diseaseTypeName != null">disease_type_name =
|
||||
#{diseaseTypeName},
|
||||
</if>
|
||||
<if test="commonScriptName != null">common_script_name =
|
||||
#{commonScriptName},
|
||||
</if>
|
||||
<if test="scriptName != null">script_name =
|
||||
#{scriptName},
|
||||
</if>
|
||||
<if test="scriptId != null">script_id =
|
||||
#{scriptId},
|
||||
</if>
|
||||
<if test="platformId != null">platform_id =
|
||||
#{platformId},
|
||||
</if>
|
||||
<if test="scriptStatus != null">script_status =
|
||||
#{scriptStatus},
|
||||
</if>
|
||||
<if test="scriptIntroduction != null">script_introduction =
|
||||
#{scriptIntroduction},
|
||||
</if>
|
||||
<if test="scriptSort != null">script_sort =
|
||||
#{scriptSort},
|
||||
</if>
|
||||
<if test="scriptRemark != null">script_remark =
|
||||
#{scriptRemark},
|
||||
</if>
|
||||
<if test="createBy != null">create_by =
|
||||
#{createBy},
|
||||
</if>
|
||||
<if test="createTime != null">create_time =
|
||||
#{createTime},
|
||||
</if>
|
||||
<if test="updateBy != null">update_by =
|
||||
#{updateBy},
|
||||
</if>
|
||||
<if test="updateTime != null">update_time =
|
||||
#{updateTime},
|
||||
</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteScriptInfoById" parameterType="Long">
|
||||
delete
|
||||
from script_info
|
||||
where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteScriptInfoByIds" parameterType="String">
|
||||
delete from script_info where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue
Block a user