Explorar el Código

增加优惠券筛选条件

wanxl hace 1 año
padre
commit
a0e62f443c

+ 1 - 1
src/main/java/com/sqx/modules/chats/respository/ChatsMapper.java

@@ -85,7 +85,7 @@ public interface ChatsMapper extends BaseMapper<Chats> {
             " <if test='userName != null and userName != \"\" '>"+
             "and (tu.phone like '%${userName}%' or c.user_name like '%${userName}%') " +
             " </if>"+
-            "and store_id =#{storeId}  and (c.store_count <>0 or c.store_count is null)" +
+            "and store_id =#{storeId}  and (c.store_count !=0 or c.store_count is null)" +
             "order by c.create_time desc" +
             "</script>"})
     List<Chats> findUnRead(Long storeId, String userName, Long type, String starTime, String endTime);

+ 1 - 1
src/main/java/com/sqx/modules/coupon/dao/TbCouponUserDao.java

@@ -22,7 +22,7 @@ public interface TbCouponUserDao extends BaseMapper<TbCouponUser> {
 
     IPage<TbCouponUser> selectCouponByUserId(Page<TbCouponUser> pages, @Param("userId") Long userId,
                                              @Param("status") Integer status, @Param("phone") String phone,
-                                             @Param("shopName") String shopName,@Param("shopId") Long shopId);
+                                             @Param("shopName") String shopName,@Param("shopId") Long shopId,@Param("shopFlag") Integer shopFlag);
 
     int selectCountCoupon(Long userId);
 

+ 1 - 1
src/main/java/com/sqx/modules/coupon/service/TbCouponUserService.java

@@ -16,6 +16,6 @@ public interface TbCouponUserService extends IService<TbCouponUser> {
 
     Result buyCoupon(Long userId, Long couponId);
 
-    Result selectCouponByUserId(Integer page, Integer limit, Long userId, Integer status, String phone,String shopName,Long shopId);
+    Result selectCouponByUserId(Integer page, Integer limit, Long userId, Integer status, String phone,String shopName,Long shopId,Integer shopFlag);
 
 }

+ 2 - 2
src/main/java/com/sqx/modules/coupon/service/impl/TbTbCouponUserServiceImpl.java

@@ -124,9 +124,9 @@ public class TbTbCouponUserServiceImpl extends ServiceImpl<TbCouponUserDao, TbCo
     }
 
     @Override
-    public Result selectCouponByUserId(Integer page, Integer limit, Long userId, Integer status, String phone,String shopName,Long shopId) {
+    public Result selectCouponByUserId(Integer page, Integer limit, Long userId, Integer status, String phone,String shopName,Long shopId,Integer shopFalg) {
         Page<TbCouponUser> pages = new Page<>(page, limit);
-        PageUtils pageUtils = new PageUtils(tbCouponUserDao.selectCouponByUserId(pages, userId, status, phone,shopName,shopId));
+        PageUtils pageUtils = new PageUtils(tbCouponUserDao.selectCouponByUserId(pages, userId, status, phone,shopName,shopId,shopFalg));
         return Result.success().put("data", pageUtils);
     }
 }

+ 2 - 2
src/main/java/com/sqx/modules/datacentre/controller/DataCentreController.java

@@ -100,9 +100,9 @@ public class DataCentreController {
 
     @ApiOperation("查看用户拥有的优惠券")
     @GetMapping(value = "selectCouponByUserId")
-    public Result selectCouponByUserId(Integer page, Integer limit, Long userId, Integer status, String phone,String shopName,Long shopId) {
+    public Result selectCouponByUserId(Integer page, Integer limit, Long userId, Integer status, String phone,String shopName,Long shopId,Integer shopFlag/*是否平台券 1是 2否 0 全部 */) {
 
-        return tbCouponUserService.selectCouponByUserId(page, limit, userId, status, phone,shopName,shopId);
+        return tbCouponUserService.selectCouponByUserId(page, limit, userId, status, phone,shopName,shopId,shopFlag);
     }
 
     @ApiOperation("查看积分明细")

+ 6 - 0
src/main/resources/mapper/coupon/TbCouponUserMapper.xml

@@ -46,6 +46,12 @@
         <if test="shopId!=null">
             and tcu.shop_id=#{shopId}
         </if>
+        <if test="shopFlag!=null and shopFlag == 1">
+            and g.shop_id is null
+        </if>
+        <if test="shopFlag!=null and shopFlag == 2">
+            and g.shop_id is not null
+        </if>
         order by tcu.create_time desc
     </select>