mes报工
parent
49188ecaaf
commit
17a42de771
@ -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.op.mes.mapper.MesReportWorkConsumeMapper">
|
||||||
|
|
||||||
|
<resultMap type="MesReportWorkConsume" id="MesReportWorkConsumeResult">
|
||||||
|
<result property="recordId" column="record_id" />
|
||||||
|
<result property="workorderCode" column="workorder_code" />
|
||||||
|
<result property="materialCode" column="material_code" />
|
||||||
|
<result property="materialName" column="material_name" />
|
||||||
|
<result property="materialSpc" column="material_spc" />
|
||||||
|
<result property="quantity" column="quantity" />
|
||||||
|
<result property="unit" column="unit" />
|
||||||
|
<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" />
|
||||||
|
<result property="factoryCode" column="factory_code" />
|
||||||
|
</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
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectMesReportWorkConsumeList" parameterType="MesReportWorkConsume" resultMap="MesReportWorkConsumeResult">
|
||||||
|
<include refid="selectMesReportWorkConsumeVo"/>
|
||||||
|
<where>
|
||||||
|
<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>
|
||||||
|
<if test="materialSpc != null and materialSpc != ''"> and material_spc = #{materialSpc}</if>
|
||||||
|
<if test="quantity != null "> and quantity = #{quantity}</if>
|
||||||
|
<if test="unit != null and unit != ''"> and unit = #{unit}</if>
|
||||||
|
<if test="attr1 != null and attr1 != ''"> and attr1 = #{attr1}</if>
|
||||||
|
<if test="attr2 != null and attr2 != ''"> and attr2 = #{attr2}</if>
|
||||||
|
<if test="attr3 != null and attr3 != ''"> and attr3 = #{attr3}</if>
|
||||||
|
<if test="attr4 != null and attr4 != ''"> and attr4 = #{attr4}</if>
|
||||||
|
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectMesReportWorkConsumeByRecordId" parameterType="String" resultMap="MesReportWorkConsumeResult">
|
||||||
|
<include refid="selectMesReportWorkConsumeVo"/>
|
||||||
|
where record_id = #{recordId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertMesReportWorkConsume" parameterType="MesReportWorkConsume">
|
||||||
|
insert into mes_report_work_consume
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="recordId != null">record_id,</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>
|
||||||
|
<if test="materialSpc != null">material_spc,</if>
|
||||||
|
<if test="quantity != null">quantity,</if>
|
||||||
|
<if test="unit != null and unit != ''">unit,</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>
|
||||||
|
<if test="factoryCode != null">factory_code,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="recordId != null">#{recordId},</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>
|
||||||
|
<if test="materialSpc != null">#{materialSpc},</if>
|
||||||
|
<if test="quantity != null">#{quantity},</if>
|
||||||
|
<if test="unit != null and unit != ''">#{unit},</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>
|
||||||
|
<if test="factoryCode != null">#{factoryCode},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateMesReportWorkConsume" parameterType="MesReportWorkConsume">
|
||||||
|
update mes_report_work_consume
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<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>
|
||||||
|
<if test="materialSpc != null">material_spc = #{materialSpc},</if>
|
||||||
|
<if test="quantity != null">quantity = #{quantity},</if>
|
||||||
|
<if test="unit != null and unit != ''">unit = #{unit},</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>
|
||||||
|
<if test="factoryCode != null">factory_code = #{factoryCode},</if>
|
||||||
|
</trim>
|
||||||
|
where record_id = #{recordId}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteMesReportWorkConsumeByRecordId" parameterType="String">
|
||||||
|
delete from mes_report_work_consume where record_id = #{recordId}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteMesReportWorkConsumeByRecordIds" parameterType="String">
|
||||||
|
delete from mes_report_work_consume where record_id in
|
||||||
|
<foreach item="recordId" collection="array" open="(" separator="," close=")">
|
||||||
|
#{recordId}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
Loading…
Reference in New Issue