Commit 16af31d980ee6480b00e50be3f932586ae00d320

Authored by owen
1 parent 3dca66ee

分销:@Select sql语句增加逻辑删除字段过滤

yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/dal/mysql/brokerage/BrokerageRecordMapper.java
... ... @@ -53,14 +53,14 @@ public interface BrokerageRecordMapper extends BaseMapperX<BrokerageRecordDO> {
53 53 }
54 54  
55 55 @Select("SELECT COUNT(1), SUM(price) FROM trade_brokerage_record " +
56   - "WHERE user_id = #{userId} AND biz_type = #{bizType} AND status = #{status}")
  56 + "WHERE user_id = #{userId} AND biz_type = #{bizType} AND status = #{status} AND deleted = FALSE")
57 57 UserBrokerageSummaryBO selectCountAndSumPriceByUserIdAndBizTypeAndStatus(@Param("userId") Long userId,
58 58 @Param("bizType") Integer bizType,
59 59 @Param("status") Integer status);
60 60  
61 61 @Select("SELECT SUM(price) FROM trade_brokerage_record " +
62 62 "WHERE user_id = #{userId} AND biz_type = #{bizType} " +
63   - "AND create_time BETWEEN #{beginTime} AND #{endTime}")
  63 + "AND create_time BETWEEN #{beginTime} AND #{endTime} AND deleted = FALSE")
64 64 Integer selectSummaryPriceByUserIdAndBizTypeAndCreateTimeBetween(@Param("userId") Long userId,
65 65 @Param("bizType") Integer bizType,
66 66 @Param("beginTime") LocalDateTime beginTime,
... ...
yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/dal/mysql/brokerage/BrokerageWithdrawMapper.java
... ... @@ -38,6 +38,7 @@ public interface BrokerageWithdrawMapper extends BaseMapperX<BrokerageWithdrawDO
38 38 }
39 39  
40 40 @Select("SELECT COUNT(1) AS count, SUM(price) AS price FROM trade_brokerage_withdraw " +
41   - "WHERE user_id = #{userId} AND status = #{status}")
42   - UserWithdrawSummaryBO selectCountAndSumPriceByUserIdAndStatus(Long userId, Integer status);
  41 + "WHERE user_id = #{userId} AND status = #{status} AND deleted = FALSE")
  42 + UserWithdrawSummaryBO selectCountAndSumPriceByUserIdAndStatus(@Param("userId") Long userId,
  43 + @Param("status") Integer status);
43 44 }
... ...