点检计划-点检项目
This commit is contained in:
parent
67c9b42855
commit
d4d465860a
@ -0,0 +1,113 @@
|
||||
package com.ktg.mes.dv.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.ktg.common.constant.UserConstants;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ktg.common.annotation.Log;
|
||||
import com.ktg.common.core.controller.BaseController;
|
||||
import com.ktg.common.core.domain.AjaxResult;
|
||||
import com.ktg.common.enums.BusinessType;
|
||||
import com.ktg.mes.dv.domain.DvCheckSubject;
|
||||
import com.ktg.mes.dv.service.IDvCheckSubjectService;
|
||||
import com.ktg.common.utils.poi.ExcelUtil;
|
||||
import com.ktg.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 点检项目Controller
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-18
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mes/dv/checksubject")
|
||||
public class DvCheckSubjectController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IDvCheckSubjectService dvCheckSubjectService;
|
||||
|
||||
/**
|
||||
* 查询点检项目列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:dv:checksubject:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(DvCheckSubject dvCheckSubject)
|
||||
{
|
||||
startPage();
|
||||
List<DvCheckSubject> list = dvCheckSubjectService.selectDvCheckSubjectList(dvCheckSubject);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出点检项目列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:dv:checksubject:export')")
|
||||
@Log(title = "点检项目", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, DvCheckSubject dvCheckSubject)
|
||||
{
|
||||
List<DvCheckSubject> list = dvCheckSubjectService.selectDvCheckSubjectList(dvCheckSubject);
|
||||
ExcelUtil<DvCheckSubject> util = new ExcelUtil<DvCheckSubject>(DvCheckSubject.class);
|
||||
util.exportExcel(response, list, "点检项目数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取点检项目详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:dv:checksubject:query')")
|
||||
@GetMapping(value = "/{recordId}")
|
||||
public AjaxResult getInfo(@PathVariable("recordId") Long recordId)
|
||||
{
|
||||
return AjaxResult.success(dvCheckSubjectService.selectDvCheckSubjectByRecordId(recordId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增点检项目
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:dv:checksubject:add')")
|
||||
@Log(title = "点检项目", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody DvCheckSubject dvCheckSubject)
|
||||
{
|
||||
if(UserConstants.NOT_UNIQUE.equals(dvCheckSubjectService.checkSubjectUnique(dvCheckSubject))){
|
||||
return AjaxResult.error("点检项目已经添加过!");
|
||||
}
|
||||
|
||||
return toAjax(dvCheckSubjectService.insertDvCheckSubject(dvCheckSubject));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改点检项目
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:dv:checksubject:edit')")
|
||||
@Log(title = "点检项目", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody DvCheckSubject dvCheckSubject)
|
||||
{
|
||||
if(UserConstants.NOT_UNIQUE.equals(dvCheckSubjectService.checkSubjectUnique(dvCheckSubject))){
|
||||
return AjaxResult.error("点检项目已经添加过!");
|
||||
}
|
||||
return toAjax(dvCheckSubjectService.updateDvCheckSubject(dvCheckSubject));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除点检项目
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:dv:checksubject:remove')")
|
||||
@Log(title = "点检项目", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{recordIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] recordIds)
|
||||
{
|
||||
return toAjax(dvCheckSubjectService.deleteDvCheckSubjectByRecordIds(recordIds));
|
||||
}
|
||||
}
|
192
ktg-mes/src/main/java/com/ktg/mes/dv/domain/DvCheckSubject.java
Normal file
192
ktg-mes/src/main/java/com/ktg/mes/dv/domain/DvCheckSubject.java
Normal file
@ -0,0 +1,192 @@
|
||||
package com.ktg.mes.dv.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ktg.common.annotation.Excel;
|
||||
import com.ktg.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 点检项目对象 dv_check_subject
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-18
|
||||
*/
|
||||
public class DvCheckSubject extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 流水号 */
|
||||
private Long recordId;
|
||||
|
||||
/** 计划ID */
|
||||
@Excel(name = "计划ID")
|
||||
private Long planId;
|
||||
|
||||
/** 设备ID */
|
||||
@Excel(name = "设备ID")
|
||||
private Long subjectId;
|
||||
|
||||
/** 项目编码 */
|
||||
@Excel(name = "项目编码")
|
||||
private String subjectCode;
|
||||
|
||||
/** 项目名称 */
|
||||
@Excel(name = "项目名称")
|
||||
private String subjectName;
|
||||
|
||||
/** 项目类型 */
|
||||
@Excel(name = "项目类型")
|
||||
private String subjectType;
|
||||
|
||||
/** 项目内容 */
|
||||
@Excel(name = "项目内容")
|
||||
private String subjectContent;
|
||||
|
||||
/** 标准 */
|
||||
@Excel(name = "标准")
|
||||
private String subjectStandard;
|
||||
|
||||
/** 预留字段1 */
|
||||
private String attr1;
|
||||
|
||||
/** 预留字段2 */
|
||||
private String attr2;
|
||||
|
||||
/** 预留字段3 */
|
||||
private Long attr3;
|
||||
|
||||
/** 预留字段4 */
|
||||
private Long attr4;
|
||||
|
||||
public void setRecordId(Long recordId)
|
||||
{
|
||||
this.recordId = recordId;
|
||||
}
|
||||
|
||||
public Long getRecordId()
|
||||
{
|
||||
return recordId;
|
||||
}
|
||||
public void setPlanId(Long planId)
|
||||
{
|
||||
this.planId = planId;
|
||||
}
|
||||
|
||||
public Long getPlanId()
|
||||
{
|
||||
return planId;
|
||||
}
|
||||
public void setSubjectId(Long subjectId)
|
||||
{
|
||||
this.subjectId = subjectId;
|
||||
}
|
||||
|
||||
public Long getSubjectId()
|
||||
{
|
||||
return subjectId;
|
||||
}
|
||||
public void setSubjectCode(String subjectCode)
|
||||
{
|
||||
this.subjectCode = subjectCode;
|
||||
}
|
||||
|
||||
public String getSubjectCode()
|
||||
{
|
||||
return subjectCode;
|
||||
}
|
||||
public void setSubjectName(String subjectName)
|
||||
{
|
||||
this.subjectName = subjectName;
|
||||
}
|
||||
|
||||
public String getSubjectName()
|
||||
{
|
||||
return subjectName;
|
||||
}
|
||||
public void setSubjectType(String subjectType)
|
||||
{
|
||||
this.subjectType = subjectType;
|
||||
}
|
||||
|
||||
public String getSubjectType()
|
||||
{
|
||||
return subjectType;
|
||||
}
|
||||
public void setSubjectContent(String subjectContent)
|
||||
{
|
||||
this.subjectContent = subjectContent;
|
||||
}
|
||||
|
||||
public String getSubjectContent()
|
||||
{
|
||||
return subjectContent;
|
||||
}
|
||||
public void setSubjectStandard(String subjectStandard)
|
||||
{
|
||||
this.subjectStandard = subjectStandard;
|
||||
}
|
||||
|
||||
public String getSubjectStandard()
|
||||
{
|
||||
return subjectStandard;
|
||||
}
|
||||
public void setAttr1(String attr1)
|
||||
{
|
||||
this.attr1 = attr1;
|
||||
}
|
||||
|
||||
public String getAttr1()
|
||||
{
|
||||
return attr1;
|
||||
}
|
||||
public void setAttr2(String attr2)
|
||||
{
|
||||
this.attr2 = attr2;
|
||||
}
|
||||
|
||||
public String getAttr2()
|
||||
{
|
||||
return attr2;
|
||||
}
|
||||
public void setAttr3(Long attr3)
|
||||
{
|
||||
this.attr3 = attr3;
|
||||
}
|
||||
|
||||
public Long getAttr3()
|
||||
{
|
||||
return attr3;
|
||||
}
|
||||
public void setAttr4(Long attr4)
|
||||
{
|
||||
this.attr4 = attr4;
|
||||
}
|
||||
|
||||
public Long getAttr4()
|
||||
{
|
||||
return attr4;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("recordId", getRecordId())
|
||||
.append("planId", getPlanId())
|
||||
.append("subjectId", getSubjectId())
|
||||
.append("subjectCode", getSubjectCode())
|
||||
.append("subjectName", getSubjectName())
|
||||
.append("subjectType", getSubjectType())
|
||||
.append("subjectContent", getSubjectContent())
|
||||
.append("subjectStandard", getSubjectStandard())
|
||||
.append("remark", getRemark())
|
||||
.append("attr1", getAttr1())
|
||||
.append("attr2", getAttr2())
|
||||
.append("attr3", getAttr3())
|
||||
.append("attr4", getAttr4())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
package com.ktg.mes.dv.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.mes.dv.domain.DvCheckSubject;
|
||||
|
||||
/**
|
||||
* 点检项目Mapper接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-18
|
||||
*/
|
||||
public interface DvCheckSubjectMapper
|
||||
{
|
||||
/**
|
||||
* 查询点检项目
|
||||
*
|
||||
* @param recordId 点检项目主键
|
||||
* @return 点检项目
|
||||
*/
|
||||
public DvCheckSubject selectDvCheckSubjectByRecordId(Long recordId);
|
||||
|
||||
/**
|
||||
* 查询点检项目列表
|
||||
*
|
||||
* @param dvCheckSubject 点检项目
|
||||
* @return 点检项目集合
|
||||
*/
|
||||
public List<DvCheckSubject> selectDvCheckSubjectList(DvCheckSubject dvCheckSubject);
|
||||
|
||||
|
||||
public DvCheckSubject checkSubjectUnique(DvCheckSubject dvCheckSubject);
|
||||
|
||||
/**
|
||||
* 新增点检项目
|
||||
*
|
||||
* @param dvCheckSubject 点检项目
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDvCheckSubject(DvCheckSubject dvCheckSubject);
|
||||
|
||||
/**
|
||||
* 修改点检项目
|
||||
*
|
||||
* @param dvCheckSubject 点检项目
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDvCheckSubject(DvCheckSubject dvCheckSubject);
|
||||
|
||||
/**
|
||||
* 删除点检项目
|
||||
*
|
||||
* @param recordId 点检项目主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvCheckSubjectByRecordId(Long recordId);
|
||||
|
||||
/**
|
||||
* 批量删除点检项目
|
||||
*
|
||||
* @param recordIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvCheckSubjectByRecordIds(Long[] recordIds);
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
package com.ktg.mes.dv.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.mes.dv.domain.DvCheckSubject;
|
||||
|
||||
/**
|
||||
* 点检项目Service接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-18
|
||||
*/
|
||||
public interface IDvCheckSubjectService
|
||||
{
|
||||
/**
|
||||
* 查询点检项目
|
||||
*
|
||||
* @param recordId 点检项目主键
|
||||
* @return 点检项目
|
||||
*/
|
||||
public DvCheckSubject selectDvCheckSubjectByRecordId(Long recordId);
|
||||
|
||||
/**
|
||||
* 查询点检项目列表
|
||||
*
|
||||
* @param dvCheckSubject 点检项目
|
||||
* @return 点检项目集合
|
||||
*/
|
||||
public List<DvCheckSubject> selectDvCheckSubjectList(DvCheckSubject dvCheckSubject);
|
||||
|
||||
|
||||
/**
|
||||
* 检查当前计划下,点检项目是否唯一
|
||||
* @param dvCheckSubject
|
||||
* @return
|
||||
*/
|
||||
public String checkSubjectUnique(DvCheckSubject dvCheckSubject);
|
||||
|
||||
/**
|
||||
* 新增点检项目
|
||||
*
|
||||
* @param dvCheckSubject 点检项目
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDvCheckSubject(DvCheckSubject dvCheckSubject);
|
||||
|
||||
/**
|
||||
* 修改点检项目
|
||||
*
|
||||
* @param dvCheckSubject 点检项目
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDvCheckSubject(DvCheckSubject dvCheckSubject);
|
||||
|
||||
/**
|
||||
* 批量删除点检项目
|
||||
*
|
||||
* @param recordIds 需要删除的点检项目主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvCheckSubjectByRecordIds(Long[] recordIds);
|
||||
|
||||
/**
|
||||
* 删除点检项目信息
|
||||
*
|
||||
* @param recordId 点检项目主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvCheckSubjectByRecordId(Long recordId);
|
||||
}
|
@ -0,0 +1,111 @@
|
||||
package com.ktg.mes.dv.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ktg.common.constant.UserConstants;
|
||||
import com.ktg.common.utils.DateUtils;
|
||||
import com.ktg.common.utils.StringUtils;
|
||||
import org.apache.catalina.User;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ktg.mes.dv.mapper.DvCheckSubjectMapper;
|
||||
import com.ktg.mes.dv.domain.DvCheckSubject;
|
||||
import com.ktg.mes.dv.service.IDvCheckSubjectService;
|
||||
|
||||
/**
|
||||
* 点检项目Service业务层处理
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-18
|
||||
*/
|
||||
@Service
|
||||
public class DvCheckSubjectServiceImpl implements IDvCheckSubjectService
|
||||
{
|
||||
@Autowired
|
||||
private DvCheckSubjectMapper dvCheckSubjectMapper;
|
||||
|
||||
/**
|
||||
* 查询点检项目
|
||||
*
|
||||
* @param recordId 点检项目主键
|
||||
* @return 点检项目
|
||||
*/
|
||||
@Override
|
||||
public DvCheckSubject selectDvCheckSubjectByRecordId(Long recordId)
|
||||
{
|
||||
return dvCheckSubjectMapper.selectDvCheckSubjectByRecordId(recordId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询点检项目列表
|
||||
*
|
||||
* @param dvCheckSubject 点检项目
|
||||
* @return 点检项目
|
||||
*/
|
||||
@Override
|
||||
public List<DvCheckSubject> selectDvCheckSubjectList(DvCheckSubject dvCheckSubject)
|
||||
{
|
||||
return dvCheckSubjectMapper.selectDvCheckSubjectList(dvCheckSubject);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String checkSubjectUnique(DvCheckSubject dvCheckSubject) {
|
||||
DvCheckSubject subject = dvCheckSubjectMapper.checkSubjectUnique(dvCheckSubject);
|
||||
Long recordId = dvCheckSubject.getRecordId()==null?-1L:dvCheckSubject.getRecordId();
|
||||
if(StringUtils.isNotNull(subject) && subject.getRecordId().longValue() != recordId.longValue()){
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
|
||||
return UserConstants.UNIQUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增点检项目
|
||||
*
|
||||
* @param dvCheckSubject 点检项目
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertDvCheckSubject(DvCheckSubject dvCheckSubject)
|
||||
{
|
||||
dvCheckSubject.setCreateTime(DateUtils.getNowDate());
|
||||
return dvCheckSubjectMapper.insertDvCheckSubject(dvCheckSubject);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改点检项目
|
||||
*
|
||||
* @param dvCheckSubject 点检项目
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateDvCheckSubject(DvCheckSubject dvCheckSubject)
|
||||
{
|
||||
dvCheckSubject.setUpdateTime(DateUtils.getNowDate());
|
||||
return dvCheckSubjectMapper.updateDvCheckSubject(dvCheckSubject);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除点检项目
|
||||
*
|
||||
* @param recordIds 需要删除的点检项目主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDvCheckSubjectByRecordIds(Long[] recordIds)
|
||||
{
|
||||
return dvCheckSubjectMapper.deleteDvCheckSubjectByRecordIds(recordIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除点检项目信息
|
||||
*
|
||||
* @param recordId 点检项目主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDvCheckSubjectByRecordId(Long recordId)
|
||||
{
|
||||
return dvCheckSubjectMapper.deleteDvCheckSubjectByRecordId(recordId);
|
||||
}
|
||||
}
|
127
ktg-mes/src/main/resources/mapper/dv/DvCheckSubjectMapper.xml
Normal file
127
ktg-mes/src/main/resources/mapper/dv/DvCheckSubjectMapper.xml
Normal file
@ -0,0 +1,127 @@
|
||||
<?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.ktg.mes.dv.mapper.DvCheckSubjectMapper">
|
||||
|
||||
<resultMap type="DvCheckSubject" id="DvCheckSubjectResult">
|
||||
<result property="recordId" column="record_id" />
|
||||
<result property="planId" column="plan_id" />
|
||||
<result property="subjectId" column="subject_id" />
|
||||
<result property="subjectCode" column="subject_code" />
|
||||
<result property="subjectName" column="subject_name" />
|
||||
<result property="subjectType" column="subject_type" />
|
||||
<result property="subjectContent" column="subject_content" />
|
||||
<result property="subjectStandard" column="subject_standard" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="attr1" column="attr1" />
|
||||
<result property="attr2" column="attr2" />
|
||||
<result property="attr3" column="attr3" />
|
||||
<result property="attr4" column="attr4" />
|
||||
<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="selectDvCheckSubjectVo">
|
||||
select record_id, plan_id, subject_id, subject_code, subject_name, subject_type, subject_content, subject_standard, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from dv_check_subject
|
||||
</sql>
|
||||
|
||||
<select id="selectDvCheckSubjectList" parameterType="DvCheckSubject" resultMap="DvCheckSubjectResult">
|
||||
<include refid="selectDvCheckSubjectVo"/>
|
||||
<where>
|
||||
<if test="planId != null "> and plan_id = #{planId}</if>
|
||||
<if test="subjectId != null "> and subject_id = #{subjectId}</if>
|
||||
<if test="subjectCode != null and subjectCode != ''"> and subject_code = #{subjectCode}</if>
|
||||
<if test="subjectName != null and subjectName != ''"> and subject_name like concat('%', #{subjectName}, '%')</if>
|
||||
<if test="subjectType != null and subjectType != ''"> and subject_type = #{subjectType}</if>
|
||||
<if test="subjectContent != null and subjectContent != ''"> and subject_content = #{subjectContent}</if>
|
||||
<if test="subjectStandard != null and subjectStandard != ''"> and subject_standard = #{subjectStandard}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectDvCheckSubjectByRecordId" parameterType="Long" resultMap="DvCheckSubjectResult">
|
||||
<include refid="selectDvCheckSubjectVo"/>
|
||||
where record_id = #{recordId}
|
||||
</select>
|
||||
|
||||
<select id="checkSubjectUnique" parameterType="DvCheckSubject" resultMap="DvCheckSubjectResult">
|
||||
<include refid="selectDvCheckSubjectVo"/>
|
||||
where plan_id = #{planId} and subject_id = #{subjectId} limit 1
|
||||
</select>
|
||||
|
||||
<insert id="insertDvCheckSubject" parameterType="DvCheckSubject" useGeneratedKeys="true" keyProperty="recordId">
|
||||
insert into dv_check_subject
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="planId != null">plan_id,</if>
|
||||
<if test="subjectId != null">subject_id,</if>
|
||||
<if test="subjectCode != null and subjectCode != ''">subject_code,</if>
|
||||
<if test="subjectName != null">subject_name,</if>
|
||||
<if test="subjectType != null">subject_type,</if>
|
||||
<if test="subjectContent != null and subjectContent != ''">subject_content,</if>
|
||||
<if test="subjectStandard != null">subject_standard,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="attr1 != null">attr1,</if>
|
||||
<if test="attr2 != null">attr2,</if>
|
||||
<if test="attr3 != null">attr3,</if>
|
||||
<if test="attr4 != null">attr4,</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="planId != null">#{planId},</if>
|
||||
<if test="subjectId != null">#{subjectId},</if>
|
||||
<if test="subjectCode != null and subjectCode != ''">#{subjectCode},</if>
|
||||
<if test="subjectName != null">#{subjectName},</if>
|
||||
<if test="subjectType != null">#{subjectType},</if>
|
||||
<if test="subjectContent != null and subjectContent != ''">#{subjectContent},</if>
|
||||
<if test="subjectStandard != null">#{subjectStandard},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="attr1 != null">#{attr1},</if>
|
||||
<if test="attr2 != null">#{attr2},</if>
|
||||
<if test="attr3 != null">#{attr3},</if>
|
||||
<if test="attr4 != null">#{attr4},</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="updateDvCheckSubject" parameterType="DvCheckSubject">
|
||||
update dv_check_subject
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="planId != null">plan_id = #{planId},</if>
|
||||
<if test="subjectId != null">subject_id = #{subjectId},</if>
|
||||
<if test="subjectCode != null and subjectCode != ''">subject_code = #{subjectCode},</if>
|
||||
<if test="subjectName != null">subject_name = #{subjectName},</if>
|
||||
<if test="subjectType != null">subject_type = #{subjectType},</if>
|
||||
<if test="subjectContent != null and subjectContent != ''">subject_content = #{subjectContent},</if>
|
||||
<if test="subjectStandard != null">subject_standard = #{subjectStandard},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="attr1 != null">attr1 = #{attr1},</if>
|
||||
<if test="attr2 != null">attr2 = #{attr2},</if>
|
||||
<if test="attr3 != null">attr3 = #{attr3},</if>
|
||||
<if test="attr4 != null">attr4 = #{attr4},</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 record_id = #{recordId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteDvCheckSubjectByRecordId" parameterType="Long">
|
||||
delete from dv_check_subject where record_id = #{recordId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteDvCheckSubjectByRecordIds" parameterType="String">
|
||||
delete from dv_check_subject where record_id in
|
||||
<foreach item="recordId" collection="array" open="(" separator="," close=")">
|
||||
#{recordId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
Loading…
Reference in New Issue
Block a user