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

This commit is contained in:
owen 2023-09-25 08:36:55 +08:00
parent 3dca66eefa
commit 16af31d980
2 changed files with 5 additions and 4 deletions

View File

@ -53,14 +53,14 @@ public interface BrokerageRecordMapper extends BaseMapperX<BrokerageRecordDO> {
} }
@Select("SELECT COUNT(1), SUM(price) FROM trade_brokerage_record " + @Select("SELECT COUNT(1), SUM(price) FROM trade_brokerage_record " +
"WHERE user_id = #{userId} AND biz_type = #{bizType} AND status = #{status}") "WHERE user_id = #{userId} AND biz_type = #{bizType} AND status = #{status} AND deleted = FALSE")
UserBrokerageSummaryBO selectCountAndSumPriceByUserIdAndBizTypeAndStatus(@Param("userId") Long userId, UserBrokerageSummaryBO selectCountAndSumPriceByUserIdAndBizTypeAndStatus(@Param("userId") Long userId,
@Param("bizType") Integer bizType, @Param("bizType") Integer bizType,
@Param("status") Integer status); @Param("status") Integer status);
@Select("SELECT SUM(price) FROM trade_brokerage_record " + @Select("SELECT SUM(price) FROM trade_brokerage_record " +
"WHERE user_id = #{userId} AND biz_type = #{bizType} " + "WHERE user_id = #{userId} AND biz_type = #{bizType} " +
"AND create_time BETWEEN #{beginTime} AND #{endTime}") "AND create_time BETWEEN #{beginTime} AND #{endTime} AND deleted = FALSE")
Integer selectSummaryPriceByUserIdAndBizTypeAndCreateTimeBetween(@Param("userId") Long userId, Integer selectSummaryPriceByUserIdAndBizTypeAndCreateTimeBetween(@Param("userId") Long userId,
@Param("bizType") Integer bizType, @Param("bizType") Integer bizType,
@Param("beginTime") LocalDateTime beginTime, @Param("beginTime") LocalDateTime beginTime,

View File

@ -38,6 +38,7 @@ public interface BrokerageWithdrawMapper extends BaseMapperX<BrokerageWithdrawDO
} }
@Select("SELECT COUNT(1) AS count, SUM(price) AS price FROM trade_brokerage_withdraw " + @Select("SELECT COUNT(1) AS count, SUM(price) AS price FROM trade_brokerage_withdraw " +
"WHERE user_id = #{userId} AND status = #{status}") "WHERE user_id = #{userId} AND status = #{status} AND deleted = FALSE")
UserWithdrawSummaryBO selectCountAndSumPriceByUserIdAndStatus(Long userId, Integer status); UserWithdrawSummaryBO selectCountAndSumPriceByUserIdAndStatus(@Param("userId") Long userId,
@Param("status") Integer status);
} }