|
|
|
@ -6,6 +6,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
|
|
|
|
<resultMap type="MesReportWorkConsume" id="MesReportWorkConsumeResult">
|
|
|
|
|
<result property="recordId" column="record_id" />
|
|
|
|
|
<result property="reportCode" column="report_code" />
|
|
|
|
|
<result property="workorderCode" column="workorder_code" />
|
|
|
|
|
<result property="materialCode" column="material_code" />
|
|
|
|
|
<result property="materialName" column="material_name" />
|
|
|
|
@ -25,12 +26,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<sql id="selectMesReportWorkConsumeVo">
|
|
|
|
|
select record_id, workorder_code, material_code, material_name, material_spc, quantity, unit, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time, factory_code from mes_report_work_consume
|
|
|
|
|
select record_id, workorder_code, material_code, material_name, material_spc, quantity, unit, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time, factory_code,report_code from mes_report_work_consume
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<select id="selectMesReportWorkConsumeList" parameterType="MesReportWorkConsume" resultMap="MesReportWorkConsumeResult">
|
|
|
|
|
<include refid="selectMesReportWorkConsumeVo"/>
|
|
|
|
|
<where>
|
|
|
|
|
<if test="reportCode != null and reportCode != ''"> and report_code = #{reportCode}</if>
|
|
|
|
|
<if test="workorderCode != null and workorderCode != ''"> and workorder_code = #{workorderCode}</if>
|
|
|
|
|
<if test="materialCode != null and materialCode != ''"> and material_code = #{materialCode}</if>
|
|
|
|
|
<if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if>
|
|
|
|
@ -45,6 +47,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
</where>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectMesReportWorkConsumeListById" parameterType="MesReportWorkConsume" resultMap="MesReportWorkConsumeResult">
|
|
|
|
|
<include refid="selectMesReportWorkConsumeVo"/>
|
|
|
|
|
where report_code = #{recordCode}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectMesReportWorkConsumeByRecordId" parameterType="String" resultMap="MesReportWorkConsumeResult">
|
|
|
|
|
<include refid="selectMesReportWorkConsumeVo"/>
|
|
|
|
|
where record_id = #{recordId}
|
|
|
|
@ -54,6 +61,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
insert into mes_report_work_consume
|
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="recordId != null">record_id,</if>
|
|
|
|
|
<if test="reportCode != null and reportCode != ''">report_code,</if>
|
|
|
|
|
<if test="workorderCode != null and workorderCode != ''">workorder_code,</if>
|
|
|
|
|
<if test="materialCode != null and materialCode != ''">material_code,</if>
|
|
|
|
|
<if test="materialName != null and materialName != ''">material_name,</if>
|
|
|
|
@ -73,6 +81,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="recordId != null">#{recordId},</if>
|
|
|
|
|
<if test="reportCode != null and reportCode != ''">#{reportCode},</if>
|
|
|
|
|
<if test="workorderCode != null and workorderCode != ''">#{workorderCode},</if>
|
|
|
|
|
<if test="materialCode != null and materialCode != ''">#{materialCode},</if>
|
|
|
|
|
<if test="materialName != null and materialName != ''">#{materialName},</if>
|
|
|
|
@ -95,6 +104,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
<update id="updateMesReportWorkConsume" parameterType="MesReportWorkConsume">
|
|
|
|
|
update mes_report_work_consume
|
|
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
|
|
<if test="reportCode != null and reportCode != ''">report_code = #{reportCode},</if>
|
|
|
|
|
<if test="workorderCode != null and workorderCode != ''">workorder_code = #{workorderCode},</if>
|
|
|
|
|
<if test="materialCode != null and materialCode != ''">material_code = #{materialCode},</if>
|
|
|
|
|
<if test="materialName != null and materialName != ''">material_name = #{materialName},</if>
|
|
|
|
|