| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- <?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.jjt.order.mapper.TwinOrderDetailMapper">
-
- <resultMap type="TwinOrderDetail" id="TwinOrderDetailResult">
- <result property="odId" column="OD_ID" />
- <result property="oderId" column="ODER_ID" />
- <result property="weight" column="WEIGHT" />
- <result property="price" column="PRICE" />
- <result property="unit" column="UNIT" />
- <result property="num" column="NUM" />
- <result property="totalPrice" column="TOTAL_PRICE" />
- <result property="color" column="COLOR" />
- <result property="bomCode" column="BOM_CODE" />
- <result property="bomName" column="BOM_NAME" />
- <result property="bomWeight" column="BOM_WEIGHT" />
- <result property="bomSpec" column="BOM_SPEC" />
- <result property="remark" column="REMARK" />
- </resultMap>
- <sql id="selectTwinOrderDetailVo">
- select OD_ID, ODER_ID, WEIGHT, PRICE, UNIT, NUM, TOTAL_PRICE, COLOR, BOM_CODE, BOM_NAME, BOM_WEIGHT, BOM_SPEC, REMARK from TWIN_ORDER_DETAIL
- </sql>
- <select id="selectTwinOrderDetailList" parameterType="TwinOrderDetail" resultMap="TwinOrderDetailResult">
- <include refid="selectTwinOrderDetailVo"/>
- <where>
- <if test="oderId != null "> and ODER_ID = #{oderId}</if>
- <if test="weight != null "> and WEIGHT = #{weight}</if>
- <if test="price != null "> and PRICE = #{price}</if>
- <if test="unit != null and unit != ''"> and UNIT = #{unit}</if>
- <if test="num != null "> and NUM = #{num}</if>
- <if test="totalPrice != null "> and TOTAL_PRICE = #{totalPrice}</if>
- <if test="color != null and color != ''"> and COLOR = #{color}</if>
- <if test="bomCode != null and bomCode != ''"> and BOM_CODE = #{bomCode}</if>
- <if test="bomName != null and bomName != ''"> and BOM_NAME like concat('%', #{bomName}, '%')</if>
- <if test="bomWeight != null "> and BOM_WEIGHT = #{bomWeight}</if>
- <if test="bomSpec != null and bomSpec != ''"> and BOM_SPEC = #{bomSpec}</if>
- <if test="remark != null and remark != ''"> and REMARK = #{remark}</if>
- </where>
- </select>
-
- <select id="selectTwinOrderDetailByOdId" parameterType="Long" resultMap="TwinOrderDetailResult">
- <include refid="selectTwinOrderDetailVo"/>
- where OD_ID = #{odId}
- </select>
- <insert id="insertTwinOrderDetail" parameterType="TwinOrderDetail">
- insert into TWIN_ORDER_DETAIL
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="odId != null">OD_ID,</if>
- <if test="oderId != null">ODER_ID,</if>
- <if test="weight != null">WEIGHT,</if>
- <if test="price != null">PRICE,</if>
- <if test="unit != null">UNIT,</if>
- <if test="num != null">NUM,</if>
- <if test="totalPrice != null">TOTAL_PRICE,</if>
- <if test="color != null">COLOR,</if>
- <if test="bomCode != null">BOM_CODE,</if>
- <if test="bomName != null">BOM_NAME,</if>
- <if test="bomWeight != null">BOM_WEIGHT,</if>
- <if test="bomSpec != null">BOM_SPEC,</if>
- <if test="remark != null">REMARK,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="odId != null">#{odId},</if>
- <if test="oderId != null">#{oderId},</if>
- <if test="weight != null">#{weight},</if>
- <if test="price != null">#{price},</if>
- <if test="unit != null">#{unit},</if>
- <if test="num != null">#{num},</if>
- <if test="totalPrice != null">#{totalPrice},</if>
- <if test="color != null">#{color},</if>
- <if test="bomCode != null">#{bomCode},</if>
- <if test="bomName != null">#{bomName},</if>
- <if test="bomWeight != null">#{bomWeight},</if>
- <if test="bomSpec != null">#{bomSpec},</if>
- <if test="remark != null">#{remark},</if>
- </trim>
- </insert>
- <update id="updateTwinOrderDetail" parameterType="TwinOrderDetail">
- update TWIN_ORDER_DETAIL
- <trim prefix="SET" suffixOverrides=",">
- <if test="oderId != null">ODER_ID = #{oderId},</if>
- <if test="weight != null">WEIGHT = #{weight},</if>
- <if test="price != null">PRICE = #{price},</if>
- <if test="unit != null">UNIT = #{unit},</if>
- <if test="num != null">NUM = #{num},</if>
- <if test="totalPrice != null">TOTAL_PRICE = #{totalPrice},</if>
- <if test="color != null">COLOR = #{color},</if>
- <if test="bomCode != null">BOM_CODE = #{bomCode},</if>
- <if test="bomName != null">BOM_NAME = #{bomName},</if>
- <if test="bomWeight != null">BOM_WEIGHT = #{bomWeight},</if>
- <if test="bomSpec != null">BOM_SPEC = #{bomSpec},</if>
- <if test="remark != null">REMARK = #{remark},</if>
- </trim>
- where OD_ID = #{odId}
- </update>
- <delete id="deleteTwinOrderDetailByOdId" parameterType="Long">
- delete from TWIN_ORDER_DETAIL where OD_ID = #{odId}
- </delete>
- <delete id="deleteTwinOrderDetailByOdIds" parameterType="String">
- delete from TWIN_ORDER_DETAIL where OD_ID in
- <foreach item="odId" collection="array" open="(" separator="," close=")">
- #{odId}
- </foreach>
- </delete>
- </mapper>
|