|
@@ -8,8 +8,39 @@
|
|
|
item_id, pur_id, item_index, sku_id, item_qty, price_std, amt_std, price_pur, item_amt, price_discount, non_std_code, into_status, intoing_qty, intoing_amt, into_qty, into_amt, return_qty, return_amt, remarks, flg_valid, cp_id, op_create_time, op_create_user_id, op_update_time, op_update_user_id, op_app_code, op_timestamp, op_db_user
|
|
item_id, pur_id, item_index, sku_id, item_qty, price_std, amt_std, price_pur, item_amt, price_discount, non_std_code, into_status, intoing_qty, intoing_amt, into_qty, into_amt, return_qty, return_amt, remarks, flg_valid, cp_id, op_create_time, op_create_user_id, op_update_time, op_update_user_id, op_app_code, op_timestamp, op_db_user
|
|
|
</sql>
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
+ <sql id="Base_Column_List_1">
|
|
|
|
|
+ tppi.item_id,
|
|
|
|
|
+ tppi.pur_id,
|
|
|
|
|
+ tppi.item_index,
|
|
|
|
|
+ tppi.sku_id,
|
|
|
|
|
+ tppi.item_qty,
|
|
|
|
|
+ tppi.price_std,
|
|
|
|
|
+ tppi.amt_std,
|
|
|
|
|
+ tppi.price_pur,
|
|
|
|
|
+ tppi.item_amt,
|
|
|
|
|
+ tppi.price_discount,
|
|
|
|
|
+ tppi.non_std_code,
|
|
|
|
|
+ tppi.into_status,
|
|
|
|
|
+ tppi.intoing_qty,
|
|
|
|
|
+ tppi.intoing_amt,
|
|
|
|
|
+ tppi.into_qty,
|
|
|
|
|
+ tppi.into_amt,
|
|
|
|
|
+ tppi.return_qty,
|
|
|
|
|
+ tppi.return_amt,
|
|
|
|
|
+ tppi.remarks,
|
|
|
|
|
+ tppi.flg_valid,
|
|
|
|
|
+ tppi.cp_id,
|
|
|
|
|
+ tppi.op_create_time,
|
|
|
|
|
+ tppi.op_create_user_id,
|
|
|
|
|
+ tppi.op_update_time,
|
|
|
|
|
+ tppi.op_update_user_id,
|
|
|
|
|
+ tppi.op_app_code,
|
|
|
|
|
+ tppi.op_timestamp,
|
|
|
|
|
+ tppi.op_db_user
|
|
|
|
|
+ </sql>
|
|
|
|
|
+
|
|
|
<!-- 通用查询映射结果 -->
|
|
<!-- 通用查询映射结果 -->
|
|
|
- <resultMap id="BaseResultMap" type="com.dk.mdm.model.pojo.pur.PurchaseItem">
|
|
|
|
|
|
|
+ <resultMap id="BaseResultMap" type="com.dk.mdm.model.response.pur.PurchaseItemResponse">
|
|
|
<id column="item_id" property="itemId"/>
|
|
<id column="item_id" property="itemId"/>
|
|
|
<result column="pur_id" property="purId" typeHandler="UuidTypeHandler"/>
|
|
<result column="pur_id" property="purId" typeHandler="UuidTypeHandler"/>
|
|
|
<result column="item_index" property="itemIndex"/>
|
|
<result column="item_index" property="itemIndex"/>
|
|
@@ -44,7 +75,7 @@
|
|
|
<sql id="Condition">
|
|
<sql id="Condition">
|
|
|
<where>
|
|
<where>
|
|
|
<if test="purId != null and purId != ''">
|
|
<if test="purId != null and purId != ''">
|
|
|
- AND pur_id = #{purId}
|
|
|
|
|
|
|
+ AND pur_id = #{purId}::uuid
|
|
|
</if>
|
|
</if>
|
|
|
<if test="itemIndex != null">
|
|
<if test="itemIndex != null">
|
|
|
AND item_index = #{itemIndex}
|
|
AND item_index = #{itemIndex}
|
|
@@ -127,6 +158,93 @@
|
|
|
</where>
|
|
</where>
|
|
|
</sql>
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
+ <!-- 通用条件列 -->
|
|
|
|
|
+ <sql id="Condition_1">
|
|
|
|
|
+ <where>
|
|
|
|
|
+ <if test="purId != null and purId != ''">
|
|
|
|
|
+ AND tppi.pur_id = #{purId}::uuid
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="itemIndex != null">
|
|
|
|
|
+ AND tppi.item_index = #{itemIndex}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="skuId != null and skuId != ''">
|
|
|
|
|
+ AND tppi.sku_id = #{skuId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="itemQty != null">
|
|
|
|
|
+ AND tppi.item_qty = #{itemQty}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="priceStd != null">
|
|
|
|
|
+ AND tppi.price_std = #{priceStd}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="amtStd != null">
|
|
|
|
|
+ AND tppi.amt_std = #{amtStd}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="pricePur != null">
|
|
|
|
|
+ AND tppi.price_pur = #{pricePur}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="itemAmt != null">
|
|
|
|
|
+ AND tppi.item_amt = #{itemAmt}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="priceDiscount != null">
|
|
|
|
|
+ AND tppi.price_discount = #{priceDiscount}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="nonStdCode != null and nonStdCode != ''">
|
|
|
|
|
+ AND tppi.non_std_code = #{nonStdCode}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="intoStatus != null and intoStatus != ''">
|
|
|
|
|
+ AND tppi.into_status = #{intoStatus}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="intoingQty != null">
|
|
|
|
|
+ AND tppi.intoing_qty = #{intoingQty}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="intoingAmt != null">
|
|
|
|
|
+ AND tppi.intoing_amt = #{intoingAmt}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="intoQty != null">
|
|
|
|
|
+ AND tppi.into_qty = #{intoQty}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="intoAmt != null">
|
|
|
|
|
+ AND tppi.into_amt = #{intoAmt}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="returnQty != null">
|
|
|
|
|
+ AND tppi.return_qty = #{returnQty}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="returnAmt != null">
|
|
|
|
|
+ AND tppi.return_amt = #{returnAmt}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="remarks != null and remarks != ''">
|
|
|
|
|
+ AND tppi.remarks = #{remarks}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="flgValid != null">
|
|
|
|
|
+ AND tppi.flg_valid = #{flgValid}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="cpId != null">
|
|
|
|
|
+ AND tppi.cp_id = #{cpId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="opCreateTime != null">
|
|
|
|
|
+ AND tppi.op_create_time = #{opCreateTime}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="opCreateUserId != null and opCreateUserId != ''">
|
|
|
|
|
+ AND tppi.op_create_user_id = #{opCreateUserId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="opUpdateTime != null">
|
|
|
|
|
+ AND tppi.op_update_time = #{opUpdateTime}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="opUpdateUserId != null and opUpdateUserId != ''">
|
|
|
|
|
+ AND tppi.op_update_user_id = #{opUpdateUserId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="opAppCode != null and opAppCode != ''">
|
|
|
|
|
+ AND tppi.op_app_code = #{opAppCode}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="opTimestamp != null">
|
|
|
|
|
+ AND tppi.op_timestamp = #{opTimestamp}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="opDbUser != null and opDbUser != ''">
|
|
|
|
|
+ AND tppi.op_db_user = #{opDbUser}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </where>
|
|
|
|
|
+ </sql>
|
|
|
|
|
+
|
|
|
<sql id="idsForeach">
|
|
<sql id="idsForeach">
|
|
|
<!-- 根据主键itemId批量操作 -->
|
|
<!-- 根据主键itemId批量操作 -->
|
|
|
WHERE item_id in
|
|
WHERE item_id in
|
|
@@ -138,9 +256,13 @@
|
|
|
<!-- 查询表dkic_b.t_psi_purchase_item,(条件查询+分页)列表 -->
|
|
<!-- 查询表dkic_b.t_psi_purchase_item,(条件查询+分页)列表 -->
|
|
|
<select id="selectByCond" resultMap="BaseResultMap">
|
|
<select id="selectByCond" resultMap="BaseResultMap">
|
|
|
SELECT
|
|
SELECT
|
|
|
- <include refid="Base_Column_List"/>
|
|
|
|
|
- FROM dkic_b.t_psi_purchase_item
|
|
|
|
|
- <include refid="Condition"/>
|
|
|
|
|
|
|
+ <include refid="Base_Column_List_1"/>
|
|
|
|
|
+ ,tmgs.sku_code as "skuCode"
|
|
|
|
|
+ ,tmgs.sku_model as "skuModel"
|
|
|
|
|
+ ,tmgs.sku_name as "skuName"
|
|
|
|
|
+ FROM dkic_b.t_psi_purchase_item tppi
|
|
|
|
|
+ left join dkic_b.t_mst_goods_sku tmgs on tppi.sku_id = tmgs.sku_id
|
|
|
|
|
+ <include refid="Condition_1"/>
|
|
|
<if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
|
|
<if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
|
|
|
limit #{end} offset #{start}
|
|
limit #{end} offset #{start}
|
|
|
</if>
|
|
</if>
|