<?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.jcdm.main.om.workReport.mapper.OmWorkReportMapper">
|
|
<resultMap type="OmWorkReport" id="OmWorkReportResult">
|
<result property="id" column="id" />
|
<result property="workOrderCode" column="work_order_code" />
|
<result property="sfcCode" column="sfc_code" />
|
<result property="productCode" column="product_code" />
|
<result property="productName" column="product_name" />
|
<result property="upTime" column="up_time" />
|
<result property="offlineTime" column="offline_time" />
|
<result property="status" column="status" />
|
<result property="createUser" column="create_user" />
|
<result property="createTime" column="create_time" />
|
<result property="updateUser" column="update_user" />
|
<result property="updateTime" column="update_time" />
|
<result property="remark" column="remark" />
|
<result property="spareField1" column="spare_field_1" />
|
<result property="spareField2" column="spare_field_2" />
|
<result property="spareField3" column="spare_field_3" />
|
<result property="spareField4" column="spare_field_4" />
|
</resultMap>
|
|
<sql id="selectOmWorkReportVo">
|
select id, work_order_code, sfc_code, product_code, product_name, up_time, offline_time, status, create_user, create_time, update_user, update_time, remark, spare_field_1, spare_field_2, spare_field_3, spare_field_4 from om_work_report
|
</sql>
|
|
<select id="selectOmWorkReportList" parameterType="OmWorkReport" resultMap="OmWorkReportResult">
|
<include refid="selectOmWorkReportVo"/>
|
<where>
|
<if test="workOrderCode != null and workOrderCode != ''"> and work_order_code = #{workOrderCode}</if>
|
<if test="sfcCode != null and sfcCode != ''"> and sfc_code = #{sfcCode}</if>
|
<if test="productCode != null and productCode != ''"> and product_code = #{productCode}</if>
|
<if test="productName != null and productName != ''"> and product_name like concat('%', #{productName}, '%')</if>
|
<if test="upTime != null and upTime != ''"> and up_time = #{upTime}</if>
|
<if test="offlineTime != null and offlineTime != ''"> and offline_time = #{offlineTime}</if>
|
<if test="status != null and status != ''"> and status = #{status}</if>
|
<if test="createUser != null and createUser != ''"> and create_user = #{createUser}</if>
|
<if test="updateUser != null and updateUser != ''"> and update_user = #{updateUser}</if>
|
<if test="spareField1 != null and spareField1 != ''"> and spare_field_1 = #{spareField1}</if>
|
<if test="spareField2 != null and spareField2 != ''"> and spare_field_2 = #{spareField2}</if>
|
<if test="spareField3 != null and spareField3 != ''"> and spare_field_3 = #{spareField3}</if>
|
<if test="spareField4 != null and spareField4 != ''"> and spare_field_4 = #{spareField4}</if>
|
</where>
|
</select>
|
|
<select id="selectOmWorkReportById" parameterType="Long" resultMap="OmWorkReportResult">
|
<include refid="selectOmWorkReportVo"/>
|
where id = #{id}
|
</select>
|
|
<insert id="insertOmWorkReport" parameterType="OmWorkReport" useGeneratedKeys="true" keyProperty="id">
|
insert into om_work_report
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="workOrderCode != null">work_order_code,</if>
|
<if test="sfcCode != null">sfc_code,</if>
|
<if test="productCode != null">product_code,</if>
|
<if test="productName != null">product_name,</if>
|
<if test="upTime != null">up_time,</if>
|
<if test="offlineTime != null">offline_time,</if>
|
<if test="status != null">status,</if>
|
<if test="createUser != null">create_user,</if>
|
<if test="createTime != null">create_time,</if>
|
<if test="updateUser != null">update_user,</if>
|
<if test="updateTime != null">update_time,</if>
|
<if test="remark != null">remark,</if>
|
<if test="spareField1 != null">spare_field_1,</if>
|
<if test="spareField2 != null">spare_field_2,</if>
|
<if test="spareField3 != null">spare_field_3,</if>
|
<if test="spareField4 != null">spare_field_4,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="workOrderCode != null">#{workOrderCode},</if>
|
<if test="sfcCode != null">#{sfcCode},</if>
|
<if test="productCode != null">#{productCode},</if>
|
<if test="productName != null">#{productName},</if>
|
<if test="upTime != null">#{upTime},</if>
|
<if test="offlineTime != null">#{offlineTime},</if>
|
<if test="status != null">#{status},</if>
|
<if test="createUser != null">#{createUser},</if>
|
<if test="createTime != null">#{createTime},</if>
|
<if test="updateUser != null">#{updateUser},</if>
|
<if test="updateTime != null">#{updateTime},</if>
|
<if test="remark != null">#{remark},</if>
|
<if test="spareField1 != null">#{spareField1},</if>
|
<if test="spareField2 != null">#{spareField2},</if>
|
<if test="spareField3 != null">#{spareField3},</if>
|
<if test="spareField4 != null">#{spareField4},</if>
|
</trim>
|
</insert>
|
|
<update id="updateOmWorkReport" parameterType="OmWorkReport">
|
update om_work_report
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="workOrderCode != null">work_order_code = #{workOrderCode},</if>
|
<if test="sfcCode != null">sfc_code = #{sfcCode},</if>
|
<if test="productCode != null">product_code = #{productCode},</if>
|
<if test="productName != null">product_name = #{productName},</if>
|
<if test="upTime != null">up_time = #{upTime},</if>
|
<if test="offlineTime != null">offline_time = #{offlineTime},</if>
|
<if test="status != null">status = #{status},</if>
|
<if test="createUser != null">create_user = #{createUser},</if>
|
<if test="createTime != null">create_time = #{createTime},</if>
|
<if test="updateUser != null">update_user = #{updateUser},</if>
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
<if test="remark != null">remark = #{remark},</if>
|
<if test="spareField1 != null">spare_field_1 = #{spareField1},</if>
|
<if test="spareField2 != null">spare_field_2 = #{spareField2},</if>
|
<if test="spareField3 != null">spare_field_3 = #{spareField3},</if>
|
<if test="spareField4 != null">spare_field_4 = #{spareField4},</if>
|
</trim>
|
where id = #{id}
|
</update>
|
|
<delete id="deleteOmWorkReportById" parameterType="Long">
|
delete from om_work_report where id = #{id}
|
</delete>
|
|
<delete id="deleteOmWorkReportByIds" parameterType="String">
|
delete from om_work_report where id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</delete>
|
</mapper>
|