Commit 16af31d980ee6480b00e50be3f932586ae00d320
1 parent
3dca66ee
分销:@Select sql语句增加逻辑删除字段过滤
Showing
2 changed files
with
5 additions
and
4 deletions
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,14 +53,14 @@ public interface BrokerageRecordMapper extends BaseMapperX<BrokerageRecordDO> { | ||
| 53 | } | 53 | } |
| 54 | 54 | ||
| 55 | @Select("SELECT COUNT(1), SUM(price) FROM trade_brokerage_record " + | 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 | UserBrokerageSummaryBO selectCountAndSumPriceByUserIdAndBizTypeAndStatus(@Param("userId") Long userId, | 57 | UserBrokerageSummaryBO selectCountAndSumPriceByUserIdAndBizTypeAndStatus(@Param("userId") Long userId, |
| 58 | @Param("bizType") Integer bizType, | 58 | @Param("bizType") Integer bizType, |
| 59 | @Param("status") Integer status); | 59 | @Param("status") Integer status); |
| 60 | 60 | ||
| 61 | @Select("SELECT SUM(price) FROM trade_brokerage_record " + | 61 | @Select("SELECT SUM(price) FROM trade_brokerage_record " + |
| 62 | "WHERE user_id = #{userId} AND biz_type = #{bizType} " + | 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 | Integer selectSummaryPriceByUserIdAndBizTypeAndCreateTimeBetween(@Param("userId") Long userId, | 64 | Integer selectSummaryPriceByUserIdAndBizTypeAndCreateTimeBetween(@Param("userId") Long userId, |
| 65 | @Param("bizType") Integer bizType, | 65 | @Param("bizType") Integer bizType, |
| 66 | @Param("beginTime") LocalDateTime beginTime, | 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,6 +38,7 @@ public interface BrokerageWithdrawMapper extends BaseMapperX<BrokerageWithdrawDO | ||
| 38 | } | 38 | } |
| 39 | 39 | ||
| 40 | @Select("SELECT COUNT(1) AS count, SUM(price) AS price FROM trade_brokerage_withdraw " + | 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 | } |