提交代码

dev
胡锐 1 week ago
parent c0aa5deb19
commit 06dad7f973
  1. 4
      service/src/main/java/com/hfkj/dao/BsGasOrderMapperExt.java
  2. 10
      service/src/main/java/com/hfkj/dao/BsGasOrderSpreadMapperExt.java

@ -76,8 +76,8 @@ public interface BsGasOrderMapperExt {
" <if test='param.payTimeS != null'> <![CDATA[ and b.pay_time >= #{param.payTimeS} ]]> </if>" +
" <if test='param.payTimeE != null'> <![CDATA[ and b.pay_time <= #{param.payTimeE} ]]> </if>" +
" and b.`status` in (${param.status}) " +
" ORDER BY b.pay_time desc) a where" +
" a.gainsRebateUserId = #{param.userId} OR a.gainsRebateOneUserId = #{param.userId} OR a.gainsRebateTwoUserId = #{param.userId}" +
" ORDER BY b.pay_time desc) a " +
" <if test='param.userId != null'> where a.gainsRebateUserId = #{param.userId} OR a.gainsRebateOneUserId = #{param.userId} OR a.gainsRebateTwoUserId = #{param.userId} </if>" +
"</script>")
@Results({
@Result(column="id", property="id", jdbcType= JdbcType.BIGINT, id=true),

@ -49,21 +49,22 @@ public interface BsGasOrderSpreadMapperExt {
" select sum(b.gains_rebate_one_amount) totalAmount" +
" from bs_gas_order a LEFT JOIN bs_gas_order_spread b on a.order_no = b.order_no" +
" WHERE a.`status` in (${param.status})" +
" <if test='param.userId != null'> and b.gains_rebate_user_id = #{param.userId} </if>" +
" <if test='param.userId != null'> and b.gains_rebate_one_user_id = #{param.userId} </if>" +
" <if test='param.payTimeS != null'> <![CDATA[ and a.pay_time >= #{param.payTimeS} ]]> </if>" +
" <if test='param.payTimeE != null'> <![CDATA[ and a.pay_time <= #{param.payTimeE} ]]> </if>" +
" union all" +
" select sum(b.gains_rebate_two_amount) totalAmount" +
" from bs_gas_order a LEFT JOIN bs_gas_order_spread b on a.order_no = b.order_no" +
" WHERE a.`status` in (${param.status})" +
" <if test='param.userId != null'> and b.gains_rebate_user_id = #{param.userId} </if>" +
" <if test='param.userId != null'> and b.gains_rebate_two_user_id = #{param.userId} </if>" +
" <if test='param.payTimeS != null'> <![CDATA[ and a.pay_time >= #{param.payTimeS} ]]> </if>" +
" <if test='param.payTimeE != null'> <![CDATA[ and a.pay_time <= #{param.payTimeE} ]]> </if>" +
" ) a" +
"</script>")
BigDecimal countSettleOrderPrice(@Param("param") Map<String,Object> param);
@Select(" select " +
@Select("<script>" +
" select " +
" case when sum(totalAmount) is not null then sum(totalAmount) else 0 end" +
" from (" +
" select " +
@ -83,7 +84,8 @@ public interface BsGasOrderSpreadMapperExt {
" from bs_gas_order a LEFT JOIN bs_gas_order_spread b on a.order_no = b.order_no" +
" WHERE DATE(a.pay_time) = CURDATE() and a.`status` = 2" +
" <if test='userId != null'> and b.gains_rebate_two_user_id = #{userId} </if>" +
" ) a")
" ) a" +
"</script>")
BigDecimal queryNotCashOutAmount(@Param("userId") Long userId);
@Select(" select " +

Loading…
Cancel
Save