|
|
|
@@ -84,6 +84,96 @@ |
|
|
|
select <include refid="allColumns" /> from wx_card_spend |
|
|
|
<include refid="dynamicWhereConditions" /> |
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
<resultMap id="VoResultMap" type="com.iformall.domain.po.WxCardSpendVo"> |
|
|
|
<id column="id" jdbcType="BIGINT" property="id" /> |
|
|
|
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId" /> |
|
|
|
<result column="card_id" jdbcType="BIGINT" property="cardId" /> |
|
|
|
<result column="owner_id" jdbcType="BIGINT" property="ownerId" /> |
|
|
|
<result column="merchant_id" jdbcType="BIGINT" property="merchantId" /> |
|
|
|
<result column="order_id" jdbcType="BIGINT" property="orderId" /> |
|
|
|
<result column="deduction_amount" jdbcType="INTEGER" property="deductionAmount" /> |
|
|
|
<result column="payment" jdbcType="INTEGER" property="payment" /> |
|
|
|
<result column="real_payment" jdbcType="INTEGER" property="realPayment" /> |
|
|
|
<result column="card_remain_amount" jdbcType="INTEGER" property="cardRemainAmount" /> |
|
|
|
<result column="card_before_amount" jdbcType="INTEGER" property="cardBeforeAmount" /> |
|
|
|
<result column="card_remain_real_amount" jdbcType="INTEGER" property="cardRemainRealAmount" /> |
|
|
|
<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="name" jdbcType="VARCHAR" property="merchantName"/> |
|
|
|
</resultMap> |
|
|
|
|
|
|
|
<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`, |
|
|
|
m.`name` |
|
|
|
</sql> |
|
|
|
|
|
|
|
<sql id="dynamicVoWhereConditions"> |
|
|
|
where 1 = 1 |
|
|
|
<if test=" null != id "> |
|
|
|
and cs.`id` = #{id} |
|
|
|
</if> |
|
|
|
<if test=" null != tenantId "> |
|
|
|
and cs.`tenant_id` = #{tenantId} |
|
|
|
</if> |
|
|
|
<if test=" null != cardId "> |
|
|
|
and cs.`card_id` = #{cardId} |
|
|
|
</if> |
|
|
|
<if test=" null != ownerId "> |
|
|
|
and cs.`owner_id` = #{ownerId} |
|
|
|
</if> |
|
|
|
<if test=" null != merchantId "> |
|
|
|
and cs.`merchant_id` = #{merchantId} |
|
|
|
</if> |
|
|
|
<if test=" null != orderId "> |
|
|
|
and cs.`order_id` = #{orderId} |
|
|
|
</if> |
|
|
|
<if test=" null != deductionAmount "> |
|
|
|
and cs.`deduction_amount` = #{deductionAmount} |
|
|
|
</if> |
|
|
|
<if test=" null != payment "> |
|
|
|
and cs.`payment` = #{payment} |
|
|
|
</if> |
|
|
|
<if test=" null != realPayment "> |
|
|
|
and cs.`real_payment` = #{realPayment} |
|
|
|
</if> |
|
|
|
<if test=" null != cardRemainAmount "> |
|
|
|
and cs.`card_remain_amount` = #{cardRemainAmount} |
|
|
|
</if> |
|
|
|
<if test=" null != cardBeforeAmount "> |
|
|
|
and cs.`card_before_amount` = #{cardBeforeAmount} |
|
|
|
</if> |
|
|
|
<if test=" null != cardRemainRealAmount "> |
|
|
|
and cs.`card_remain_real_amount` = #{cardRemainRealAmount} |
|
|
|
</if> |
|
|
|
<if test=" null != cardBeforeRealAmount "> |
|
|
|
and cs.`card_before_real_amount` = #{cardBeforeRealAmount} |
|
|
|
</if> |
|
|
|
<if test=" null != createDate "> |
|
|
|
and cs.`create_date` = #{createDate} |
|
|
|
</if> |
|
|
|
<if test=" null != updateDate "> |
|
|
|
and cs.`update_date` = #{updateDate} |
|
|
|
</if> |
|
|
|
<if test=" null != ids "> |
|
|
|
and cs.id in |
|
|
|
<foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> |
|
|
|
#{idItem} |
|
|
|
</foreach> |
|
|
|
</if> |
|
|
|
</sql> |
|
|
|
|
|
|
|
<select id="findCardSpendVoList" parameterType="java.util.Map" resultMap="VoResultMap"> |
|
|
|
select |
|
|
|
<include refid="allVoColumns"/> |
|
|
|
from wx_card_spend cs |
|
|
|
left join wx_merchant m on m.id = cs.merchant_id |
|
|
|
<include refid="dynamicVoWhereConditions" /> |
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|