点检计划、保养计划合二为一

This commit is contained in:
JinLu.Yin
2022-06-19 17:23:27 +08:00
parent 1e1cc2fd09
commit 917f34db7c
4 changed files with 59 additions and 22 deletions

View File

@@ -46,7 +46,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="checkMachineryUnique" parameterType="DvCheckMachinery" resultMap="DvCheckMachineryResult">
<include refid="selectDvCheckMachineryVo"/>
where machinery_id = #{machineryId} limit 1
where machinery_id = #{machineryId} and plan_type = #{planType} limit 1
</select>
<insert id="insertDvCheckMachinery" parameterType="DvCheckMachinery" useGeneratedKeys="true" keyProperty="recordId">

View File

@@ -8,6 +8,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<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" />
@@ -25,7 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectDvCheckPlanVo">
select plan_id, plan_code, plan_name, 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
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">
@@ -33,6 +34,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<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>
@@ -56,6 +58,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<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>
@@ -74,6 +77,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<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>
@@ -96,6 +100,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<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>