| | |
| | | @Data |
| | | @ApiModel(value = "StoreCouponSingle查询参数", description = "店铺优惠卷单品查询参数") |
| | | public class StoreCouponSingleQuery extends AbsQuery { |
| | | private String refId; |
| | | } |
| | | |
| | |
| | | */ |
| | | IPage getPage(IPage page, @Param("query") StoreCouponSingleQuery query); |
| | | |
| | | /** |
| | | * 分页 |
| | | */ |
| | | IPage getPageByRefId(IPage page, @Param("query") StoreCouponSingleQuery query); |
| | | |
| | | } |
| | |
| | | package cn.lili.modules.lmk.service; |
| | | |
| | | import cn.lili.modules.lmk.domain.entity.StoreCoupon; |
| | | import cn.lili.modules.lmk.domain.query.StoreCouponSingleQuery; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import cn.lili.base.Result; |
| | | import cn.lili.modules.lmk.domain.form.StoreCouponForm; |
| | |
| | | Result addStoreCoupon(StoreCouponForm storeCoupon); |
| | | |
| | | Result generateStoreCoupon( String id); |
| | | |
| | | Result getPageByStoreCoupon(StoreCouponSingleQuery query); |
| | | } |
| | |
| | | */ |
| | | Result page(StoreCouponSingleQuery query); |
| | | |
| | | Result pageByRefId(StoreCouponSingleQuery query); |
| | | |
| | | /** |
| | | * 根据id查找 |
| | | * @param id |
| | |
| | | import cn.lili.common.exception.ServiceException; |
| | | import cn.lili.modules.lmk.domain.entity.CouponVirtual; |
| | | import cn.lili.modules.lmk.domain.entity.StoreCouponSingle; |
| | | import cn.lili.modules.lmk.domain.query.StoreCouponSingleQuery; |
| | | import cn.lili.modules.lmk.enums.general.GenerateCouponStausEnum; |
| | | import cn.lili.modules.lmk.enums.general.StoreCouponStausEnum; |
| | | import cn.lili.modules.lmk.service.StoreCouponSingleService; |
| | |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public Result getPageByStoreCoupon(StoreCouponSingleQuery query){ |
| | | return storeCouponSingleService.pageByRefId(query); |
| | | } |
| | | |
| | | private static StoreCouponSingle getStoreCouponSingle(StoreCoupon storeCoupon, int i) { |
| | | StoreCouponSingle storeCouponSingle = new StoreCouponSingle(); |
| | | storeCouponSingle.setStoreCoupRef(storeCoupon.getId()); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result pageByRefId(StoreCouponSingleQuery query) { |
| | | IPage<StoreCouponSingleVO> page = PageUtil.getPage(query, StoreCouponSingleVO.class); |
| | | baseMapper.getPageByRefId(page, query); |
| | | return Result.ok().data(page.getRecords()).total(page.getTotal()); |
| | | } |
| | | |
| | | /** |
| | | * 根据id查找 |
| | | * @param id |
| | | * @return |
| | |
| | | LSCS.delete_flag = 0 |
| | | </select> |
| | | |
| | | <select id="getPageByRefId" resultMap="BaseResultMap"> |
| | | SELECT |
| | | LSCS.store_coup_ref, |
| | | LSCS.store_id, |
| | | LSCS.coupon_id, |
| | | LSCS.coupon_name, |
| | | LSCS.coupon_no, |
| | | LSCS.claim_status, |
| | | LSCS.id |
| | | FROM |
| | | lmk_store_coupon_single LSCS |
| | | WHERE |
| | | LSCS.delete_flag = 0 |
| | | AND LSCS.store_coup_ref = #{query.refId} |
| | | </select> |
| | | </mapper> |
| | |
| | | import cn.lili.base.Result; |
| | | import cn.lili.modules.lmk.domain.form.StoreCouponForm; |
| | | import cn.lili.modules.lmk.domain.query.StoreCouponQuery; |
| | | import cn.lili.modules.lmk.domain.query.StoreCouponSingleQuery; |
| | | import cn.lili.modules.lmk.service.StoreCouponService; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import lombok.AllArgsConstructor; |
| | |
| | | public Result getPage(StoreCouponQuery query){ |
| | | return storeCouponService.page(query); |
| | | } |
| | | |
| | | @GetMapping("/getPageByStoreCoupon") |
| | | public Result getPageByStoreCoupon(StoreCouponSingleQuery query){ |
| | | return storeCouponService.getPageByStoreCoupon(query); |
| | | } |
| | | } |