You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
132 lines
6.3 KiB
XML
132 lines
6.3 KiB
XML
<?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.MesUnitPriceMapper">
|
|
|
|
<resultMap type="MesUnitPrice" id="MesUnitPriceResult">
|
|
<result property="picId" column="pic_id" />
|
|
<result property="factoryId" column="factory_id" />
|
|
<result property="productCode" column="product_code" />
|
|
<result property="productName" column="product_name" />
|
|
<result property="lineCode" column="line_code" />
|
|
<result property="lineName" column="line_name" />
|
|
<result property="childprocessId" column="childprocess_id" />
|
|
<result property="childprocessCode" column="childprocess_code" />
|
|
<result property="childprocessName" column="childprocess_name" />
|
|
<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="selectMesUnitPriceVo">
|
|
select pic_id, factory_id, product_code, product_name, line_code, line_name, childprocess_id, childprocess_code, childprocess_name, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from mes_unit_price
|
|
</sql>
|
|
|
|
<select id="selectMesUnitPriceList" parameterType="MesUnitPrice" resultMap="MesUnitPriceResult">
|
|
<include refid="selectMesUnitPriceVo"/>
|
|
|
|
<where>
|
|
<if test="factoryId != null "> and factory_id = #{factoryId}</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="lineCode != null and lineCode != ''"> and line_code = #{lineCode}</if>
|
|
<if test="lineName != null and lineName != ''"> and line_name like concat('%', #{lineName}, '%')</if>
|
|
<if test="childprocessId != null and childprocessId != ''"> and childprocess_id = #{childprocessId}</if>
|
|
<if test="childprocessCode != null and childprocessCode != ''"> and childprocess_code = #{childprocessCode}</if>
|
|
<if test="childprocessName != null and childprocessName != ''"> and childprocess_name like concat('%', #{childprocessName}, '%')</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 = #{attr3}</if>
|
|
<if test="attr4 != null "> and attr4 = #{attr4}</if>
|
|
</where>
|
|
ORDER BY childprocess_code ASC
|
|
</select>
|
|
|
|
<select id="selectMesUnitPriceByPicId" parameterType="String" resultMap="MesUnitPriceResult">
|
|
<include refid="selectMesUnitPriceVo"/>
|
|
where pic_id = #{picId}
|
|
</select>
|
|
|
|
<insert id="insertMesUnitPrice" parameterType="MesUnitPrice">
|
|
insert into mes_unit_price
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="picId != null">pic_id,</if>
|
|
<if test="factoryId != null">factory_id,</if>
|
|
<if test="productCode != null">product_code,</if>
|
|
<if test="productName != null">product_name,</if>
|
|
<if test="lineCode != null">line_code,</if>
|
|
<if test="lineName != null">line_name,</if>
|
|
<if test="childprocessId != null">childprocess_id,</if>
|
|
<if test="childprocessCode != null">childprocess_code,</if>
|
|
<if test="childprocessName != null">childprocess_name,</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="picId != null">#{picId},</if>
|
|
<if test="factoryId != null">#{factoryId},</if>
|
|
<if test="productCode != null">#{productCode},</if>
|
|
<if test="productName != null">#{productName},</if>
|
|
<if test="lineCode != null">#{lineCode},</if>
|
|
<if test="lineName != null">#{lineName},</if>
|
|
<if test="childprocessId != null">#{childprocessId},</if>
|
|
<if test="childprocessCode != null">#{childprocessCode},</if>
|
|
<if test="childprocessName != null">#{childprocessName},</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="updateMesUnitPrice" parameterType="MesUnitPrice">
|
|
update mes_unit_price
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="factoryId != null">factory_id = #{factoryId},</if>
|
|
<if test="productCode != null">product_code = #{productCode},</if>
|
|
<if test="productName != null">product_name = #{productName},</if>
|
|
<if test="lineCode != null">line_code = #{lineCode},</if>
|
|
<if test="lineName != null">line_name = #{lineName},</if>
|
|
<if test="childprocessId != null">childprocess_id = #{childprocessId},</if>
|
|
<if test="childprocessCode != null">childprocess_code = #{childprocessCode},</if>
|
|
<if test="childprocessName != null">childprocess_name = #{childprocessName},</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 pic_id = #{picId}
|
|
</update>
|
|
|
|
<delete id="deleteMesUnitPriceByPicId" parameterType="String">
|
|
delete from mes_unit_price where pic_id = #{picId}
|
|
</delete>
|
|
|
|
<delete id="deleteMesUnitPriceByPicIds" parameterType="String">
|
|
delete from mes_unit_price where pic_id in
|
|
<foreach item="picId" collection="array" open="(" separator="," close=")">
|
|
#{picId}
|
|
</foreach>
|
|
</delete>
|
|
</mapper>
|