|
|
@@ -9,7 +9,7 @@
|
|
|
</sql>
|
|
|
|
|
|
<!-- 通用查询映射结果 -->
|
|
|
- <resultMap id="BaseResultMap" type="com.dk.mdm.model.pojo.mst.MoneyAccount">
|
|
|
+ <resultMap id="BaseResultMap" type="com.dk.mdm.model.response.mst.MoneyAccountResponse">
|
|
|
<id column="mac_id" property="macId"/>
|
|
|
<result column="mac_code" property="macCode"/>
|
|
|
<result column="mac_name" property="macName"/>
|
|
|
@@ -34,55 +34,37 @@
|
|
|
<sql id="Condition">
|
|
|
<where>
|
|
|
<if test="macCode != null and macCode != ''">
|
|
|
- AND mac_code = #{macCode}
|
|
|
+ AND ma.mac_code = #{macCode}
|
|
|
</if>
|
|
|
<if test="macName != null and macName != ''">
|
|
|
- AND mac_name = #{macName}
|
|
|
- </if>
|
|
|
- <if test="macType != null and macType != ''">
|
|
|
- AND mac_type = #{macType}
|
|
|
- </if>
|
|
|
- <if test="balance != null">
|
|
|
- AND balance = #{balance}
|
|
|
- </if>
|
|
|
- <if test="displayNo != null">
|
|
|
- AND display_no = #{displayNo}
|
|
|
- </if>
|
|
|
- <if test="flgDefault != null">
|
|
|
- AND flg_default = #{flgDefault}
|
|
|
- </if>
|
|
|
- <if test="macReceiptCode != null and macReceiptCode != ''">
|
|
|
- AND mac_receipt_code = #{macReceiptCode}
|
|
|
+ AND ma.mac_name = #{macName}
|
|
|
</if>
|
|
|
<if test="remarks != null and remarks != ''">
|
|
|
- AND remarks = #{remarks}
|
|
|
- </if>
|
|
|
- <if test="flgValid != null">
|
|
|
- AND flg_valid = #{flgValid}
|
|
|
+ AND ma.remarks = #{remarks}
|
|
|
</if>
|
|
|
<if test="cpId != null">
|
|
|
- AND cp_id = #{cpId}
|
|
|
+ AND ma.cp_id = #{cpId}
|
|
|
</if>
|
|
|
<if test="opCreateTime != null">
|
|
|
- AND op_create_time = #{opCreateTime}
|
|
|
+ AND ma.op_create_time = #{opCreateTime}
|
|
|
</if>
|
|
|
<if test="opCreateUserId != null and opCreateUserId != ''">
|
|
|
- AND op_create_user_id = #{opCreateUserId}
|
|
|
+ AND ma.op_create_user_id = #{opCreateUserId}
|
|
|
</if>
|
|
|
<if test="opUpdateTime != null">
|
|
|
- AND op_update_time = #{opUpdateTime}
|
|
|
+ AND ma.op_update_time = #{opUpdateTime}
|
|
|
</if>
|
|
|
<if test="opUpdateUserId != null and opUpdateUserId != ''">
|
|
|
- AND op_update_user_id = #{opUpdateUserId}
|
|
|
- </if>
|
|
|
- <if test="opAppCode != null and opAppCode != ''">
|
|
|
- AND op_app_code = #{opAppCode}
|
|
|
+ AND ma.op_update_user_id = #{opUpdateUserId}
|
|
|
</if>
|
|
|
<if test="opTimestamp != null">
|
|
|
- AND op_timestamp = #{opTimestamp}
|
|
|
+ AND ma.op_timestamp = #{opTimestamp}
|
|
|
</if>
|
|
|
- <if test="opDbUser != null and opDbUser != ''">
|
|
|
- AND op_db_user = #{opDbUser}
|
|
|
+ <if test="flgValidList != null and flgValidList.size>0">
|
|
|
+ AND ma.flg_valid =any(#{flgValidList, typeHandler=BooleanListTypeHandler})
|
|
|
+ </if>
|
|
|
+ <if test="macTypeList != null and macTypeList.size() > 0">
|
|
|
+ AND ma.mac_Type =any(#{macTypeList, typeHandler=UuidListTypeHandler})
|
|
|
</if>
|
|
|
</where>
|
|
|
</sql>
|
|
|
@@ -97,9 +79,12 @@
|
|
|
|
|
|
<!-- 查询表t_mst_money_account,(条件查询+分页)列表 -->
|
|
|
<select id="selectByCond" resultMap="BaseResultMap">
|
|
|
- SELECT
|
|
|
- <include refid="Base_Column_List"/>
|
|
|
- FROM t_mst_money_account
|
|
|
+ SELECT ma.mac_Type,ma.mac_code,ma.mac_name,ma.remarks
|
|
|
+ ,ma.cp_id,ma.flg_valid
|
|
|
+ ,dd.data_value AS "macTypeName"
|
|
|
+ ,ma.mac_id,ma.balance,ma.display_no
|
|
|
+ FROM dkic_b.t_mst_money_account ma
|
|
|
+ left join dkic_b.t_mst_dictionary_data dd on ma.mac_type=dd.data_id
|
|
|
<include refid="Condition"/>
|
|
|
<if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
|
|
|
limit #{end} offset #{start}
|
|
|
@@ -110,68 +95,12 @@
|
|
|
<select id="countByCond" resultType="Long">
|
|
|
SELECT
|
|
|
count(1)
|
|
|
- FROM t_mst_money_account
|
|
|
+ FROM dkic_b.t_mst_money_account ma
|
|
|
<include refid="Condition"/>
|
|
|
</select>
|
|
|
|
|
|
- <!-- 根据主键查询表t_mst_money_account的一行数据 -->
|
|
|
- <select id="selectById" resultMap="BaseResultMap">
|
|
|
- SELECT
|
|
|
- <include refid="Base_Column_List"/>
|
|
|
- FROM t_mst_money_account
|
|
|
- WHERE mac_id = #{macId}::uuid
|
|
|
+ <select id="selectDisplayNo" resultType="Integer">
|
|
|
+ SELECT MAX(display_no) + 1 FROM dkic_b.t_mst_money_account ma
|
|
|
+ WHERE ma.cp_id = #{cpId}
|
|
|
</select>
|
|
|
-
|
|
|
- <!-- 根据主键锁定表t_mst_money_account的一行数据 -->
|
|
|
- <select id="selectByIdForUpdate" resultMap="BaseResultMap">
|
|
|
- SELECT
|
|
|
- <include refid="Base_Column_List"/>
|
|
|
- FROM t_mst_money_account
|
|
|
- WHERE mac_id = #{macId}
|
|
|
- for update
|
|
|
- </select>
|
|
|
-
|
|
|
- <!-- 根据主键锁定表t_mst_money_account的多行数据 -->
|
|
|
- <select id="selectByIdsForUpdate" resultMap="BaseResultMap">
|
|
|
- SELECT
|
|
|
- <include refid="Base_Column_List"/>
|
|
|
- FROM t_mst_money_account
|
|
|
- <include refid="idsForeach"/>
|
|
|
- for update
|
|
|
- </select>
|
|
|
-
|
|
|
- <insert id="insertBatch">
|
|
|
- insert into t_mst_money_account
|
|
|
- (
|
|
|
- <trim suffixOverrides=",">
|
|
|
- mac_code,
|
|
|
- mac_name,
|
|
|
- mac_type,
|
|
|
- balance,
|
|
|
- display_no,
|
|
|
- flg_default,
|
|
|
- mac_receipt_code,
|
|
|
- remarks,
|
|
|
- cp_id,
|
|
|
- op_app_code,
|
|
|
- </trim>
|
|
|
- )
|
|
|
- values
|
|
|
- <foreach collection="list" index="index" item="item" separator=",">
|
|
|
- (
|
|
|
- <trim suffixOverrides=",">
|
|
|
- #{item.macCode},
|
|
|
- #{item.macName},
|
|
|
- #{item.macType}::uuid,
|
|
|
- #{item.balance},
|
|
|
- #{item.displayNo},
|
|
|
- #{item.flgDefault},
|
|
|
- #{item.macReceiptCode},
|
|
|
- #{item.remarks},
|
|
|
- #{item.cpId},
|
|
|
- #{item.opAppCode},
|
|
|
- </trim>
|
|
|
- )
|
|
|
- </foreach>
|
|
|
- </insert>
|
|
|
</mapper>
|