|
|
|
@@ -17,11 +17,13 @@ |
|
|
|
<result column="card_before_real_amount" jdbcType="INTEGER" property="cardBeforeRealAmount" /> |
|
|
|
<result column="create_date" jdbcType="TIMESTAMP" property="createDate" /> |
|
|
|
<result column="update_date" jdbcType="TIMESTAMP" property="updateDate" /> |
|
|
|
<result column="pay_status" jdbcType="INTEGER" property="payStatus" /> |
|
|
|
</resultMap> |
|
|
|
|
|
|
|
<sql id="allColumns"> |
|
|
|
`id`,`tenant_id`,`card_id`,`owner_id`,`merchant_id`,`order_id`,`deduction_amount`,`payment`,`real_payment`, |
|
|
|
`card_remain_amount`,`card_before_amount`,`card_remain_real_amount`,`card_before_real_amount`,`create_date`,`update_date` |
|
|
|
`card_remain_amount`,`card_before_amount`,`card_remain_real_amount`,`card_before_real_amount`, |
|
|
|
`create_date`,`update_date`, `pay_status` |
|
|
|
</sql> |
|
|
|
|
|
|
|
<sql id="dynamicWhereConditions"> |
|
|
|
@@ -71,6 +73,9 @@ |
|
|
|
<if test=" null != updateDate "> |
|
|
|
and `update_date` = #{updateDate} |
|
|
|
</if> |
|
|
|
<if test=" null != status "> |
|
|
|
and `pay_status` = #{payStatus} |
|
|
|
</if> |
|
|
|
<if test=" null != startdate and null!=enddate"> |
|
|
|
and `create_date` between #{startdate} and #{enddate} |
|
|
|
</if> |
|
|
|
@@ -88,6 +93,12 @@ |
|
|
|
<include refid="dynamicWhereConditions" /> |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="updateByCond" parameterType="com.iformall.domain.po.WxCardSpend" resultMap="BaseResultMap"> |
|
|
|
update wx_card_spend |
|
|
|
set `pay_status` = #{payStatus} |
|
|
|
<include refid="dynamicWhereConditions" /> |
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
<resultMap id="VoResultMap" type="com.iformall.domain.vo.WxCardSpendVo"> |
|
|
|
<id column="id" jdbcType="BIGINT" property="id" /> |
|
|
|
@@ -105,6 +116,7 @@ |
|
|
|
<result column="card_before_real_amount" jdbcType="INTEGER" property="cardBeforeRealAmount" /> |
|
|
|
<result column="create_date" jdbcType="TIMESTAMP" property="createDate" /> |
|
|
|
<result column="update_date" jdbcType="TIMESTAMP" property="updateDate" /> |
|
|
|
<result column="pay_status" jdbcType="INTEGER" property="payStatus" /> |
|
|
|
|
|
|
|
<result column="title" jdbcType="VARCHAR" property="title"/> |
|
|
|
|
|
|
|
@@ -120,10 +132,11 @@ |
|
|
|
|
|
|
|
<sql id="allVoColumns"> |
|
|
|
cs.`id`,cs.`tenant_id`,cs.`card_id`,cs.`owner_id`,cs.`merchant_id`,cs.`order_id`,cs.`deduction_amount`,cs.`payment`,cs.`real_payment`, |
|
|
|
cs.`card_remain_amount`,cs.`card_before_amount`,cs.`card_remain_real_amount`,cs.`card_before_real_amount`,cs.`create_date`,cs.`update_date`, |
|
|
|
cs.`card_remain_amount`,cs.`card_before_amount`,cs.`card_remain_real_amount`,cs.`card_before_real_amount`, |
|
|
|
cs.`create_date`,cs.`update_date`, cs.`pay_status` |
|
|
|
m.`name`, c.`title`, |
|
|
|
ms.`subsidy`,ms.`real_subsidy`,ms.`status`, |
|
|
|
ou.`nick_name` as onick_name, ou.`phone` as ou_phone |
|
|
|
ou.`nick_name` as onick_name, ou.`phone` as ou_phone |
|
|
|
</sql> |
|
|
|
|
|
|
|
<sql id="dynamicVoWhereConditions"> |
|
|
|
@@ -173,6 +186,12 @@ |
|
|
|
<if test=" null != updateDate "> |
|
|
|
and cs.`update_date` = #{updateDate} |
|
|
|
</if> |
|
|
|
<if test=" null != payStatus "> |
|
|
|
and cs.`pay_status` = #{payStatus} |
|
|
|
</if> |
|
|
|
<if test=" null != status "> |
|
|
|
and ms.`status` = #{status} |
|
|
|
</if> |
|
|
|
<if test=" null != ouPhone "> |
|
|
|
and ou.`phone` = #{ouPhone} |
|
|
|
</if> |
|
|
|
@@ -203,7 +222,9 @@ |
|
|
|
select |
|
|
|
IFNULL(SUM(cs.`deduction_amount`),0) as sum_deduction_amount, |
|
|
|
IFNULL(SUM(cs.`payment`),0) as sum_payment, |
|
|
|
IFNULL(SUM(cs.`real_payment`),0) as sum_real_payment |
|
|
|
IFNULL(SUM(cs.`real_payment`),0) as sum_real_payment, |
|
|
|
IFNULL(SUM(ms.`subsidy`), 0) as sum_subsidy, |
|
|
|
IFNULL(SUM(ms.`real_subsidy`), 0) as sum_real_subsidy |
|
|
|
from wx_card_spend cs |
|
|
|
left join wx_coupon_order co on co.id = cs.card_id |
|
|
|
left join wx_coupon c on c.id = co.coupon_id |
|
|
|
|