<?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.zy.asrs.mapper.OrderDetlMapper">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="BaseResultMap" type="com.zy.asrs.entity.OrderDetl">
|
<id column="id" property="id" />
|
<result column="order_id" property="orderId" />
|
<result column="order_no" property="orderNo" />
|
<result column="anfme" property="anfme" />
|
<result column="qty" property="qty" />
|
<result column="matnr" property="matnr" />
|
<result column="maktx" property="maktx" />
|
<result column="name" property="name" />
|
<result column="specs" property="specs" />
|
<result column="model" property="model" />
|
<result column="batch" property="batch" />
|
<result column="unit" property="unit" />
|
<result column="barcode" property="barcode" />
|
<result column="supplier" property="supplier" />
|
<result column="unit_price" property="unitPrice" />
|
<result column="item_num" property="itemNum" />
|
<result column="count" property="count" />
|
<result column="weight" property="weight" />
|
<result column="status" property="status" />
|
<result column="create_by" property="createBy" />
|
<result column="create_time" property="createTime" />
|
<result column="update_by" property="updateBy" />
|
<result column="update_time" property="updateTime" />
|
<result column="memo" property="memo" />
|
|
</resultMap>
|
|
<select id="selectItem" resultMap="BaseResultMap">
|
select * from man_order_detl
|
where 1=1
|
and order_id = #{orderId}
|
and matnr = #{matnr}
|
<choose>
|
<when test="batch != null and batch != ''">
|
and batch = #{batch}
|
</when>
|
<otherwise>
|
and (batch IS NULL OR batch = '')
|
</otherwise>
|
</choose>
|
</select>
|
|
<select id="selectItemByOrderNo" resultMap="BaseResultMap">
|
select * from man_order_detl
|
where 1=1
|
and order_no = #{orderNo}
|
and matnr = #{matnr}
|
<choose>
|
<when test="batch != null and batch != ''">
|
and batch = #{batch}
|
</when>
|
<otherwise>
|
and (batch IS NULL OR batch = '')
|
</otherwise>
|
</choose>
|
</select>
|
|
<select id="selectWorkingDetls" resultMap="BaseResultMap">
|
select * from man_order_detl
|
where 1=1
|
and order_id = #{orderId}
|
and qty < anfme
|
</select>
|
|
<update id="increase">
|
update man_order_detl
|
set qty = qty + #{qty}
|
where 1=1
|
and order_id = #{orderId}
|
and matnr = #{matnr}
|
<choose>
|
<when test="batch != null and batch != ''">
|
and batch = #{batch}
|
</when>
|
<otherwise>
|
and (batch IS NULL OR batch = '')
|
</otherwise>
|
</choose>
|
</update>
|
|
</mapper>
|