154 lines
9.0 KiB
XML
154 lines
9.0 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.bonus.canteen.core.ims.mapper.OrderGoodsDetailMapper">
|
|
<resultMap type="com.bonus.canteen.core.ims.domain.vo.OrderGoodsDetailVO" id="OrderGoodsDetailResult">
|
|
<result property="orderGoodsDetailId" column="order_goods_detail_id" />
|
|
<result property="orderGoodsId" column="order_goods_id" />
|
|
<result property="materialId" column="material_id" />
|
|
<result property="unitId" column="unit_id" />
|
|
<result property="size" column="size" />
|
|
<result property="orderNum" column="order_num" />
|
|
<result property="singlePrice" column="single_price" />
|
|
<result property="totalPrice" column="total_price" />
|
|
<result property="intoNum" column="into_num" />
|
|
<result property="unqualifiedNum" column="unqualified_num" />
|
|
<result property="unqualifiedReason" column="unqualified_reason" />
|
|
<result property="ifAllInspect" column="if_all_inspect" />
|
|
<result property="remark" column="remark" />
|
|
<!-- <result property="delFlag" column="del_flag" />-->
|
|
<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="materialName" column="material_name" />
|
|
<result property="unitName" column="unit_name" />
|
|
<result property="materialCode" column="material_code" />
|
|
<result property="materialTypeName" column="material_type_name" />
|
|
</resultMap>
|
|
|
|
<sql id="selectOrderGoodsDetailVo">
|
|
select order_goods_detail_id, order_goods_id, iogd.material_id, iogd.unit_id, iogd.size,
|
|
order_num, single_price, total_price, into_num, unqualified_num,
|
|
unqualified_reason, if_all_inspect, remark, del_flag, iogd.create_by,
|
|
iogd.create_time, iogd.update_by, iogd.update_time, cm.material_name, iu.unit_name,
|
|
cm.material_code, cmt.material_type_name
|
|
from ims_order_goods_detail iogd
|
|
left join cook_material cm on cm.material_id = iogd.material_id
|
|
left join cook_material_type cmt on cm.material_type_id = cmt.material_type_id
|
|
left join ims_unit iu on iu.unit_id = iogd.unit_id
|
|
</sql>
|
|
|
|
<select id="selectOrderGoodsDetailList" parameterType="com.bonus.canteen.core.ims.domain.OrderGoodsDetail" resultMap="OrderGoodsDetailResult">
|
|
<include refid="selectOrderGoodsDetailVo"/>
|
|
<where>
|
|
iogd.del_flag = '0'
|
|
<if test="orderGoodsId != null "> and iogd.order_goods_id = #{orderGoodsId}</if>
|
|
<if test="materialId != null "> and iogd.material_id = #{materialId}</if>
|
|
<if test="unitId != null "> and iogd.unit_id = #{unitId}</if>
|
|
<if test="size != null and size != ''"> and iogd.size = #{size}</if>
|
|
<if test="orderNum != null "> and iogd.order_num = #{orderNum}</if>
|
|
<if test="singlePrice != null "> and iogd.single_price = #{singlePrice}</if>
|
|
<if test="totalPrice != null "> and iogd.total_price = #{totalPrice}</if>
|
|
<if test="intoNum != null "> and iogd.into_num = #{intoNum}</if>
|
|
<if test="unqualifiedNum != null "> and iogd.unqualified_num = #{unqualifiedNum}</if>
|
|
<if test="unqualifiedReason != null and unqualifiedReason != ''"> and iogd.unqualified_reason = #{unqualifiedReason}</if>
|
|
<if test="ifAllInspect != null "> and iogd.if_all_inspect = #{ifAllInspect}</if>
|
|
</where>
|
|
order by iogd.order_goods_detail_id
|
|
</select>
|
|
|
|
<select id="selectOrderGoodsDetailByOrderGoodsDetailId" parameterType="Long" resultMap="OrderGoodsDetailResult">
|
|
<include refid="selectOrderGoodsDetailVo"/>
|
|
where iogd.del_flag = '0' and iogd.order_goods_detail_id = #{orderGoodsDetailId}
|
|
</select>
|
|
|
|
<insert id="insertOrderGoodsDetail" parameterType="com.bonus.canteen.core.ims.domain.OrderGoodsDetail" useGeneratedKeys="true" keyProperty="orderGoodsDetailId">
|
|
insert into ims_order_goods_detail
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="orderGoodsId != null">order_goods_id,</if>
|
|
<if test="materialId != null">material_id,</if>
|
|
<if test="unitId != null">unit_id,</if>
|
|
<if test="size != null">size,</if>
|
|
<if test="orderNum != null">order_num,</if>
|
|
<if test="singlePrice != null">single_price,</if>
|
|
<if test="totalPrice != null">total_price,</if>
|
|
<if test="intoNum != null">into_num,</if>
|
|
<if test="unqualifiedNum != null">unqualified_num,</if>
|
|
<if test="unqualifiedReason != null">unqualified_reason,</if>
|
|
<if test="ifAllInspect != null">if_all_inspect,</if>
|
|
<if test="remark != null">remark,</if>
|
|
<if test="delFlag != null">del_flag,</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="orderGoodsId != null">#{orderGoodsId},</if>
|
|
<if test="materialId != null">#{materialId},</if>
|
|
<if test="unitId != null">#{unitId},</if>
|
|
<if test="size != null">#{size},</if>
|
|
<if test="orderNum != null">#{orderNum},</if>
|
|
<if test="singlePrice != null">#{singlePrice},</if>
|
|
<if test="totalPrice != null">#{totalPrice},</if>
|
|
<if test="intoNum != null">#{intoNum},</if>
|
|
<if test="unqualifiedNum != null">#{unqualifiedNum},</if>
|
|
<if test="unqualifiedReason != null">#{unqualifiedReason},</if>
|
|
<if test="ifAllInspect != null">#{ifAllInspect},</if>
|
|
<if test="remark != null">#{remark},</if>
|
|
<if test="delFlag != null">#{delFlag},</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="updateOrderGoodsDetail" parameterType="com.bonus.canteen.core.ims.domain.OrderGoodsDetail">
|
|
update ims_order_goods_detail
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="orderGoodsId != null">order_goods_id = #{orderGoodsId},</if>
|
|
<if test="materialId != null">material_id = #{materialId},</if>
|
|
<if test="unitId != null">unit_id = #{unitId},</if>
|
|
<if test="size != null">size = #{size},</if>
|
|
<if test="orderNum != null">order_num = #{orderNum},</if>
|
|
<if test="singlePrice != null">single_price = #{singlePrice},</if>
|
|
<if test="totalPrice != null">total_price = #{totalPrice},</if>
|
|
<if test="intoNum != null">into_num = #{intoNum},</if>
|
|
<if test="unqualifiedNum != null">unqualified_num = #{unqualifiedNum},</if>
|
|
<if test="unqualifiedReason != null">unqualified_reason = #{unqualifiedReason},</if>
|
|
<if test="ifAllInspect != null">if_all_inspect = #{ifAllInspect},</if>
|
|
<if test="remark != null">remark = #{remark},</if>
|
|
<!-- <if test="delFlag != null">del_flag = #{delFlag},</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 order_goods_detail_id = #{orderGoodsDetailId}
|
|
</update>
|
|
|
|
<delete id="deleteOrderGoodsDetailByOrderGoodsDetailId" parameterType="Long">
|
|
update ims_order_goods_detail set del_flag = '2' where order_goods_detail_id = #{orderGoodsDetailId}
|
|
</delete>
|
|
|
|
<delete id="deleteOrderGoodsDetailByOrderGoodsId" parameterType="Long">
|
|
update ims_order_goods_detail set del_flag = '2' where order_goods_id = #{orderGoodsId}
|
|
</delete>
|
|
|
|
<delete id="deleteOrderGoodsDetailByOrderGoodsIds" parameterType="String">
|
|
update ims_order_goods_detail set del_flag = '2' where order_goods_id in
|
|
<foreach item="orderGoodsId" collection="array" open="(" separator="," close=")">
|
|
#{orderGoodsId}
|
|
</foreach>
|
|
</delete>
|
|
|
|
<delete id="deleteOrderGoodsDetailByOrderGoodsDetailIds" parameterType="String">
|
|
update ims_order_goods_detail set del_flag = '2' where order_goods_detail_id in
|
|
<foreach item="orderGoodsDetailId" collection="array" open="(" separator="," close=")">
|
|
#{orderGoodsDetailId}
|
|
</foreach>
|
|
</delete>
|
|
</mapper> |