修改查询会员充值bug
This commit is contained in:
@@ -19,19 +19,16 @@ public interface ShopUserMapper extends BaseMapper<TbShopUser> {
|
||||
"FROM tb_shop_user su " +
|
||||
"LEFT JOIN tb_user_info u ON su.user_id = u.id " +
|
||||
"<where> " +
|
||||
"su.user_id is not null and su.user_id != ''" +
|
||||
"<if test='param.shopId != null and param.shopId != "" and param.shopId != 1'>" +
|
||||
"AND su.shop_id = #{param.shopId} " +
|
||||
"</if>" +
|
||||
"<if test='param.name != null and param.name != ""'>" +
|
||||
"AND (u.nick_name like concat('%', #{param.name}, '%') or u.telephone like concat('%', #{param.name}, '%'))" +
|
||||
"</if>" +
|
||||
"<if test='param.isVip != null and param.isVip != ""'>" +
|
||||
"AND su.is_vip=#{param.isVip}" +
|
||||
"</if>" +
|
||||
"AND su.is_vip=#{isVip}" +
|
||||
"</where>" +
|
||||
"</script>")
|
||||
IPage<ShopUserInfoVo> queryUser(TbShopUserQueryCriteria param, Page pageInfo);
|
||||
IPage<ShopUserInfoVo> queryUser(TbShopUserQueryCriteria param, Integer isVip, Page pageInfo);
|
||||
|
||||
@Select("<script> " +
|
||||
"select " +
|
||||
|
||||
@@ -19,23 +19,26 @@ public interface TbShopUserFlowMapper extends BaseMapper<TbShopUserFlow> {
|
||||
* @param shopId 店铺ID
|
||||
* @param startTime 开始时间
|
||||
* @param endTime 结束时间
|
||||
* @param types 流水类型
|
||||
* @return 用户流水总金额
|
||||
*/
|
||||
@Select("<script>" +
|
||||
"SELECT IFNULL(SUM(uf.amount), 0) FROM tb_shop_user_flow as uf " +
|
||||
"JOIN tb_shop_user su ON uf.shop_user_id = su.user_id " +
|
||||
"WHERE su.shop_id = #{shopId} " +
|
||||
"AND uf.create_time BETWEEN #{startTime} AND #{endTime} " +
|
||||
"AND uf.biz_code IN " +
|
||||
"<foreach collection='types' item='type' open='(' separator=',' close=')'> " +
|
||||
"#{type} " +
|
||||
"</foreach> " +
|
||||
" SELECT \n" +
|
||||
" COALESCE(SUM(flow.total_amount), 0) AS chageTotal\n" +
|
||||
"FROM \n" +
|
||||
" tb_shop_user AS a\n" +
|
||||
" LEFT JOIN (\n" +
|
||||
" SELECT shop_user_id, SUM(amount) AS total_amount \n" +
|
||||
" FROM tb_shop_user_flow \n" +
|
||||
" WHERE biz_code IN ('cashMemberIn','scanMemberIn') \n" +
|
||||
" AND create_time BETWEEN #{startTime} AND #{endTime} \n" +
|
||||
" GROUP BY shop_user_id\n" +
|
||||
" ) AS flow ON flow.shop_user_id = a.id\n" +
|
||||
"WHERE \n" +
|
||||
" a.shop_id = #{shopId}" +
|
||||
"</script>")
|
||||
BigDecimal sumUserFlowAmountByConditions(@Param("shopId") Long shopId,
|
||||
@Param("startTime") String startTime,
|
||||
@Param("endTime") String endTime,
|
||||
@Param("types") List<String> types);
|
||||
@Param("endTime") String endTime);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -12,5 +12,5 @@ import java.util.List;
|
||||
*/
|
||||
public interface TbShopUserFlowService extends IService<TbShopUserFlow> {
|
||||
|
||||
BigDecimal sumUserFlowAmountByConditions(Long shopId, String startTime, String endTime, List<String> types);
|
||||
BigDecimal sumUserFlowAmountByConditions(Long shopId, String startTime, String endTime);
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ import java.util.List;
|
||||
@Service
|
||||
public class TbShopUserFlowServiceImpl extends ServiceImpl<TbShopUserFlowMapper, TbShopUserFlow> implements TbShopUserFlowService {
|
||||
@Override
|
||||
public BigDecimal sumUserFlowAmountByConditions(Long shopId, String startTime, String endTime, List<String> types) {
|
||||
return baseMapper.sumUserFlowAmountByConditions(shopId, startTime, endTime, types);
|
||||
public BigDecimal sumUserFlowAmountByConditions(Long shopId, String startTime, String endTime) {
|
||||
return baseMapper.sumUserFlowAmountByConditions(shopId, startTime, endTime);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user