|
@@ -652,50 +652,25 @@
|
|
|
) r on c.account_id =r.account_id
|
|
|
left join pay_pay_rechargeaccount rh on rh.account_id =c.account_id
|
|
|
where c.businessstate =1 and d.control_status = 1 and c.site_id= #{siteId} and c.customer_id = #{customerId}
|
|
|
- <if test="condition != null and condition != ''">
|
|
|
- and (
|
|
|
- a.name like concat('%',#{condition},'%')
|
|
|
- or a.accountnumber like concat('%',#{condition},'%')
|
|
|
- or a.mobilephone like concat('%',#{condition},'%')
|
|
|
- )
|
|
|
- </if>
|
|
|
- <if test="beginDebtFee != null ">
|
|
|
- <if test="searchType != null and searchType == 1">and TIMESTAMPDIFF(day,ifnull(r.create_date,NOW()),NOW()) >= #{beginDebtFee}</if>
|
|
|
- <if test="searchType != null and searchType == 2">and r.debt >= #{beginDebtFee}</if>
|
|
|
- <if test="searchType != null and searchType == 3">and rh.remaining >= #{beginDebtFee}</if>
|
|
|
- <if test="searchType != null and searchType == 4">and rh.balance >= #{beginDebtFee}</if>
|
|
|
- </if>
|
|
|
- <if test="endDebtFee != null">
|
|
|
- <if test="searchType != null and searchType == 1">and TIMESTAMPDIFF(day,ifnull(r.create_date,NOW()),NOW()) <= #{beginDebtFee}</if>
|
|
|
- <if test="searchType != null and searchType == 2">and r.debt <= #{beginDebtFee}</if>
|
|
|
- <if test="searchType != null and searchType == 3">and rh.remaining <= #{beginDebtFee}</if>
|
|
|
- <if test="searchType != null and searchType == 4">and rh.balance <= #{beginDebtFee}</if>
|
|
|
- </if>
|
|
|
- <if test="payControlRules != null and payControlRules.size() != 0">
|
|
|
- <foreach collection="payControlRules" item="rule" open=" and ( " separator=" or " close=" ) ">
|
|
|
- ( concat(',',c.valve_rule_id,',') like concat('%,',${rule.id},',%')
|
|
|
- <if test="rule.conditionId != null and rule.conditionId == 1">
|
|
|
- and TIMESTAMPDIFF(day,ifnull(r.create_date,NOW()),NOW()) ${rule.operatorString} #{rule.value}
|
|
|
- </if>
|
|
|
- <if test="rule.conditionId != null and rule.conditionId == 2">
|
|
|
- and r.debt ${rule.operatorString} #{rule.value}
|
|
|
- </if>
|
|
|
- <if test="rule.conditionId != null and rule.conditionId == 3">
|
|
|
- and rh.remaining ${rule.operatorString} #{rule.value}
|
|
|
- </if>
|
|
|
- <if test="rule.conditionId != null and rule.conditionId == 4">
|
|
|
- and rh.balance ${rule.operatorString} #{rule.value}
|
|
|
- </if>
|
|
|
- )
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- <if test="programItems != null and programItems.size() != 0">
|
|
|
- and <foreach collection="programItems" item="item" open="(" separator=" or " close=")">
|
|
|
- <if test="item.dimensionId == 10">
|
|
|
- c.${item.dimensionCode} = #{item.dimensionValue}
|
|
|
- </if>
|
|
|
- </foreach>
|
|
|
+ <if test="payControlRules != null and payControlRules.size() != 0">
|
|
|
+ <foreach collection="payControlRules" item="rule" open=" and ( " separator=" or " close=" ) ">
|
|
|
+ ( concat(',',c.valve_rule_id,',') like concat('%,',${rule.id},',%')
|
|
|
+ <if test="rule.conditionId != null and rule.conditionId == 1">
|
|
|
+ and TIMESTAMPDIFF(day,ifnull(r.create_date,NOW()),NOW()) ${rule.operatorString} #{rule.value}
|
|
|
+ </if>
|
|
|
+ <if test="rule.conditionId != null and rule.conditionId == 2">
|
|
|
+ and r.debt ${rule.operatorString} #{rule.value}
|
|
|
+ </if>
|
|
|
+ <if test="rule.conditionId != null and rule.conditionId == 3">
|
|
|
+ and rh.remaining ${rule.operatorString} #{rule.value}
|
|
|
+ </if>
|
|
|
+ <if test="rule.conditionId != null and rule.conditionId == 4">
|
|
|
+ and rh.balance ${rule.operatorString} #{rule.value}
|
|
|
+ </if>
|
|
|
+ )
|
|
|
+ </foreach>
|
|
|
</if>
|
|
|
+
|
|
|
</select>
|
|
|
|
|
|
</mapper>
|