|
|
@@ -0,0 +1,157 @@
|
|
|
+<?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.dk.mdm.mapper.mac.RecPayHandleItemMapper">
|
|
|
+
|
|
|
+ <!-- 通用设置 -->
|
|
|
+ <!-- 通用查询列 -->
|
|
|
+ <sql id="Base_Column_List">
|
|
|
+ item_id, rp_id, acc_item_id, amt_receivable_handle, amt_payable_handle, amt_waive, acc_date, remarks, flg_valid, cp_id
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <!-- 通用查询映射结果 -->
|
|
|
+ <resultMap id="BaseResultMap" type="com.dk.mdm.model.pojo.mac.RecPayHandleItem">
|
|
|
+ <id column="item_id" property="itemId"/>
|
|
|
+ <result column="rp_id" property="rpId" typeHandler="UuidTypeHandler"/>
|
|
|
+ <result column="acc_item_id" property="accItemId" typeHandler="UuidTypeHandler"/>
|
|
|
+ <result column="amt_receivable_handle" property="amtReceivableHandle"/>
|
|
|
+ <result column="amt_payable_handle" property="amtPayableHandle"/>
|
|
|
+ <result column="amt_waive" property="amtWaive"/>
|
|
|
+ <result column="acc_date" property="accDate" typeHandler="TimestampTypeHandler"/>
|
|
|
+ <result column="remarks" property="remarks"/>
|
|
|
+ <result column="flg_valid" property="flgValid"/>
|
|
|
+ <result column="cp_id" property="cpId"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <!-- 通用查询映射结果 -->
|
|
|
+ <resultMap id="BaseResultMapResponse" type="com.dk.mdm.model.response.mac.RecPayHandleItemResponse">
|
|
|
+ <id column="item_id" property="itemId"/>
|
|
|
+ <result column="rp_id" property="rpId" typeHandler="UuidTypeHandler"/>
|
|
|
+ <result column="acc_item_id" property="accItemId" typeHandler="UuidTypeHandler"/>
|
|
|
+ <result column="amt_receivable_handle" property="amtReceivableHandle"/>
|
|
|
+ <result column="amt_payable_handle" property="amtPayableHandle"/>
|
|
|
+ <result column="amt_waive" property="amtWaive"/>
|
|
|
+ <result column="acc_date" property="accDate" typeHandler="TimestampTypeHandler"/>
|
|
|
+ <result column="remarks" property="remarks"/>
|
|
|
+ <result column="flg_valid" property="flgValid"/>
|
|
|
+ <result column="cp_id" property="cpId"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <!-- 通用条件列 -->
|
|
|
+ <sql id="Condition">
|
|
|
+ <where>
|
|
|
+ <if test="rpId != null and rpId != ''">
|
|
|
+ AND rp_id = #{rpId}
|
|
|
+ </if>
|
|
|
+ <if test="accItemId != null and accItemId != ''">
|
|
|
+ AND acc_item_id = #{accItemId}
|
|
|
+ </if>
|
|
|
+ <if test="amtReceivableHandle != null">
|
|
|
+ AND amt_receivable_handle = #{amtReceivableHandle}
|
|
|
+ </if>
|
|
|
+ <if test="amtPayableHandle != null">
|
|
|
+ AND amt_payable_handle = #{amtPayableHandle}
|
|
|
+ </if>
|
|
|
+ <if test="amtWaive != null">
|
|
|
+ AND amt_waive = #{amtWaive}
|
|
|
+ </if>
|
|
|
+ <if test="accDate != null">
|
|
|
+ AND acc_date = #{accDate}
|
|
|
+ </if>
|
|
|
+ <if test="remarks != null and remarks != ''">
|
|
|
+ AND remarks = #{remarks}
|
|
|
+ </if>
|
|
|
+ <if test="flgValid != null">
|
|
|
+ AND flg_valid = #{flgValid}
|
|
|
+ </if>
|
|
|
+ <if test="cpId != null">
|
|
|
+ AND cp_id = #{cpId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <sql id="idsForeach">
|
|
|
+ <!-- 根据主键itemId批量操作 -->
|
|
|
+ WHERE item_id in
|
|
|
+ <foreach collection="ids" index="index" item="item" separator="," open="(" close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <!-- 查询表t_mac_rec_pay_handle_item,(条件查询+分页)列表 -->
|
|
|
+ <select id="selectByCond" resultMap="BaseResultMapResponse">
|
|
|
+ SELECT
|
|
|
+ <include refid="Base_Column_List"/>
|
|
|
+ FROM t_mac_rec_pay_handle_item
|
|
|
+ <include refid="Condition"/>
|
|
|
+ <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
|
|
|
+ limit #{end} offset #{start}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 查询表t_mac_rec_pay_handle_item,(条件查询)个数 -->
|
|
|
+ <select id="countByCond" resultType="Long">
|
|
|
+ SELECT
|
|
|
+ count(1)
|
|
|
+ FROM t_mac_rec_pay_handle_item
|
|
|
+ <include refid="Condition"/>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 根据主键查询表t_mac_rec_pay_handle_item的一行数据 -->
|
|
|
+ <select id="selectById" resultMap="BaseResultMapResponse">
|
|
|
+ SELECT
|
|
|
+ <include refid="Base_Column_List"/>
|
|
|
+ FROM t_mac_rec_pay_handle_item
|
|
|
+ WHERE item_id = #{itemId}::uuid
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 根据主键锁定表t_mac_rec_pay_handle_item的一行数据 -->
|
|
|
+ <select id="selectByIdForUpdate" resultMap="BaseResultMap">
|
|
|
+ SELECT
|
|
|
+ <include refid="Base_Column_List"/>
|
|
|
+ FROM t_mac_rec_pay_handle_item
|
|
|
+ WHERE item_id = #{id}::uuid
|
|
|
+ for update
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 根据主键锁定表t_mac_rec_pay_handle_item的多行数据 -->
|
|
|
+ <select id="selectByIdsForUpdate" resultMap="BaseResultMap">
|
|
|
+ SELECT
|
|
|
+ <include refid="Base_Column_List"/>
|
|
|
+ FROM t_mac_rec_pay_handle_item
|
|
|
+ <include refid="idsForeach"/>
|
|
|
+ for update
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertBatch">
|
|
|
+ insert into t_mac_rec_pay_handle_item
|
|
|
+ (
|
|
|
+ <trim suffixOverrides=",">
|
|
|
+ rp_id,
|
|
|
+ acc_item_id,
|
|
|
+ amt_receivable_handle,
|
|
|
+ amt_payable_handle,
|
|
|
+ amt_waive,
|
|
|
+ acc_date,
|
|
|
+ remarks,
|
|
|
+ cp_id,
|
|
|
+ op_app_code,
|
|
|
+ </trim>
|
|
|
+ )
|
|
|
+ values
|
|
|
+ <foreach collection="list" index="index" item="item" separator=",">
|
|
|
+ (
|
|
|
+ <trim suffixOverrides=",">
|
|
|
+ #{item.rpId}::uuid,
|
|
|
+ #{item.accItemId}::uuid,
|
|
|
+ #{item.amtReceivableHandle},
|
|
|
+ #{item.amtPayableHandle},
|
|
|
+ #{item.amtWaive},
|
|
|
+ #{item.accDate},
|
|
|
+ #{item.remarks},
|
|
|
+ #{item.cpId},
|
|
|
+ #{item.opAppCode},
|
|
|
+ </trim>
|
|
|
+ )
|
|
|
+ </foreach>
|
|
|
+ </insert>
|
|
|
+</mapper>
|