|
@@ -5,11 +5,12 @@
|
|
|
<!-- 通用设置 -->
|
|
<!-- 通用设置 -->
|
|
|
<!-- 通用查询列 -->
|
|
<!-- 通用查询列 -->
|
|
|
<sql id="Base_Column_List">
|
|
<sql id="Base_Column_List">
|
|
|
- send_id,cp_id, coupon_id, send_date, end_date, user_num, flg_valid
|
|
|
|
|
|
|
+ send_id,cp_id, coupon_id, send_date, end_date, user_num, flg_valid,send_staff,send_user
|
|
|
</sql>
|
|
</sql>
|
|
|
<!-- 通用查询列Response -->
|
|
<!-- 通用查询列Response -->
|
|
|
<sql id="Base_Column_List_Response">
|
|
<sql id="Base_Column_List_Response">
|
|
|
- tmcs.send_id,tmcs.cp_id, tmcs.coupon_id, tmcs.send_date, tmcs.end_date, tmcs.user_num, tmcs.flg_valid
|
|
|
|
|
|
|
+ tmcs.send_id,tmcs.cp_id, tmcs.coupon_id, tmcs.send_date, tmcs.end_date, tmcs.user_num,
|
|
|
|
|
+ tmcs.flg_valid,tmcs.send_staff,tmcs.send_user
|
|
|
</sql>
|
|
</sql>
|
|
|
|
|
|
|
|
<!-- 通用查询映射结果 -->
|
|
<!-- 通用查询映射结果 -->
|
|
@@ -21,6 +22,9 @@
|
|
|
<result column="end_date" property="endDate" typeHandler="TimestampTypeHandler"/>
|
|
<result column="end_date" property="endDate" typeHandler="TimestampTypeHandler"/>
|
|
|
<result column="user_num" property="userNum"/>
|
|
<result column="user_num" property="userNum"/>
|
|
|
<result column="flg_valid" property="flgValid"/>
|
|
<result column="flg_valid" property="flgValid"/>
|
|
|
|
|
+ <result column="send_staff" property="sendStaff"/>
|
|
|
|
|
+ <result column="send_user" property="sendUser" typeHandler="UuidTypeHandler"/>
|
|
|
|
|
+
|
|
|
</resultMap>
|
|
</resultMap>
|
|
|
<!-- 通用查询映射结果 -->
|
|
<!-- 通用查询映射结果 -->
|
|
|
<resultMap id="BaseResultMapResponse" type="com.dk.oauth.model.response.integral.CouponSendResponse">
|
|
<resultMap id="BaseResultMapResponse" type="com.dk.oauth.model.response.integral.CouponSendResponse">
|
|
@@ -33,6 +37,9 @@
|
|
|
<result column="flg_valid" property="flgValid"/>
|
|
<result column="flg_valid" property="flgValid"/>
|
|
|
<result column="cp_name" property="cpName"/>
|
|
<result column="cp_name" property="cpName"/>
|
|
|
<result column="coupon_name" property="couponName"/>
|
|
<result column="coupon_name" property="couponName"/>
|
|
|
|
|
+ <result column="send_staff" property="sendStaff"/>
|
|
|
|
|
+ <result column="coupon_receive_count" property="couponReceiveCount"/>
|
|
|
|
|
+ <result column="send_user" property="sendUser" typeHandler="UuidTypeHandler"/>
|
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
|
|
<!-- 通用条件列 -->
|
|
<!-- 通用条件列 -->
|
|
@@ -42,7 +49,7 @@
|
|
|
AND tmcs.cp_id = #{cpId}
|
|
AND tmcs.cp_id = #{cpId}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="couponId != null and couponId != ''">
|
|
<if test="couponId != null and couponId != ''">
|
|
|
- AND tmcs.coupon_id = #{couponId}
|
|
|
|
|
|
|
+ AND tmcs.coupon_id = #{couponId}::uuid
|
|
|
</if>
|
|
</if>
|
|
|
<if test="sendDate != null">
|
|
<if test="sendDate != null">
|
|
|
AND tmcs.send_date = #{sendDate}
|
|
AND tmcs.send_date = #{sendDate}
|
|
@@ -62,6 +69,10 @@
|
|
|
<if test="couponName != null and couponName != ''">
|
|
<if test="couponName != null and couponName != ''">
|
|
|
AND tmc.coupon_name LIKE concat('%',my_ex.likequery(#{couponName}),'%')
|
|
AND tmc.coupon_name LIKE concat('%',my_ex.likequery(#{couponName}),'%')
|
|
|
</if>
|
|
</if>
|
|
|
|
|
+ <if test="sendUser != null and sendUser != ''">
|
|
|
|
|
+ AND tmcs.send_user = #{sendUser}::uuid
|
|
|
|
|
+ </if>
|
|
|
|
|
+
|
|
|
</where>
|
|
</where>
|
|
|
</sql>
|
|
</sql>
|
|
|
|
|
|
|
@@ -88,6 +99,24 @@
|
|
|
</if>
|
|
</if>
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
|
|
+ <!-- 查询表dkic_a.t_mst_coupon_send,(条件查询+分页)列表 -->
|
|
|
|
|
+ <select id="selectByCondHistory" resultMap="BaseResultMapResponse">
|
|
|
|
|
+ SELECT
|
|
|
|
|
+ <include refid="Base_Column_List_Response"/>
|
|
|
|
|
+ ,tac.cp_name
|
|
|
|
|
+ ,tmc.coupon_name
|
|
|
|
|
+ ,(select count(tmcr.send_id) from dkic_a.t_mst_coupon_receive tmcr where tmcr.send_id = tmcs.send_id ) coupon_receive_count
|
|
|
|
|
+ FROM dkic_a.t_mst_coupon_send tmcs
|
|
|
|
|
+ left join dkic_a.t_a_company tac on tac.cp_id = tmcs.cp_id
|
|
|
|
|
+ left join dkic_a.t_mst_coupon tmc on tmc.coupon_id = tmcs.coupon_id
|
|
|
|
|
+ <include refid="Condition"/>
|
|
|
|
|
+ order by tmcs.send_date desc
|
|
|
|
|
+ <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
|
|
|
|
|
+ limit #{end} offset #{start}
|
|
|
|
|
+ </if>
|
|
|
|
|
+
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
<!-- 查询表dkic_a.t_mst_coupon_send,(条件查询)个数 -->
|
|
<!-- 查询表dkic_a.t_mst_coupon_send,(条件查询)个数 -->
|
|
|
<select id="countByCond" resultType="Long">
|
|
<select id="countByCond" resultType="Long">
|
|
|
SELECT
|
|
SELECT
|
|
@@ -105,7 +134,7 @@
|
|
|
FROM dkic_a.t_mst_coupon_send tmcs
|
|
FROM dkic_a.t_mst_coupon_send tmcs
|
|
|
left join dkic_a.t_a_company tac on tac.cp_id = tmcs.cp_id
|
|
left join dkic_a.t_a_company tac on tac.cp_id = tmcs.cp_id
|
|
|
left join dkic_a.t_mst_coupon tmc on tmc.coupon_id = tmcs.coupon_id
|
|
left join dkic_a.t_mst_coupon tmc on tmc.coupon_id = tmcs.coupon_id
|
|
|
- WHERE cp_id = #{id}
|
|
|
|
|
|
|
+ WHERE tmcs.send_id = #{sendId}::uuid
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
<!-- 根据主键锁定表dkic_a.t_mst_coupon_send的一行数据 -->
|
|
<!-- 根据主键锁定表dkic_a.t_mst_coupon_send的一行数据 -->
|
|
@@ -113,7 +142,7 @@
|
|
|
SELECT
|
|
SELECT
|
|
|
<include refid="Base_Column_List"/>
|
|
<include refid="Base_Column_List"/>
|
|
|
FROM dkic_a.t_mst_coupon_send
|
|
FROM dkic_a.t_mst_coupon_send
|
|
|
- WHERE send_id = #{sendId}
|
|
|
|
|
|
|
+ WHERE send_id = #{sendId}::uuid
|
|
|
for update
|
|
for update
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|