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.
97 lines
3.3 KiB
XML
97 lines
3.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.glxp.api.dao.inv.InvCountCodesMapper">
|
|
<resultMap id="BaseResultMap" type="com.glxp.api.entity.inv.InvCountCodesEntity">
|
|
<!--@mbg.generated-->
|
|
<!--@Table inv_count_codes-->
|
|
<id column="id" jdbcType="INTEGER" property="id"/>
|
|
<result column="orderIdFk" jdbcType="VARCHAR" property="orderIdFk"/>
|
|
<result column="productId" jdbcType="VARCHAR" property="productId"/>
|
|
<result column="code" jdbcType="VARCHAR" property="code"/>
|
|
<result column="status" jdbcType="BOOLEAN" property="status"/>
|
|
<result column="batchNo" jdbcType="VARCHAR" property="batchNo"/>
|
|
<result column="count" jdbcType="INTEGER" property="count"/>
|
|
</resultMap>
|
|
<sql id="Base_Column_List">
|
|
<!--@mbg.generated-->
|
|
id, orderIdFk, productId, code, `status`, batchNo, `count`
|
|
</sql>
|
|
|
|
|
|
<delete id="deleteByOrderId">
|
|
delete
|
|
from inv_count_codes
|
|
where orderIdFk = #{orderId}
|
|
</delete>
|
|
|
|
<select id="filterList" resultType="com.glxp.api.entity.inv.InvCountCodesEntity">
|
|
select *
|
|
from inv_count_codes
|
|
<where>
|
|
<if test="orderIdFk != null and orderIdFk != ''">
|
|
AND orderIdFk = #{orderIdFk}
|
|
</if>
|
|
<if test="productId != null and productId != ''">
|
|
AND productId = #{productId}
|
|
</if>
|
|
<if test="code != null and code != ''">
|
|
AND code like concat('%', #{code}, '%')
|
|
</if>
|
|
<if test="status != null">
|
|
AND status = #{status}
|
|
</if>
|
|
<if test="batchNo != null and batchNo != ''">
|
|
AND batchNo = #{batchNo}
|
|
</if>
|
|
</where>
|
|
</select>
|
|
|
|
<select id="countByOrderIdFk" resultType="java.lang.Long">
|
|
select count(*)
|
|
from inv_count_codes
|
|
where orderIdFk = #{orderIdFk}
|
|
</select>
|
|
|
|
<select id="countByOrderId" resultType="java.lang.Long">
|
|
select sum(count)
|
|
from inv_count_codes
|
|
where orderIdFk = #{orderIdFk}
|
|
</select>
|
|
|
|
<select id="selectCountByCodeAndOrderId" resultType="java.lang.Long">
|
|
select count(*)
|
|
from inv_count_codes
|
|
where orderIdFk = #{orderIdFk}
|
|
and code = #{code}
|
|
</select>
|
|
|
|
<update id="resetCountFiledValue">
|
|
update inv_count_codes
|
|
set status = null
|
|
where orderIdFk = #{orderId}
|
|
</update>
|
|
|
|
<select id="selectByOrderIdAndProductId" resultMap="BaseResultMap">
|
|
select *
|
|
from inv_count_codes
|
|
where orderIdFk = #{orderIdFk}
|
|
and productId = #{productId}
|
|
</select>
|
|
|
|
<select id="selectCodes" resultType="java.lang.String">
|
|
select code
|
|
from inv_count_codes
|
|
<where>
|
|
<if test="orderIdFk != null and orderIdFk != ''">
|
|
AND orderIdFk = #{orderIdFk}
|
|
</if>
|
|
<if test="productId != null and productId != ''">
|
|
AND productId = #{productId}
|
|
</if>
|
|
<if test="batchNo != null and batchNo != ''">
|
|
AND batchNo = #{batchNo}
|
|
</if>
|
|
</where>
|
|
</select>
|
|
</mapper>
|