|
|
@@ -5,7 +5,11 @@
|
|
|
<!-- 通用设置 -->
|
|
|
<!-- 通用查询列 -->
|
|
|
<sql id="Base_Column_List">
|
|
|
- freeze_id, freeze_no, cus_id, org_id, staff_id, freeze_status, freeze_date, auto_unfreeze_date, sum_quantity, remarks, make_staff, make_time, 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
|
|
|
+ fre.freeze_id,fre.freeze_no,fre.cus_id,fre.org_id,fre.staff_id
|
|
|
+ ,sys.f_get_name_i18n(tdk.kind_name_i18n,'zh_CN' ) AS "freezeStatusName"
|
|
|
+ ,fre.freeze_date,fre.auto_unfreeze_date ,fre.sum_quantity, fre.remarks, fre.make_staff
|
|
|
+ , fre.make_time, fre.flg_valid,fre.cp_id,cus.cus_phone
|
|
|
+ ,cus.cus_name,staff.staff_name,org.org_name,mstaff.staff_name AS "makeStaffName"
|
|
|
</sql>
|
|
|
|
|
|
<!-- 通用查询映射结果 -->
|
|
|
@@ -37,64 +41,46 @@
|
|
|
<sql id="Condition">
|
|
|
<where>
|
|
|
<if test="freezeNo != null and freezeNo != ''">
|
|
|
- AND freeze_no = #{freezeNo}
|
|
|
+ AND fre.freeze_no LIKE concat('%',my_ex.likequery(#{freezeNo}),'%')
|
|
|
</if>
|
|
|
<if test="cusId != null and cusId != ''">
|
|
|
- AND cus_id = #{cusId}
|
|
|
+ AND fre.cus_id = #{cusId}
|
|
|
</if>
|
|
|
<if test="orgId != null and orgId != ''">
|
|
|
- AND org_id = #{orgId}
|
|
|
+ AND fre.org_id = #{orgId}
|
|
|
</if>
|
|
|
<if test="staffId != null and staffId != ''">
|
|
|
- AND staff_id = #{staffId}
|
|
|
+ AND fre.staff_id = #{staffId}
|
|
|
</if>
|
|
|
<if test="freezeStatus != null and freezeStatus != ''">
|
|
|
- AND freeze_status = #{freezeStatus}
|
|
|
+ AND fre.freeze_status = #{freezeStatus}
|
|
|
</if>
|
|
|
<if test="freezeDate != null">
|
|
|
- AND freeze_date = #{freezeDate}
|
|
|
+ AND fre.freeze_date = #{freezeDate}
|
|
|
</if>
|
|
|
<if test="autoUnfreezeDate != null">
|
|
|
- AND auto_unfreeze_date = #{autoUnfreezeDate}
|
|
|
- </if>
|
|
|
- <if test="sumQuantity != null">
|
|
|
- AND sum_quantity = #{sumQuantity}
|
|
|
+ AND fre.auto_unfreeze_date = #{autoUnfreezeDate}
|
|
|
</if>
|
|
|
<if test="remarks != null and remarks != ''">
|
|
|
- AND remarks = #{remarks}
|
|
|
- </if>
|
|
|
- <if test="makeStaff != null and makeStaff != ''">
|
|
|
- AND make_staff = #{makeStaff}
|
|
|
- </if>
|
|
|
- <if test="makeTime != null">
|
|
|
- AND make_time = #{makeTime}
|
|
|
- </if>
|
|
|
- <if test="flgValid != null">
|
|
|
- AND flg_valid = #{flgValid}
|
|
|
+ AND fre.remarks = #{remarks}
|
|
|
</if>
|
|
|
<if test="cpId != null">
|
|
|
- AND cp_id = #{cpId}
|
|
|
- </if>
|
|
|
- <if test="opCreateTime != null">
|
|
|
- AND op_create_time = #{opCreateTime}
|
|
|
- </if>
|
|
|
- <if test="opCreateUserId != null and opCreateUserId != ''">
|
|
|
- AND op_create_user_id = #{opCreateUserId}
|
|
|
+ AND fre.cp_id = #{cpId}
|
|
|
</if>
|
|
|
- <if test="opUpdateTime != null">
|
|
|
- AND op_update_time = #{opUpdateTime}
|
|
|
+ <if test="flgValidList != null and flgValidList.size>0">
|
|
|
+ AND fre.flg_valid =any(#{flgValidList, typeHandler=BooleanListTypeHandler})
|
|
|
</if>
|
|
|
- <if test="opUpdateUserId != null and opUpdateUserId != ''">
|
|
|
- AND op_update_user_id = #{opUpdateUserId}
|
|
|
+ <if test="orgIdList != null and orgIdList.size>0">
|
|
|
+ AND fre.org_id = any(#{orgIdList, typeHandler=UuidListTypeHandler})
|
|
|
</if>
|
|
|
- <if test="opAppCode != null and opAppCode != ''">
|
|
|
- AND op_app_code = #{opAppCode}
|
|
|
+ <if test="staffIdList != null and staffIdList.size>0">
|
|
|
+ AND fre.staff_id = any(#{staffIdList, typeHandler=UuidListTypeHandler})
|
|
|
</if>
|
|
|
- <if test="opTimestamp != null">
|
|
|
- AND op_timestamp = #{opTimestamp}
|
|
|
+ <if test="cusName != null and cusName != ''">
|
|
|
+ AND cus.cus_name LIKE concat('%',my_ex.likequery(#{cusName}),'%')
|
|
|
</if>
|
|
|
- <if test="opDbUser != null and opDbUser != ''">
|
|
|
- AND op_db_user = #{opDbUser}
|
|
|
+ <if test="freezeStatusList != null and freezeStatusList.size() > 0">
|
|
|
+ AND fre.freeze_status = any(#{freezeStatusList, typeHandler=UuidListTypeHandler})
|
|
|
</if>
|
|
|
</where>
|
|
|
</sql>
|
|
|
@@ -103,7 +89,12 @@
|
|
|
<select id="selectByCond" resultMap="BaseResultMap">
|
|
|
SELECT
|
|
|
<include refid="Base_Column_List"/>
|
|
|
- FROM dkic_b.t_psi_freeze
|
|
|
+ FROM dkic_b.t_psi_freeze AS fre
|
|
|
+ lEFT JOIN dkic_b.t_mst_customer AS cus ON cus.cus_id=fre.cus_id
|
|
|
+ lEFT JOIN dkic_b.t_mst_staff AS staff ON staff.staff_id=fre.staff_id
|
|
|
+ lEFT JOIN dkic_b.t_mst_org AS org ON org.org_id=fre.org_id
|
|
|
+ lEFT JOIN dkic_b.t_mst_staff AS mstaff ON mstaff.staff_id=fre.make_staff
|
|
|
+ LEFT JOIN sys.t_data_kind AS tdk ON tdk.kind_code = fre.freeze_status
|
|
|
<include refid="Condition"/>
|
|
|
<if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
|
|
|
limit #{end} offset #{start}
|
|
|
@@ -114,7 +105,7 @@
|
|
|
<select id="countByCond" resultType="Long">
|
|
|
SELECT
|
|
|
count(1)
|
|
|
- FROM dkic_b.t_psi_freeze
|
|
|
+ FROM dkic_b.t_psi_freeze AS fre
|
|
|
<include refid="Condition"/>
|
|
|
</select>
|
|
|
|
|
|
@@ -122,8 +113,13 @@
|
|
|
<select id="selectById" resultMap="BaseResultMap">
|
|
|
SELECT
|
|
|
<include refid="Base_Column_List"/>
|
|
|
- FROM dkic_b.t_psi_freeze
|
|
|
- WHERE freeze_id = #{freezeId}::uuid
|
|
|
+ FROM dkic_b.t_psi_freeze AS fre
|
|
|
+ lEFT JOIN dkic_b.t_mst_customer AS cus ON cus.cus_id=fre.cus_id
|
|
|
+ lEFT JOIN dkic_b.t_mst_staff AS staff ON staff.staff_id=fre.staff_id
|
|
|
+ lEFT JOIN dkic_b.t_mst_org AS org ON org.org_id=fre.org_id
|
|
|
+ lEFT JOIN dkic_b.t_mst_staff AS mstaff ON mstaff.staff_id=fre.make_staff
|
|
|
+ LEFT JOIN sys.t_data_kind AS tdk ON tdk.kind_code = fre.freeze_status
|
|
|
+ WHERE fre.freeze_id = #{freezeId}::uuid
|
|
|
</select>
|
|
|
|
|
|
|