增加新模块klp-mes制造执行下面的设备管理功能的后端实现

This commit is contained in:
2025-07-25 11:27:22 +08:00
parent 6847c99995
commit 4724f89820
107 changed files with 13244 additions and 5 deletions

View File

@@ -0,0 +1,138 @@
<?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.klp.mes.dv.mapper.DvCheckMachineryMapper">
<resultMap type="DvCheckMachinery" id="DvCheckMachineryResult">
<result property="recordId" column="record_id" />
<result property="planId" column="plan_id" />
<result property="machineryId" column="machinery_id" />
<result property="machineryCode" column="machinery_code" />
<result property="machineryName" column="machinery_name" />
<result property="machineryBrand" column="machinery_brand" />
<result property="machinerySpec" column="machinery_spec" />
<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="selectDvCheckMachineryVo">
select record_id, plan_id, machinery_id, machinery_code, machinery_name, machinery_brand, machinery_spec, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from dv_check_machinery
</sql>
<select id="selectDvCheckMachineryList" parameterType="DvCheckMachinery" resultMap="DvCheckMachineryResult">
<include refid="selectDvCheckMachineryVo"/>
<where>
<if test="planId != null "> and plan_id = #{planId}</if>
<if test="machineryId != null "> and machinery_id = #{machineryId}</if>
<if test="machineryCode != null and machineryCode != ''"> and machinery_code = #{machineryCode}</if>
<if test="machineryName != null and machineryName != ''"> and machinery_name like concat('%', #{machineryName}, '%')</if>
<if test="machineryBrand != null and machineryBrand != ''"> and machinery_brand = #{machineryBrand}</if>
<if test="machinerySpec != null and machinerySpec != ''"> and machinery_spec = #{machinerySpec}</if>
</where>
</select>
<select id="selectDvCheckMachineryByRecordId" parameterType="Long" resultMap="DvCheckMachineryResult">
<include refid="selectDvCheckMachineryVo"/>
where record_id = #{recordId}
</select>
<select id="checkMachineryUnique" parameterType="DvCheckMachinery" resultMap="DvCheckMachineryResult">
select record_id, cm.plan_id, machinery_id, machinery_code, machinery_name, machinery_brand, machinery_spec, cm.remark, cm.attr1, cm.attr2, cm.attr3, cm.attr4, cm.create_by, cm.create_time, cm.update_by, cm.update_time
from dv_check_machinery cm
left join dv_check_plan cp
on cm.plan_id = cp.plan_id
where cm.machinery_id = #{machineryId} and cp.plan_type = (
select plan_type
from dv_check_plan
where plan_id = #{planId}
) limit 1
</select>
<select id="getPlanId" resultType="java.lang.Long">
select plan_id from dv_check_machinery
where machinery_code = #{machineryCode}
</select>
<insert id="insertDvCheckMachinery" parameterType="DvCheckMachinery" useGeneratedKeys="true" keyProperty="recordId">
insert into dv_check_machinery
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="planId != null">plan_id,</if>
<if test="machineryId != null">machinery_id,</if>
<if test="machineryCode != null and machineryCode != ''">machinery_code,</if>
<if test="machineryName != null and machineryName != ''">machinery_name,</if>
<if test="machineryBrand != null">machinery_brand,</if>
<if test="machinerySpec != null">machinery_spec,</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="machineryId != null">#{machineryId},</if>
<if test="machineryCode != null and machineryCode != ''">#{machineryCode},</if>
<if test="machineryName != null and machineryName != ''">#{machineryName},</if>
<if test="machineryBrand != null">#{machineryBrand},</if>
<if test="machinerySpec != null">#{machinerySpec},</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="updateDvCheckMachinery" parameterType="DvCheckMachinery">
update dv_check_machinery
<trim prefix="SET" suffixOverrides=",">
<if test="planId != null">plan_id = #{planId},</if>
<if test="machineryId != null">machinery_id = #{machineryId},</if>
<if test="machineryCode != null and machineryCode != ''">machinery_code = #{machineryCode},</if>
<if test="machineryName != null and machineryName != ''">machinery_name = #{machineryName},</if>
<if test="machineryBrand != null">machinery_brand = #{machineryBrand},</if>
<if test="machinerySpec != null">machinery_spec = #{machinerySpec},</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="deleteDvCheckMachineryByRecordId" parameterType="Long">
delete from dv_check_machinery where record_id = #{recordId}
</delete>
<delete id="deleteDvCheckMachineryByRecordIds" parameterType="String">
delete from dv_check_machinery where record_id in
<foreach item="recordId" collection="array" open="(" separator="," close=")">
#{recordId}
</foreach>
</delete>
<delete id="deleteByPlanId" parameterType="Long">
delete from dv_check_machinery where plan_id = #{planId}
</delete>
</mapper>

View File

@@ -0,0 +1,150 @@
<?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.klp.mes.dv.mapper.DvCheckPlanMapper">
<resultMap type="DvCheckPlan" id="DvCheckPlanResult">
<result property="planId" column="plan_id" />
<result property="planCode" column="plan_code" />
<result property="planName" column="plan_name" />
<result property="planType" column="plan_type" />
<result property="startDate" column="start_date" />
<result property="endDate" column="end_date" />
<result property="cycleType" column="cycle_type" />
<result property="cycleCount" column="cycle_count" />
<result property="status" column="status" />
<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="selectDvCheckPlanVo">
select plan_id, plan_code, plan_name,plan_type, start_date, end_date, cycle_type, cycle_count,status, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from dv_check_plan
</sql>
<select id="selectDvCheckPlanList" parameterType="DvCheckPlan" resultMap="DvCheckPlanResult">
<include refid="selectDvCheckPlanVo"/>
<where>
<if test="planCode != null and planCode != ''"> and plan_code = #{planCode}</if>
<if test="planName != null and planName != ''"> and plan_name like concat('%', #{planName}, '%')</if>
<if test="planType != null and planType != ''"> and plan_type = #{planType}</if>
<if test="startDate != null "> and start_date = #{startDate}</if>
<if test="endDate != null "> and end_date = #{endDate}</if>
<if test="cycleType != null and cycleType != ''"> and cycle_type = #{cycleType}</if>
<if test="cycleCount != null "> and cycle_count = #{cycleCount}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
</where>
</select>
<select id="selectDvCheckPlanByPlanId" parameterType="Long" resultMap="DvCheckPlanResult">
<include refid="selectDvCheckPlanVo"/>
where plan_id = #{planId}
</select>
<select id="checkPlanCodeUnique" parameterType="DvCheckPlan" resultMap="DvCheckPlanResult">
<include refid="selectDvCheckPlanVo"/>
where plan_code = #{planCode}
</select>
<select id="getByIds" resultType="com.klp.mes.dv.domain.DvCheckPlan" resultMap="DvCheckPlanResult">
<include refid="selectDvCheckPlanVo"/>
where plan_type = #{planType}
and plan_id in
<foreach collection="planIds" item="item" separator="," open="(" close=")">
#{item}
</foreach>
</select>
<select id="selectDvCheckPlanByMachineryCodeAndType" resultMap="DvCheckPlanResult">
select pl.plan_id, pl.plan_code, pl.plan_name,pl.plan_type, pl.start_date, pl.end_date, pl.cycle_type, pl.cycle_count,pl.status, pl.remark, pl.create_time, pl.update_by, pl.update_time
from dv_check_plan pl
left join dv_check_machinery dv
on pl.plan_id = dv.plan_id
where plan_type = #{planType}
and dv.machinery_code = #{machineryCode}
limit 1
</select>
<insert id="insertDvCheckPlan" parameterType="DvCheckPlan" useGeneratedKeys="true" keyProperty="planId">
insert into dv_check_plan
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="planCode != null and planCode != ''">plan_code,</if>
<if test="planName != null">plan_name,</if>
<if test="planType != null and planType != ''">plan_type,</if>
<if test="startDate != null">start_date,</if>
<if test="endDate != null">end_date,</if>
<if test="cycleType != null">cycle_type,</if>
<if test="cycleCount != null">cycle_count,</if>
<if test="status != null and status !=''">status,</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="planCode != null and planCode != ''">#{planCode},</if>
<if test="planName != null">#{planName},</if>
<if test="planType != null and planType != ''">#{planType},</if>
<if test="startDate != null">#{startDate},</if>
<if test="endDate != null">#{endDate},</if>
<if test="cycleType != null">#{cycleType},</if>
<if test="cycleCount != null">#{cycleCount},</if>
<if test="status != null and status !=''">#{status},</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="updateDvCheckPlan" parameterType="DvCheckPlan">
update dv_check_plan
<trim prefix="SET" suffixOverrides=",">
<if test="planCode != null and planCode != ''">plan_code = #{planCode},</if>
<if test="planName != null">plan_name = #{planName},</if>
<if test="planType != null and planType != ''">plan_type = #{planType},</if>
<if test="startDate != null">start_date = #{startDate},</if>
<if test="endDate != null">end_date = #{endDate},</if>
<if test="cycleType != null">cycle_type = #{cycleType},</if>
<if test="cycleCount != null">cycle_count = #{cycleCount},</if>
<if test="status != null and status !=''">status = #{status},</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 plan_id = #{planId}
</update>
<delete id="deleteDvCheckPlanByPlanId" parameterType="Long">
delete from dv_check_plan where plan_id = #{planId}
</delete>
<delete id="deleteDvCheckPlanByPlanIds" parameterType="String">
delete from dv_check_plan where plan_id in
<foreach item="planId" collection="array" open="(" separator="," close=")">
#{planId}
</foreach>
</delete>
</mapper>

View File

@@ -0,0 +1,134 @@
<?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.klp.mes.dv.mapper.DvCheckRecordLineMapper">
<resultMap type="DvCheckRecordLine" id="DvCheckRecordLineResult">
<result property="lineId" column="line_id" />
<result property="recordId" column="record_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="checkStatus" column="check_status" />
<result property="checkResult" column="check_result" />
<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="selectDvCheckRecordLineVo">
select line_id, record_id, subject_id, subject_code, subject_name, subject_type, subject_content, subject_standard, check_status, check_result, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from dv_check_record_line
</sql>
<select id="selectDvCheckRecordLineList" parameterType="DvCheckRecordLine" resultMap="DvCheckRecordLineResult">
<include refid="selectDvCheckRecordLineVo"/>
<where>
<if test="recordId != null "> and record_id = #{recordId}</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>
<if test="checkStatus != null and checkStatus != ''"> and check_status = #{checkStatus}</if>
<if test="checkResult != null and checkResult != ''"> and check_result = #{checkResult}</if>
</where>
order by line_id desc
</select>
<select id="selectDvCheckRecordLineByLineId" parameterType="Long" resultMap="DvCheckRecordLineResult">
<include refid="selectDvCheckRecordLineVo"/>
where line_id = #{lineId}
</select>
<insert id="insertDvCheckRecordLine" parameterType="DvCheckRecordLine" useGeneratedKeys="true" keyProperty="lineId">
insert into dv_check_record_line
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="recordId != null">record_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="checkStatus != null and checkStatus != ''">check_status,</if>
<if test="checkResult != null">check_result,</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="recordId != null">#{recordId},</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="checkStatus != null and checkStatus != ''">#{checkStatus},</if>
<if test="checkResult != null">#{checkResult},</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="updateDvCheckRecordLine" parameterType="DvCheckRecordLine">
update dv_check_record_line
<trim prefix="SET" suffixOverrides=",">
<if test="recordId != null">record_id = #{recordId},</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="checkStatus != null and checkStatus != ''">check_status = #{checkStatus},</if>
<if test="checkResult != null">check_result = #{checkResult},</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 line_id = #{lineId}
</update>
<delete id="deleteDvCheckRecordLineByLineId" parameterType="Long">
delete from dv_check_record_line where line_id = #{lineId}
</delete>
<delete id="deleteDvCheckRecordLineByLineIds" parameterType="String">
delete from dv_check_record_line where line_id in
<foreach item="lineId" collection="array" open="(" separator="," close=")">
#{lineId}
</foreach>
</delete>
<delete id="deleteDvCheckRecordLineByRecordId" parameterType="Long">
delete from dv_check_record_line where record_id = #{recordId}
</delete>
</mapper>

View File

@@ -0,0 +1,158 @@
<?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.klp.mes.dv.mapper.DvCheckRecordMapper">
<resultMap type="DvCheckRecord" id="DvCheckRecordResult">
<result property="recordId" column="record_id" />
<result property="planId" column="plan_id" />
<result property="planCode" column="plan_code" />
<result property="planName" column="plan_name" />
<result property="planType" column="plan_type" />
<result property="machineryId" column="machinery_id" />
<result property="machineryCode" column="machinery_code" />
<result property="machineryName" column="machinery_name" />
<result property="machineryBrand" column="machinery_brand" />
<result property="machinerySpec" column="machinery_spec" />
<result property="checkTime" column="check_time" />
<result property="userId" column="user_id" />
<result property="userName" column="user_name" />
<result property="nickName" column="nick_name" />
<result property="status" column="status" />
<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="selectDvCheckRecordVo">
select record_id, plan_id, plan_code, plan_name, plan_type, machinery_id, machinery_code, machinery_name, machinery_brand, machinery_spec, check_time, user_id, user_name, nick_name, status, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from dv_check_record
</sql>
<select id="selectDvCheckRecordList" parameterType="DvCheckRecord" resultMap="DvCheckRecordResult">
<include refid="selectDvCheckRecordVo"/>
<where>
<if test="planId != null "> and plan_id = #{planId}</if>
<if test="planCode != null and planCode != ''"> and plan_code = #{planCode}</if>
<if test="planName != null and planName != ''"> and plan_name like concat('%', #{planName}, '%')</if>
<if test="planType != null and planType != ''"> and plan_type = #{planType}</if>
<if test="machineryId != null "> and machinery_id = #{machineryId}</if>
<if test="machineryCode != null and machineryCode != ''"> and machinery_code = #{machineryCode}</if>
<if test="machineryName != null and machineryName != ''"> and machinery_name like concat('%', #{machineryName}, '%')</if>
<if test="machineryBrand != null and machineryBrand != ''"> and machinery_brand = #{machineryBrand}</if>
<if test="machinerySpec != null and machinerySpec != ''"> and machinery_spec = #{machinerySpec}</if>
<if test="checkTime != null "> and check_time = #{checkTime}</if>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
<if test="nickName != null and nickName != ''"> and nick_name like concat('%', #{nickName}, '%')</if>
<if test="status != null and status != ''"> and status = #{status}</if>
</where>
order by create_time desc
</select>
<select id="selectDvCheckRecordByRecordId" parameterType="Long" resultMap="DvCheckRecordResult">
<include refid="selectDvCheckRecordVo"/>
where record_id = #{recordId}
</select>
<insert id="insertDvCheckRecord" parameterType="DvCheckRecord" useGeneratedKeys="true" keyProperty="recordId">
insert into dv_check_record
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="planId != null">plan_id,</if>
<if test="planCode != null">plan_code,</if>
<if test="planName != null">plan_name,</if>
<if test="planType != null">plan_type,</if>
<if test="machineryId != null">machinery_id,</if>
<if test="machineryCode != null and machineryCode != ''">machinery_code,</if>
<if test="machineryName != null and machineryName != ''">machinery_name,</if>
<if test="machineryBrand != null">machinery_brand,</if>
<if test="machinerySpec != null">machinery_spec,</if>
<if test="checkTime != null">check_time,</if>
<if test="userId != null">user_id,</if>
<if test="userName != null and userName != ''">user_name,</if>
<if test="nickName != null and nickName != ''">nick_name,</if>
<if test="status != null">status,</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="planCode != null">#{planCode},</if>
<if test="planName != null">#{planName},</if>
<if test="planType != null">#{planType},</if>
<if test="machineryId != null">#{machineryId},</if>
<if test="machineryCode != null and machineryCode != ''">#{machineryCode},</if>
<if test="machineryName != null and machineryName != ''">#{machineryName},</if>
<if test="machineryBrand != null">#{machineryBrand},</if>
<if test="machinerySpec != null">#{machinerySpec},</if>
<if test="checkTime != null">#{checkTime},</if>
<if test="userId != null">#{userId},</if>
<if test="userName != null and userName != ''">#{userName},</if>
<if test="nickName != null and nickName != ''">#{nickName},</if>
<if test="status != null">#{status},</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="updateDvCheckRecord" parameterType="DvCheckRecord">
update dv_check_record
<trim prefix="SET" suffixOverrides=",">
<if test="planId != null">plan_id = #{planId},</if>
<if test="planCode != null">plan_code = #{planCode},</if>
<if test="planName != null">plan_name = #{planName},</if>
<if test="planType != null">plan_type = #{planType},</if>
<if test="machineryId != null">machinery_id = #{machineryId},</if>
<if test="machineryCode != null and machineryCode != ''">machinery_code = #{machineryCode},</if>
<if test="machineryName != null and machineryName != ''">machinery_name = #{machineryName},</if>
<if test="machineryBrand != null">machinery_brand = #{machineryBrand},</if>
<if test="machinerySpec != null">machinery_spec = #{machinerySpec},</if>
<if test="checkTime != null">check_time = #{checkTime},</if>
<if test="userId != null">user_id = #{userId},</if>
<if test="userName != null and userName != ''">user_name = #{userName},</if>
<if test="nickName != null and nickName != ''">nick_name = #{nickName},</if>
<if test="status != null">status = #{status},</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="deleteDvCheckRecordByRecordId" parameterType="Long">
delete from dv_check_record where record_id = #{recordId}
</delete>
<delete id="deleteDvCheckRecordByRecordIds" parameterType="String">
delete from dv_check_record where record_id in
<foreach item="recordId" collection="array" open="(" separator="," close=")">
#{recordId}
</foreach>
</delete>
</mapper>

View File

@@ -0,0 +1,132 @@
<?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.klp.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>
<delete id="deleteByPlanId" parameterType="Long">
delete from dv_check_subject where plan_id = #{planId}
</delete>
</mapper>

View File

@@ -0,0 +1,158 @@
<?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.klp.mes.dv.mapper.DvMachineryMapper">
<resultMap type="DvMachinery" id="DvMachineryResult">
<result property="machineryId" column="machinery_id" />
<result property="machineryCode" column="machinery_code" />
<result property="machineryName" column="machinery_name" />
<result property="machineryBrand" column="machinery_brand" />
<result property="machinerySpec" column="machinery_spec" />
<result property="machineryTypeId" column="machinery_type_id" />
<result property="machineryTypeCode" column="machinery_type_code" />
<result property="machineryTypeName" column="machinery_type_name" />
<result property="workshopId" column="workshop_id" />
<result property="workshopCode" column="workshop_code" />
<result property="workshopName" column="workshop_name" />
<result property="lastMaintenTime" column="last_mainten_time" />
<result property="lastCheckTime" column="last_check_time" />
<result property="status" column="status" />
<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="selectDvMachineryVo">
select machinery_id, machinery_code, machinery_name, machinery_brand, machinery_spec, machinery_type_id, machinery_type_code, machinery_type_name, workshop_id, workshop_code, workshop_name, last_mainten_time, last_check_time, status, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from dv_machinery
</sql>
<select id="selectDvMachineryList" parameterType="DvMachinery" resultMap="DvMachineryResult">
<include refid="selectDvMachineryVo"/>
<where>
<if test="machineryCode != null and machineryCode != ''"> and machinery_code = #{machineryCode}</if>
<if test="machineryName != null and machineryName != ''"> and machinery_name like concat('%', #{machineryName}, '%')</if>
<if test="machineryBrand != null and machineryBrand != ''"> and machinery_brand = #{machineryBrand}</if>
<if test="machinerySpec != null and machinerySpec != ''"> and machinery_spec = #{machinerySpec}</if>
<if test="machineryTypeId != null ">
AND (machinery_type_id = #{machineryTypeId} OR machinery_type_id in (select machinery_type_id from dv_machinery_type where find_in_set(#{machineryTypeId},ancestors)))
</if>
<if test="machineryTypeCode != null and machineryTypeCode != ''"> and machinery_type_code = #{machineryTypeCode}</if>
<if test="machineryTypeName != null and machineryTypeName != ''"> and machinery_type_name like concat('%', #{machineryTypeName}, '%')</if>
<if test="workshopId != null "> and workshop_id = #{workshopId}</if>
<if test="workshopCode != null and workshopCode != ''"> and workshop_code = #{workshopCode}</if>
<if test="workshopName != null and workshopName != ''"> and workshop_name like concat('%', #{workshopName}, '%')</if>
<if test="status != null and status != ''"> and status = #{status}</if>
</where>
</select>
<select id="selectDvMachineryByMachineryId" parameterType="Long" resultMap="DvMachineryResult">
<include refid="selectDvMachineryVo"/>
where machinery_id = #{machineryId}
</select>
<select id="selectByMachineryCode" parameterType="string" resultMap="DvMachineryResult">
<include refid="selectDvMachineryVo"/>
where machinery_code= #{machineryCode}
</select>
<select id="checkRecptCodeUnique" resultType="com.klp.mes.dv.domain.DvMachinery" resultMap="DvMachineryResult">
<include refid="selectDvMachineryVo"/>
where machinery_code = #{machineryCode}
limit 1
</select>
<insert id="insertDvMachinery" parameterType="DvMachinery" useGeneratedKeys="true" keyProperty="machineryId">
insert into dv_machinery
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="machineryCode != null and machineryCode != ''">machinery_code,</if>
<if test="machineryName != null and machineryName != ''">machinery_name,</if>
<if test="machineryBrand != null">machinery_brand,</if>
<if test="machinerySpec != null">machinery_spec,</if>
<if test="machineryTypeId != null">machinery_type_id,</if>
<if test="machineryTypeCode != null">machinery_type_code,</if>
<if test="machineryTypeName != null">machinery_type_name,</if>
<if test="workshopId != null">workshop_id,</if>
<if test="workshopCode != null">workshop_code,</if>
<if test="workshopName != null">workshop_name,</if>
<if test="status != null and status != ''">status,</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="machineryCode != null and machineryCode != ''">#{machineryCode},</if>
<if test="machineryName != null and machineryName != ''">#{machineryName},</if>
<if test="machineryBrand != null">#{machineryBrand},</if>
<if test="machinerySpec != null">#{machinerySpec},</if>
<if test="machineryTypeId != null">#{machineryTypeId},</if>
<if test="machineryTypeCode != null">#{machineryTypeCode},</if>
<if test="machineryTypeName != null">#{machineryTypeName},</if>
<if test="workshopId != null">#{workshopId},</if>
<if test="workshopCode != null">#{workshopCode},</if>
<if test="workshopName != null">#{workshopName},</if>
<if test="status != null and status != ''">#{status},</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="updateDvMachinery" parameterType="DvMachinery">
update dv_machinery
<trim prefix="SET" suffixOverrides=",">
<if test="machineryCode != null and machineryCode != ''">machinery_code = #{machineryCode},</if>
<if test="machineryName != null and machineryName != ''">machinery_name = #{machineryName},</if>
<if test="machineryBrand != null">machinery_brand = #{machineryBrand},</if>
<if test="machinerySpec != null">machinery_spec = #{machinerySpec},</if>
<if test="machineryTypeId != null">machinery_type_id = #{machineryTypeId},</if>
<if test="machineryTypeCode != null">machinery_type_code = #{machineryTypeCode},</if>
<if test="machineryTypeName != null">machinery_type_name = #{machineryTypeName},</if>
<if test="workshopId != null">workshop_id = #{workshopId},</if>
<if test="workshopCode != null">workshop_code = #{workshopCode},</if>
<if test="workshopName != null">workshop_name = #{workshopName},</if>
<if test="lastMaintenTime != null">last_mainten_time = #{lastMaintenTime},</if>
<if test="lastCheckTime != null">last_check_time = #{lastCheckTime},</if>
<if test="status != null and status != ''">status = #{status},</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 machinery_id = #{machineryId}
</update>
<delete id="deleteDvMachineryByMachineryId" parameterType="Long">
delete from dv_machinery where machinery_id = #{machineryId}
</delete>
<delete id="deleteDvMachineryByMachineryIds" parameterType="String">
delete from dv_machinery where machinery_id in
<foreach item="machineryId" collection="array" open="(" separator="," close=")">
#{machineryId}
</foreach>
</delete>
</mapper>

View File

@@ -0,0 +1,112 @@
<?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.klp.mes.dv.mapper.DvMachineryTypeMapper">
<resultMap type="DvMachineryType" id="DvMachineryTypeResult">
<result property="machineryTypeId" column="machinery_type_id" />
<result property="machineryTypeCode" column="machinery_type_code" />
<result property="machineryTypeName" column="machinery_type_name" />
<result property="parentTypeId" column="parent_type_id" />
<result property="ancestors" column="ancestors" />
<result property="enableFlag" column="enable_flag" />
<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="selectDvMachineryTypeVo">
select machinery_type_id, machinery_type_code, machinery_type_name, parent_type_id, ancestors, enable_flag, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from dv_machinery_type
</sql>
<select id="selectDvMachineryTypeList" parameterType="DvMachineryType" resultMap="DvMachineryTypeResult">
<include refid="selectDvMachineryTypeVo"/>
<where>
<if test="machineryTypeCode != null and machineryTypeCode != ''"> and machinery_type_code = #{machineryTypeCode}</if>
<if test="machineryTypeName != null and machineryTypeName != ''"> and machinery_type_name like concat('%', #{machineryTypeName}, '%')</if>
<if test="parentTypeId != null "> and parent_type_id = #{parentTypeId}</if>
<if test="ancestors != null and ancestors != ''"> and ancestors = #{ancestors}</if>
<if test="enableFlag != null and enableFlag != ''"> and enable_flag = #{enableFlag}</if>
</where>
</select>
<select id="selectDvMachineryTypeByMachineryTypeId" parameterType="Long" resultMap="DvMachineryTypeResult">
<include refid="selectDvMachineryTypeVo"/>
where machinery_type_id = #{machineryTypeId}
</select>
<insert id="insertDvMachineryType" parameterType="DvMachineryType" useGeneratedKeys="true" keyProperty="machineryTypeId">
insert into dv_machinery_type
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="machineryTypeCode != null and machineryTypeCode != ''">machinery_type_code,</if>
<if test="machineryTypeName != null and machineryTypeName != ''">machinery_type_name,</if>
<if test="parentTypeId != null">parent_type_id,</if>
<if test="ancestors != null and ancestors != ''">ancestors,</if>
<if test="enableFlag != null and enableFlag != ''">enable_flag,</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="machineryTypeCode != null and machineryTypeCode != ''">#{machineryTypeCode},</if>
<if test="machineryTypeName != null and machineryTypeName != ''">#{machineryTypeName},</if>
<if test="parentTypeId != null">#{parentTypeId},</if>
<if test="ancestors != null and ancestors != ''">#{ancestors},</if>
<if test="enableFlag != null and enableFlag != ''">#{enableFlag},</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="updateDvMachineryType" parameterType="DvMachineryType">
update dv_machinery_type
<trim prefix="SET" suffixOverrides=",">
<if test="machineryTypeCode != null and machineryTypeCode != ''">machinery_type_code = #{machineryTypeCode},</if>
<if test="machineryTypeName != null and machineryTypeName != ''">machinery_type_name = #{machineryTypeName},</if>
<if test="parentTypeId != null">parent_type_id = #{parentTypeId},</if>
<if test="ancestors != null and ancestors != ''">ancestors = #{ancestors},</if>
<if test="enableFlag != null and enableFlag != ''">enable_flag = #{enableFlag},</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 machinery_type_id = #{machineryTypeId}
</update>
<delete id="deleteDvMachineryTypeByMachineryTypeId" parameterType="Long">
delete from dv_machinery_type where machinery_type_id = #{machineryTypeId}
</delete>
<delete id="deleteDvMachineryTypeByMachineryTypeIds" parameterType="String">
delete from dv_machinery_type where machinery_type_id in
<foreach item="machineryTypeId" collection="array" open="(" separator="," close=")">
#{machineryTypeId}
</foreach>
</delete>
</mapper>

View File

@@ -0,0 +1,128 @@
<?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.klp.mes.dv.mapper.DvMaintenRecordLineMapper">
<resultMap type="DvMaintenRecordLine" id="DvMaintenRecordLineResult">
<result property="lineId" column="line_id" />
<result property="recordId" column="record_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="maintenStatus" column="mainten_status" />
<result property="maintenResult" column="mainten_result" />
<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="selectDvMaintenRecordLineVo">
select line_id, record_id, subject_id, subject_code, subject_name, subject_type, subject_content, subject_standard, mainten_status, mainten_result, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from dv_mainten_record_line
</sql>
<select id="selectDvMaintenRecordLineList" parameterType="DvMaintenRecordLine" resultMap="DvMaintenRecordLineResult">
<include refid="selectDvMaintenRecordLineVo"/>
<where>
<if test="recordId != null "> and record_id = #{recordId}</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>
<if test="maintenStatus != null and maintenStatus != ''"> and mainten_status = #{maintenStatus}</if>
<if test="maintenResult != null and maintenResult != ''"> and mainten_result = #{maintenResult}</if>
</where>
</select>
<select id="selectDvMaintenRecordLineByLineId" parameterType="Long" resultMap="DvMaintenRecordLineResult">
<include refid="selectDvMaintenRecordLineVo"/>
where line_id = #{lineId}
</select>
<insert id="insertDvMaintenRecordLine" parameterType="DvMaintenRecordLine" useGeneratedKeys="true" keyProperty="lineId">
insert into dv_mainten_record_line
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="recordId != null">record_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="maintenStatus != null and maintenStatus != ''">mainten_status,</if>
<if test="maintenResult != null">mainten_result,</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="recordId != null">#{recordId},</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="maintenStatus != null and maintenStatus != ''">#{maintenStatus},</if>
<if test="maintenResult != null">#{maintenResult},</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="updateDvMaintenRecordLine" parameterType="DvMaintenRecordLine">
update dv_mainten_record_line
<trim prefix="SET" suffixOverrides=",">
<if test="recordId != null">record_id = #{recordId},</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="maintenStatus != null and maintenStatus != ''">mainten_status = #{maintenStatus},</if>
<if test="maintenResult != null">mainten_result = #{maintenResult},</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 line_id = #{lineId}
</update>
<delete id="deleteDvMaintenRecordLineByLineId" parameterType="Long">
delete from dv_mainten_record_line where line_id = #{lineId}
</delete>
<delete id="deleteDvMaintenRecordLineByLineIds" parameterType="String">
delete from dv_mainten_record_line where line_id in
<foreach item="lineId" collection="array" open="(" separator="," close=")">
#{lineId}
</foreach>
</delete>
</mapper>

View File

@@ -0,0 +1,157 @@
<?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.klp.mes.dv.mapper.DvMaintenRecordMapper">
<resultMap type="DvMaintenRecord" id="DvMaintenRecordResult">
<result property="recordId" column="record_id" />
<result property="planId" column="plan_id" />
<result property="planCode" column="plan_code" />
<result property="planName" column="plan_name" />
<result property="planType" column="plan_type" />
<result property="machineryId" column="machinery_id" />
<result property="machineryCode" column="machinery_code" />
<result property="machineryName" column="machinery_name" />
<result property="machineryBrand" column="machinery_brand" />
<result property="machinerySpec" column="machinery_spec" />
<result property="maintenTime" column="mainten_time" />
<result property="userId" column="user_id" />
<result property="userName" column="user_name" />
<result property="nickName" column="nick_name" />
<result property="status" column="status" />
<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="selectDvMaintenRecordVo">
select record_id, plan_id, plan_code, plan_name, plan_type, machinery_id, machinery_code, machinery_name, machinery_brand, machinery_spec, mainten_time, user_id, user_name, nick_name, status, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from dv_mainten_record
</sql>
<select id="selectDvMaintenRecordList" parameterType="DvMaintenRecord" resultMap="DvMaintenRecordResult">
<include refid="selectDvMaintenRecordVo"/>
<where>
<if test="planId != null "> and plan_id = #{planId}</if>
<if test="planCode != null and planCode != ''"> and plan_code = #{planCode}</if>
<if test="planName != null and planName != ''"> and plan_name like concat('%', #{planName}, '%')</if>
<if test="planType != null and planType != ''"> and plan_type = #{planType}</if>
<if test="machineryId != null "> and machinery_id = #{machineryId}</if>
<if test="machineryCode != null and machineryCode != ''"> and machinery_code = #{machineryCode}</if>
<if test="machineryName != null and machineryName != ''"> and machinery_name like concat('%', #{machineryName}, '%')</if>
<if test="machineryBrand != null and machineryBrand != ''"> and machinery_brand = #{machineryBrand}</if>
<if test="machinerySpec != null and machinerySpec != ''"> and machinery_spec = #{machinerySpec}</if>
<if test="maintenTime != null "> and mainten_time = #{maintenTime}</if>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
<if test="nickName != null and nickName != ''"> and nick_name like concat('%', #{nickName}, '%')</if>
<if test="status != null and status != ''"> and status = #{status}</if>
</where>
</select>
<select id="selectDvMaintenRecordByRecordId" parameterType="Long" resultMap="DvMaintenRecordResult">
<include refid="selectDvMaintenRecordVo"/>
where record_id = #{recordId}
</select>
<insert id="insertDvMaintenRecord" parameterType="DvMaintenRecord" useGeneratedKeys="true" keyProperty="recordId">
insert into dv_mainten_record
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="planId != null">plan_id,</if>
<if test="planCode != null">plan_code,</if>
<if test="planName != null">plan_name,</if>
<if test="planType != null">plan_type,</if>
<if test="machineryId != null">machinery_id,</if>
<if test="machineryCode != null and machineryCode != ''">machinery_code,</if>
<if test="machineryName != null and machineryName != ''">machinery_name,</if>
<if test="machineryBrand != null">machinery_brand,</if>
<if test="machinerySpec != null">machinery_spec,</if>
<if test="maintenTime != null">mainten_time,</if>
<if test="userId != null">user_id,</if>
<if test="userName != null">user_name,</if>
<if test="nickName != null">nick_name,</if>
<if test="status != null">status,</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="planCode != null">#{planCode},</if>
<if test="planName != null">#{planName},</if>
<if test="planType != null">#{planType},</if>
<if test="machineryId != null">#{machineryId},</if>
<if test="machineryCode != null and machineryCode != ''">#{machineryCode},</if>
<if test="machineryName != null and machineryName != ''">#{machineryName},</if>
<if test="machineryBrand != null">#{machineryBrand},</if>
<if test="machinerySpec != null">#{machinerySpec},</if>
<if test="maintenTime != null">#{maintenTime},</if>
<if test="userId != null">#{userId},</if>
<if test="userName != null">#{userName},</if>
<if test="nickName != null">#{nickName},</if>
<if test="status != null">#{status},</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="updateDvMaintenRecord" parameterType="DvMaintenRecord">
update dv_mainten_record
<trim prefix="SET" suffixOverrides=",">
<if test="planId != null">plan_id = #{planId},</if>
<if test="planCode != null">plan_code = #{planCode},</if>
<if test="planName != null">plan_name = #{planName},</if>
<if test="planType != null">plan_type = #{planType},</if>
<if test="machineryId != null">machinery_id = #{machineryId},</if>
<if test="machineryCode != null and machineryCode != ''">machinery_code = #{machineryCode},</if>
<if test="machineryName != null and machineryName != ''">machinery_name = #{machineryName},</if>
<if test="machineryBrand != null">machinery_brand = #{machineryBrand},</if>
<if test="machinerySpec != null">machinery_spec = #{machinerySpec},</if>
<if test="maintenTime != null">mainten_time = #{maintenTime},</if>
<if test="userId != null">user_id = #{userId},</if>
<if test="userName != null">user_name = #{userName},</if>
<if test="nickName != null">nick_name = #{nickName},</if>
<if test="status != null">status = #{status},</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="deleteDvMaintenRecordByRecordId" parameterType="Long">
delete from dv_mainten_record where record_id = #{recordId}
</delete>
<delete id="deleteDvMaintenRecordByRecordIds" parameterType="String">
delete from dv_mainten_record where record_id in
<foreach item="recordId" collection="array" open="(" separator="," close=")">
#{recordId}
</foreach>
</delete>
</mapper>

View File

@@ -0,0 +1,141 @@
<?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.klp.mes.dv.mapper.DvRepairLineMapper">
<resultMap type="DvRepairLine" id="DvRepairLineResult">
<result property="lineId" column="line_id" />
<result property="repairId" column="repair_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="malfunction" column="malfunction" />
<result property="malfunctionUrl" column="malfunction_url" />
<result property="repairDes" column="repair_des" />
<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="selectDvRepairLineVo">
select line_id, repair_id, subject_id, subject_code, subject_name, subject_type, subject_content, subject_standard, malfunction, malfunction_url, repair_des, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from dv_repair_line
</sql>
<select id="selectDvRepairLineList" parameterType="DvRepairLine" resultMap="DvRepairLineResult">
<include refid="selectDvRepairLineVo"/>
<where>
<if test="repairId != null "> and repair_id = #{repairId}</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>
<if test="malfunction != null and malfunction != ''"> and malfunction = #{malfunction}</if>
<if test="malfunctionUrl != null and malfunctionUrl != ''"> and malfunction_url = #{malfunctionUrl}</if>
<if test="repairDes != null and repairDes != ''"> and repair_des = #{repairDes}</if>
</where>
</select>
<select id="selectDvRepairLineByLineId" parameterType="Long" resultMap="DvRepairLineResult">
<include refid="selectDvRepairLineVo"/>
where line_id = #{lineId}
</select>
<insert id="insertDvRepairLine" parameterType="DvRepairLine" useGeneratedKeys="true" keyProperty="lineId">
insert into dv_repair_line
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="repairId != null">repair_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="malfunction != null">malfunction,</if>
<if test="malfunctionUrl != null">malfunction_url,</if>
<if test="repairDes != null">repair_des,</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="repairId != null">#{repairId},</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="malfunction != null">#{malfunction},</if>
<if test="malfunctionUrl != null">#{malfunctionUrl},</if>
<if test="repairDes != null">#{repairDes},</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="updateDvRepairLine" parameterType="DvRepairLine">
update dv_repair_line
<trim prefix="SET" suffixOverrides=",">
<if test="repairId != null">repair_id = #{repairId},</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="malfunction != null">malfunction = #{malfunction},</if>
<if test="malfunctionUrl != null">malfunction_url = #{malfunctionUrl},</if>
<if test="repairDes != null">repair_des = #{repairDes},</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 line_id = #{lineId}
</update>
<delete id="deleteDvRepairLineByLineId" parameterType="Long">
delete from dv_repair_line where line_id = #{lineId}
</delete>
<delete id="deleteDvRepairLineByLineIds" parameterType="String">
delete from dv_repair_line where line_id in
<foreach item="lineId" collection="array" open="(" separator="," close=")">
#{lineId}
</foreach>
</delete>
<delete id="deleteByRepairId" parameterType="Long">
delete from dv_repair_line where repair_id = #{repairId}
</delete>
</mapper>

View File

@@ -0,0 +1,206 @@
<?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.klp.mes.dv.mapper.DvRepairMapper">
<resultMap type="DvRepair" id="DvRepairResult">
<result property="repairId" column="repair_id" />
<result property="repairCode" column="repair_code" />
<result property="repairName" column="repair_name" />
<result property="machineryId" column="machinery_id" />
<result property="machineryCode" column="machinery_code" />
<result property="machineryName" column="machinery_name" />
<result property="machineryBrand" column="machinery_brand" />
<result property="machinerySpec" column="machinery_spec" />
<result property="machineryTypeId" column="machinery_type_id" />
<result property="requireDate" column="require_date" />
<result property="finishDate" column="finish_date" />
<result property="confirmDate" column="confirm_date" />
<result property="repairResult" column="repair_result" />
<result property="acceptedId" column="accepted_id" />
<result property="acceptedName" column="accepted_name" />
<result property="acceptedBy" column="accepted_by" />
<result property="confirmId" column="confirm_id" />
<result property="confirmName" column="confirm_name" />
<result property="confirmBy" column="confirm_by" />
<result property="sourceDocType" column="source_doc_type" />
<result property="sourceDocId" column="source_doc_id" />
<result property="sourceDocCode" column="source_doc_code" />
<result property="status" column="status" />
<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="selectDvRepairVo">
select repair_id, repair_code, repair_name, machinery_id, machinery_code, machinery_name, machinery_brand, machinery_spec, machinery_type_id, require_date, finish_date, confirm_date, repair_result, accepted_id, accepted_name, accepted_by, confirm_id, confirm_name, confirm_by, source_doc_type, source_doc_id, source_doc_code, status, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from dv_repair
</sql>
<select id="selectDvRepairList" parameterType="DvRepair" resultMap="DvRepairResult">
<include refid="selectDvRepairVo"/>
<where>
<if test="repairCode != null and repairCode != ''"> and repair_code = #{repairCode}</if>
<if test="repairName != null and repairName != ''"> and repair_name like concat('%', #{repairName}, '%')</if>
<if test="machineryId != null "> and machinery_id = #{machineryId}</if>
<if test="machineryCode != null and machineryCode != ''"> and machinery_code = #{machineryCode}</if>
<if test="machineryName != null and machineryName != ''"> and machinery_name like concat('%', #{machineryName}, '%')</if>
<if test="machineryBrand != null and machineryBrand != ''"> and machinery_brand = #{machineryBrand}</if>
<if test="machinerySpec != null and machinerySpec != ''"> and machinery_spec = #{machinerySpec}</if>
<if test="machineryTypeId != null "> and machinery_type_id = #{machineryTypeId}</if>
<if test="requireDate != null "> and require_date = #{requireDate}</if>
<if test="finishDate != null "> and finish_date = #{finishDate}</if>
<if test="confirmDate != null "> and confirm_date = #{confirmDate}</if>
<if test="repairResult != null and repairResult != ''"> and repair_result = #{repairResult}</if>
<if test="acceptedId != null "> and accepted_id = #{acceptedId}</if>
<if test="acceptedName != null and acceptedName != ''"> and accepted_name = #{acceptedName}</if>
<if test="acceptedBy != null and acceptedBy != ''"> and accepted_by = #{acceptedBy}</if>
<if test="confirmId != null "> and confirm_id = #{confirmId}</if>
<if test="confirmName != null and confirmName != ''"> and confirm_name = #{confirmName}</if>
<if test="confirmBy != null and confirmBy != ''"> and confirm_by = #{confirmBy}</if>
<if test="sourceDocType != null and sourceDocType != ''"> and source_doc_type = #{sourceDocType}</if>
<if test="sourceDocId != null "> and source_doc_id = #{sourceDocId}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
</where>
order by create_time desc
</select>
<select id="selectDvRepairByRepairId" parameterType="Long" resultMap="DvRepairResult">
<include refid="selectDvRepairVo"/>
where repair_id = #{repairId}
</select>
<select id="checkCodeUnique" parameterType="DvRepair" resultMap="DvRepairResult">
<include refid="selectDvRepairVo"/>
where repair_code = #{repairCode} limit 1
</select>
<select id="getRepairList" resultType="com.klp.mes.dv.domain.DvRepair" resultMap="DvRepairResult">
<include refid="selectDvRepairVo"/>
where machinery_code = #{machineryCode}
</select>
<insert id="insertDvRepair" parameterType="DvRepair" useGeneratedKeys="true" keyProperty="repairId">
insert into dv_repair
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="repairCode != null and repairCode != ''">repair_code,</if>
<if test="repairName != null">repair_name,</if>
<if test="machineryId != null">machinery_id,</if>
<if test="machineryCode != null and machineryCode != ''">machinery_code,</if>
<if test="machineryName != null and machineryName != ''">machinery_name,</if>
<if test="machineryBrand != null">machinery_brand,</if>
<if test="machinerySpec != null">machinery_spec,</if>
<if test="machineryTypeId != null">machinery_type_id,</if>
<if test="requireDate != null">require_date,</if>
<if test="finishDate != null">finish_date,</if>
<if test="confirmDate != null">confirm_date,</if>
<if test="repairResult != null">repair_result,</if>
<if test="acceptedId != null">accepted_id,</if>
<if test="acceptedName != null">accepted_name,</if>
<if test="acceptedBy != null">accepted_by,</if>
<if test="confirmId != null">confirm_id,</if>
<if test="confirmName != null">confirm_name,</if>
<if test="confirmBy != null">confirm_by,</if>
<if test="sourceDocType != null and sourceDocType != ''">source_doc_type,</if>
<if test="sourceDocId != null">source_doc_id,</if>
<if test="sourceDocCode != null and sourceDocCode != ''">source_doc_code,</if>
<if test="status != null">status,</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="repairCode != null and repairCode != ''">#{repairCode},</if>
<if test="repairName != null">#{repairName},</if>
<if test="machineryId != null">#{machineryId},</if>
<if test="machineryCode != null and machineryCode != ''">#{machineryCode},</if>
<if test="machineryName != null and machineryName != ''">#{machineryName},</if>
<if test="machineryBrand != null">#{machineryBrand},</if>
<if test="machinerySpec != null">#{machinerySpec},</if>
<if test="machineryTypeId != null">#{machineryTypeId},</if>
<if test="requireDate != null">#{requireDate},</if>
<if test="finishDate != null">#{finishDate},</if>
<if test="confirmDate != null">#{confirmDate},</if>
<if test="repairResult != null">#{repairResult},</if>
<if test="acceptedId != null">#{acceptedId},</if>
<if test="acceptedName != null">#{acceptedName},</if>
<if test="acceptedBy != null">#{acceptedBy},</if>
<if test="confirmId != null">#{confirmId},</if>
<if test="confirmName != null">#{confirmName},</if>
<if test="confirmBy != null">#{confirmBy},</if>
<if test="sourceDocType != null and sourceDocType != ''">#{sourceDocType},</if>
<if test="sourceDocId != null">#{sourceDocId},</if>
<if test="sourceDocCode != null and sourceDocCode != ''">#{sourceDocCode},</if>
<if test="status != null">#{status},</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="updateDvRepair" parameterType="DvRepair">
update dv_repair
<trim prefix="SET" suffixOverrides=",">
<if test="repairCode != null and repairCode != ''">repair_code = #{repairCode},</if>
<if test="repairName != null">repair_name = #{repairName},</if>
<if test="machineryId != null">machinery_id = #{machineryId},</if>
<if test="machineryCode != null and machineryCode != ''">machinery_code = #{machineryCode},</if>
<if test="machineryName != null and machineryName != ''">machinery_name = #{machineryName},</if>
<if test="machineryBrand != null">machinery_brand = #{machineryBrand},</if>
<if test="machinerySpec != null">machinery_spec = #{machinerySpec},</if>
<if test="machineryTypeId != null">machinery_type_id = #{machineryTypeId},</if>
<if test="requireDate != null">require_date = #{requireDate},</if>
<if test="finishDate != null">finish_date = #{finishDate},</if>
<if test="confirmDate != null">confirm_date = #{confirmDate},</if>
<if test="repairResult != null">repair_result = #{repairResult},</if>
<if test="acceptedId != null">accepted_id = #{acceptedId},</if>
<if test="acceptedName != null">accepted_name = #{acceptedName},</if>
<if test="acceptedBy != null">accepted_by = #{acceptedBy},</if>
<if test="confirmId != null">confirm_id = #{confirmId},</if>
<if test="confirmName != null">confirm_name = #{confirmName},</if>
<if test="confirmBy != null">confirm_by = #{confirmBy},</if>
<if test="sourceDocType != null and sourceDocType != ''">source_doc_type = #{sourceDocType},</if>
<if test="sourceDocId != null">source_doc_id = #{sourceDocId},</if>
<if test="sourceDocCode != null and sourceDocCode != ''">source_doc_code = #{sourceDocCode},</if>
<if test="status != null">status = #{status},</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 repair_id = #{repairId}
</update>
<delete id="deleteDvRepairByRepairId" parameterType="Long">
delete from dv_repair where repair_id = #{repairId}
</delete>
<delete id="deleteDvRepairByRepairIds" parameterType="String">
delete from dv_repair where repair_id in
<foreach item="repairId" collection="array" open="(" separator="," close=")">
#{repairId}
</foreach>
</delete>
</mapper>

View File

@@ -0,0 +1,122 @@
<?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.klp.mes.dv.mapper.DvSubjectMapper">
<resultMap type="DvSubject" id="DvSubjectResult">
<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="enableFlag" column="enable_flag" />
<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="selectDvSubjectVo">
select subject_id, subject_code, subject_name, subject_type, subject_content, subject_standard, enable_flag, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from dv_subject
</sql>
<select id="selectDvSubjectList" parameterType="DvSubject" resultMap="DvSubjectResult">
<include refid="selectDvSubjectVo"/>
<where>
<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>
<if test="enableFlag != null and enableFlag != ''"> and enable_flag = #{enableFlag}</if>
</where>
</select>
<select id="selectDvSubjectBySubjectId" parameterType="Long" resultMap="DvSubjectResult">
<include refid="selectDvSubjectVo"/>
where subject_id = #{subjectId}
</select>
<select id="checkSubjectCodeUnique" parameterType="DvSubject" resultMap="DvSubjectResult">
<include refid="selectDvSubjectVo"/>
where subject_code = #{subjectCode}
</select>
<insert id="insertDvSubject" parameterType="DvSubject" useGeneratedKeys="true" keyProperty="subjectId">
insert into dv_subject
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="subjectCode != null and subjectCode != ''">subject_code,</if>
<if test="subjectName != null and subjectName != ''">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="enableFlag != null and enableFlag != ''">enable_flag,</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="subjectCode != null and subjectCode != ''">#{subjectCode},</if>
<if test="subjectName != null and subjectName != ''">#{subjectName},</if>
<if test="subjectType != null">#{subjectType},</if>
<if test="subjectContent != null and subjectContent != ''">#{subjectContent},</if>
<if test="subjectStandard != null">#{subjectStandard},</if>
<if test="enableFlag != null and enableFlag != ''">#{enableFlag},</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="updateDvSubject" parameterType="DvSubject">
update dv_subject
<trim prefix="SET" suffixOverrides=",">
<if test="subjectCode != null and subjectCode != ''">subject_code = #{subjectCode},</if>
<if test="subjectName != null and subjectName != ''">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="enableFlag != null and enableFlag != ''">enable_flag = #{enableFlag},</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 subject_id = #{subjectId}
</update>
<delete id="deleteDvSubjectBySubjectId" parameterType="Long">
delete from dv_subject where subject_id = #{subjectId}
</delete>
<delete id="deleteDvSubjectBySubjectIds" parameterType="String">
delete from dv_subject where subject_id in
<foreach item="subjectId" collection="array" open="(" separator="," close=")">
#{subjectId}
</foreach>
</delete>
</mapper>