| | |
| | | <sql id="batchSeq"> |
| | | <choose> |
| | | <when test="batch != null and batch != ''"> |
| | | and batch = #{batch} |
| | | and sku = #{batch} |
| | | </when> |
| | | <otherwise> |
| | | and (batch IS NULL OR batch = '') |
| | | and (sku IS NULL OR sku = '') |
| | | </otherwise> |
| | | </choose> |
| | | </sql> |
| | |
| | | where 1=1 |
| | | and loc_no = #{locNo} |
| | | and matnr = #{matnr} |
| | | <include refid="batchSeq"></include> |
| | | <choose> |
| | | <when test="batch != null and batch != ''"> |
| | | and sku = #{batch} |
| | | </when> |
| | | <otherwise> |
| | | and (sku IS NULL OR sku = '') |
| | | </otherwise> |
| | | </choose> |
| | | </select> |
| | | |
| | | <delete id="deleteItem"> |
| | |
| | | where 1=1 |
| | | and loc_no = #{locNo} |
| | | and matnr = #{matnr} |
| | | <include refid="batchSeq"></include> |
| | | <choose> |
| | | <when test="batch != null and batch != ''"> |
| | | and sku = #{batch} |
| | | </when> |
| | | <otherwise> |
| | | and (sku IS NULL OR sku = '') |
| | | </otherwise> |
| | | </choose> |
| | | </delete> |
| | | |
| | | <update id="updateAnfme"> |
| | |
| | | where 1=1 |
| | | and loc_no = #{locNo} |
| | | and matnr = #{matnr} |
| | | <include refid="batchSeq"></include> |
| | | <choose> |
| | | <when test="batch != null and batch != ''"> |
| | | and sku = #{batch} |
| | | </when> |
| | | <otherwise> |
| | | and (sku IS NULL OR sku = '') |
| | | </otherwise> |
| | | </choose> |
| | | </update> |
| | | |
| | | <sql id="stockOutCondition"> |