| @@ -27,42 +27,6 @@ public class WxCouponController extends BaseController { | |||||
| @Autowired | @Autowired | ||||
| private WxCouponService wxCouponService; | private WxCouponService wxCouponService; | ||||
| @ApiOperation("分页列表接口") | |||||
| @GetMapping("listCoupon") | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| public ResultData listCoupon(@ModelAttribute WxCoupon wxCoupon, Integer pageNum, Integer pageSize) { | |||||
| logger.debug("[" + getIpAddr() + "] WxCouponController::listCoupon"); | |||||
| if (wxCoupon == null) wxCoupon = new WxCoupon(); | |||||
| wxCoupon.setTenantId(getTenantId()); | |||||
| return wxCouponService.listType(wxCoupon, pageNum, pageSize, 0); //券列表 | |||||
| } | |||||
| @ApiOperation("卡分页列表接口") | |||||
| @GetMapping("listCard") | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| public ResultData listCard(@ModelAttribute WxCoupon wxCoupon, Integer pageNum, Integer pageSize) { | |||||
| logger.debug("[" + getIpAddr() + "] WxCouponController::listCard"); | |||||
| if (wxCoupon == null) wxCoupon = new WxCoupon(); | |||||
| wxCoupon.setTenantId(getTenantId()); | |||||
| return wxCouponService.listType(wxCoupon, pageNum, pageSize, EnumCouponType.CARD_MULTIMCH.getCode()); //卡列表 | |||||
| } | |||||
| @ApiOperation("砍价分页列表接口") | |||||
| @GetMapping("listPress") | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| public ResultData listPress(@ModelAttribute WxCoupon wxCoupon, Integer pageNum, Integer pageSize) { | |||||
| logger.debug("[" + getIpAddr() + "] WxCouponController::listPress"); | |||||
| if (wxCoupon == null) wxCoupon = new WxCoupon(); | |||||
| wxCoupon.setTenantId(getTenantId()); | |||||
| return wxCouponService.listType(wxCoupon, pageNum, pageSize, EnumCouponType.COUPON_PRESS.getCode()); //砍价列表 | |||||
| } | |||||
| @ApiOperation("分页列表接口") | @ApiOperation("分页列表接口") | ||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @ApiImplicitParams({ | @ApiImplicitParams({ | ||||
| @@ -72,7 +36,7 @@ public class WxCouponController extends BaseController { | |||||
| logger.debug("[" + getIpAddr() + "] WxCouponController::list"); | logger.debug("[" + getIpAddr() + "] WxCouponController::list"); | ||||
| if (wxCoupon == null) wxCoupon = new WxCoupon(); | if (wxCoupon == null) wxCoupon = new WxCoupon(); | ||||
| wxCoupon.setTenantId(getTenantId()); | wxCoupon.setTenantId(getTenantId()); | ||||
| return wxCouponService.listType(wxCoupon, pageNum, pageSize, null); //全列表 | |||||
| return wxCouponService.list(wxCoupon, pageNum, pageSize); //全列表 | |||||
| } | } | ||||
| @ApiOperation("新增接口") | @ApiOperation("新增接口") | ||||
| @@ -110,11 +74,6 @@ public class WxCouponController extends BaseController { | |||||
| return new ResultData(wxCouponService.getVoById(id)); | return new ResultData(wxCouponService.getVoById(id)); | ||||
| } | } | ||||
| @ApiOperation("卡类列表接口") | |||||
| @GetMapping("findList") | |||||
| public ResultData findList(@ModelAttribute WxCoupon wxCoupon) { | |||||
| return new ResultData(wxCouponService.list(wxCoupon)); | |||||
| } | |||||
| @ApiOperation("卡营销列表接口") | @ApiOperation("卡营销列表接口") | ||||
| @GetMapping("findCardCountList") | @GetMapping("findCardCountList") | ||||
| @@ -10,10 +10,10 @@ public interface WxCouponMapper extends CommonMapper<WxCoupon, Long> { | |||||
| List<WxCoupon> findPressData(WxCoupon wxCoupon); | List<WxCoupon> findPressData(WxCoupon wxCoupon); | ||||
| List<WxCoupon> findCouponData(WxCoupon wxCoupon); | List<WxCoupon> findCouponData(WxCoupon wxCoupon); | ||||
| List<WxCoupon> findCountData(WxCoupon wxCoupon); | List<WxCoupon> findCountData(WxCoupon wxCoupon); | ||||
| List<WxCoupon> findList(WxCoupon wxCoupon); | List<WxCoupon> findList(WxCoupon wxCoupon); | ||||
| List<WxCoupon> findCardList(WxCoupon wxCoupon); | |||||
| List<WxCoupon> findCouponList(WxCoupon wxCoupon); | List<WxCoupon> findCouponList(WxCoupon wxCoupon); | ||||
| List<WxCoupon> findPressList(WxCoupon wxCoupon); | |||||
| WxCouponCVo findVoDetail(@Param("id")Long id); | WxCouponCVo findVoDetail(@Param("id")Long id); | ||||
| @@ -9,7 +9,7 @@ import com.iformall.domain.vo.WxCouponCVo; | |||||
| public interface WxCouponService { | public interface WxCouponService { | ||||
| ResultData listType(WxCoupon wxCoupon, Integer pageNum, Integer pageSize, Integer type); | |||||
| ResultData list(WxCoupon wxCoupon, Integer pageNum, Integer pageSize); | |||||
| /** | /** | ||||
| * 根据实体查询分页列表 | * 根据实体查询分页列表 | ||||
| @@ -19,15 +19,7 @@ public interface WxCouponService { | |||||
| * @param pageSize | * @param pageSize | ||||
| * @return | * @return | ||||
| */ | */ | ||||
| PageInfo<WxCoupon> listAsPage(WxCoupon record, Integer pageIndex, Integer pageSize, Integer type); | |||||
| /** | |||||
| * 列表 | |||||
| * @param record | |||||
| * @return | |||||
| */ | |||||
| List<WxCoupon> list(WxCoupon record); | |||||
| PageInfo<WxCoupon> listAsPage(WxCoupon record, Integer pageIndex, Integer pageSize); | |||||
| /** | /** | ||||
| * 卡类列表,包括统计 | * 卡类列表,包括统计 | ||||
| @@ -62,13 +62,14 @@ public class WxCouponServiceImpl implements WxCouponService { | |||||
| WxCouponChannelMapper wxCouponChannelMapper; | WxCouponChannelMapper wxCouponChannelMapper; | ||||
| public ResultData listType(WxCoupon wxCoupon, Integer pageNum, Integer pageSize, Integer type) { | |||||
| @Override | |||||
| public ResultData list(WxCoupon wxCoupon, Integer pageNum, Integer pageSize) { | |||||
| if (null == wxCoupon) wxCoupon = new WxCoupon(); | if (null == wxCoupon) wxCoupon = new WxCoupon(); | ||||
| wxCoupon.setSortColumns(WxCoupon.Field.Id_DESC); | wxCoupon.setSortColumns(WxCoupon.Field.Id_DESC); | ||||
| PageInfo<WxCoupon> page = null; | PageInfo<WxCoupon> page = null; | ||||
| if (wxCoupon.getStatus() != null && wxCoupon.getStatus() == -1) | if (wxCoupon.getStatus() != null && wxCoupon.getStatus() == -1) | ||||
| wxCoupon.setStatus(null); | wxCoupon.setStatus(null); | ||||
| page = listAsPage(wxCoupon, pageNum, pageSize, type); | |||||
| page = listAsPage(wxCoupon, pageNum, pageSize); | |||||
| List<WxCoupon> wxCouponList = page.getList(); | List<WxCoupon> wxCouponList = page.getList(); | ||||
| @@ -113,22 +114,10 @@ public class WxCouponServiceImpl implements WxCouponService { | |||||
| @Override | @Override | ||||
| public PageInfo<WxCoupon> listAsPage(WxCoupon record, Integer pageIndex, Integer pageSize, Integer type) { | |||||
| if (type == null) { | |||||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCouponMapper.findList(record)); | |||||
| } else if (type.equals(EnumCouponType.CARD_MULTIMCH.getCode())) { | |||||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCouponMapper.findCardList(record)); | |||||
| } else if (type.equals(EnumCouponType.COUPON_PRESS.getCode())) { | |||||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCouponMapper.findPressList(record)); | |||||
| } else { | |||||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCouponMapper.findCouponList(record)); | |||||
| } | |||||
| public PageInfo<WxCoupon> listAsPage(WxCoupon record, Integer pageIndex, Integer pageSize) { | |||||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCouponMapper.findCouponList(record)); | |||||
| } | } | ||||
| @Override | |||||
| public List<WxCoupon> list(WxCoupon record) { | |||||
| return wxCouponMapper.findList(record); | |||||
| } | |||||
| @Override | @Override | ||||
| public PageInfo<WxCoupon> findCountData(WxCoupon record,Integer pageNum, Integer pageSize) { | public PageInfo<WxCoupon> findCountData(WxCoupon record,Integer pageNum, Integer pageSize) { | ||||
| @@ -184,6 +184,7 @@ | |||||
| #{idItem} | #{idItem} | ||||
| </foreach> | </foreach> | ||||
| </if> | </if> | ||||
| <if test=" null != notinTypes "> | <if test=" null != notinTypes "> | ||||
| and type not in | and type not in | ||||
| <foreach collection="notinTypes" index="index" item="typeItem" open="(" separator="," close=")"> | <foreach collection="notinTypes" index="index" item="typeItem" open="(" separator="," close=")"> | ||||
| @@ -201,8 +202,8 @@ | |||||
| <include refid="dynamicWhereConditions"/> | <include refid="dynamicWhereConditions"/> | ||||
| </select> | </select> | ||||
| <sql id="dynamicWhereConditionsForCard"> | |||||
| where `type` = 100 | |||||
| <sql id="dynamicWhereConditionsForCoupon"> | |||||
| <if test=" null != id "> | <if test=" null != id "> | ||||
| and `id` = #{id} | and `id` = #{id} | ||||
| @@ -212,6 +213,10 @@ | |||||
| and `tenant_id` = #{tenantId} | and `tenant_id` = #{tenantId} | ||||
| </if> | </if> | ||||
| <if test=" null == type "> | |||||
| and `type` < 7 | |||||
| </if> | |||||
| <if test=" null != type "> | <if test=" null != type "> | ||||
| and `type` = #{type} | and `type` = #{type} | ||||
| </if> | </if> | ||||
| @@ -320,140 +325,10 @@ | |||||
| and `press_limit_hours` = #{pressLimitHours} | and `press_limit_hours` = #{pressLimitHours} | ||||
| </if> | </if> | ||||
| <if test=" null != ids "> | |||||
| and id in | |||||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||||
| #{idItem} | |||||
| </foreach> | |||||
| </if> | |||||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||||
| </sql> | |||||
| <select id="findCardList" parameterType="com.iformall.domain.po.WxCoupon" resultMap="BaseResultMap"> | |||||
| select | |||||
| <include refid="allColumns"/> | |||||
| from wx_coupon | |||||
| <include refid="dynamicWhereConditionsForCard"/> | |||||
| </select> | |||||
| <sql id="dynamicWhereConditionsForCoupon"> | |||||
| where `type` < 7 | |||||
| <if test=" null != id "> | |||||
| and `id` = #{id} | |||||
| </if> | |||||
| <if test=" null != tenantId "> | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | |||||
| <if test=" null != type "> | |||||
| and `type` = #{type} | |||||
| </if> | |||||
| <if test=" null != coverImg "> | |||||
| and `cover_img` like concat('%', #{coverImg},'%') | |||||
| </if> | |||||
| <if test=" null != title and ''!=title"> | |||||
| and `title` like concat('%', #{title},'%') | |||||
| </if> | |||||
| <if test=" null != subTitle "> | |||||
| and `sub_title` like concat('%', #{subTitle},'%') | |||||
| </if> | |||||
| <if test=" null != salePrice "> | |||||
| and `sale_price` = #{salePrice} | |||||
| </if> | |||||
| <if test=" null != usePrice "> | |||||
| and `use_price` = #{usePrice} | |||||
| </if> | |||||
| <if test=" null != useLimitQuantity "> | |||||
| and `use_limit_quantity` = #{useLimitQuantity} | |||||
| </if> | |||||
| <if test=" null != sendType "> | |||||
| and `send_type` = #{sendType} | |||||
| </if> | |||||
| <if test=" null != validType "> | |||||
| and `valid_type` = #{validType} | |||||
| </if> | |||||
| <if test=" null != validStartDate "> | |||||
| and `valid_start_date` = #{validStartDate} | |||||
| </if> | |||||
| <if test=" null != validEndDate "> | |||||
| and `valid_end_date` = #{validEndDate} | |||||
| </if> | |||||
| <if test=" null != validDays "> | |||||
| and `valid_days` = #{validDays} | |||||
| </if> | |||||
| <if test=" null != detail "> | |||||
| and `detail` like concat('%', #{detail},'%') | |||||
| </if> | |||||
| <if test=" null != price "> | |||||
| and `price` = #{price} | |||||
| </if> | |||||
| <if test=" null != unit "> | |||||
| and `unit` = #{unit} | |||||
| </if> | |||||
| <if test=" null != remainInventory "> | |||||
| and `remain_inventory` = #{remainInventory} | |||||
| </if> | |||||
| <if test=" null != inventory "> | |||||
| and `inventory` = #{inventory} | |||||
| </if> | |||||
| <if test=" null != remark "> | |||||
| and `remark` like concat('%', #{remark},'%') | |||||
| </if> | |||||
| <if test=" null != status"> | |||||
| and `status` = #{status} | |||||
| </if> | |||||
| <if test=" null != startdate and null!=enddate"> | |||||
| and `create_date` between #{startdate} and #{enddate} | |||||
| </if> | |||||
| <if test=" null != updateDate "> | |||||
| and `update_date` = #{updateDate} | |||||
| </if> | |||||
| <if test=" null != business "> | |||||
| and `business` = #{business} | |||||
| </if> | |||||
| <if test=" null != supportTransfer "> | |||||
| and `support_transfer` = #{supportTransfer} | |||||
| </if> | |||||
| <if test=" null != subsidyType "> | |||||
| and `subsidy_type` = #{subsidyType} | |||||
| </if> | |||||
| <if test=" null != subsidyNum "> | |||||
| and `subsidy_num` = #{subsidyNum} | |||||
| </if> | |||||
| <if test=" null != pressLimitNum "> | |||||
| and `press_limit_num` = #{pressLimitNum} | |||||
| <if test=" null != autoRefund "> | |||||
| and `auto_refund` = #{autoRefund} | |||||
| </if> | </if> | ||||
| <if test=" null != pressLimitHours "> | |||||
| and `press_limit_hours` = #{pressLimitHours} | |||||
| </if> | |||||
| <if test=" null != ids "> | <if test=" null != ids "> | ||||
| and id in | and id in | ||||
| @@ -471,140 +346,6 @@ | |||||
| <include refid="dynamicWhereConditionsForCoupon"/> | <include refid="dynamicWhereConditionsForCoupon"/> | ||||
| </select> | </select> | ||||
| <sql id="dynamicWhereConditionsForPress"> | |||||
| where `type` = 8 | |||||
| <if test=" null != id "> | |||||
| and `id` = #{id} | |||||
| </if> | |||||
| <if test=" null != tenantId "> | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | |||||
| <if test=" null != type "> | |||||
| and `type` = #{type} | |||||
| </if> | |||||
| <if test=" null != coverImg "> | |||||
| and `cover_img` like concat('%', #{coverImg},'%') | |||||
| </if> | |||||
| <if test=" null != title and ''!=title"> | |||||
| and `title` like concat('%', #{title},'%') | |||||
| </if> | |||||
| <if test=" null != subTitle "> | |||||
| and `sub_title` like concat('%', #{subTitle},'%') | |||||
| </if> | |||||
| <if test=" null != salePrice "> | |||||
| and `sale_price` = #{salePrice} | |||||
| </if> | |||||
| <if test=" null != usePrice "> | |||||
| and `use_price` = #{usePrice} | |||||
| </if> | |||||
| <if test=" null != useLimitQuantity "> | |||||
| and `use_limit_quantity` = #{useLimitQuantity} | |||||
| </if> | |||||
| <if test=" null != sendType "> | |||||
| and `send_type` = #{sendType} | |||||
| </if> | |||||
| <if test=" null != validType "> | |||||
| and `valid_type` = #{validType} | |||||
| </if> | |||||
| <if test=" null != validStartDate "> | |||||
| and `valid_start_date` = #{validStartDate} | |||||
| </if> | |||||
| <if test=" null != validEndDate "> | |||||
| and `valid_end_date` = #{validEndDate} | |||||
| </if> | |||||
| <if test=" null != validDays "> | |||||
| and `valid_days` = #{validDays} | |||||
| </if> | |||||
| <if test=" null != detail "> | |||||
| and `detail` like concat('%', #{detail},'%') | |||||
| </if> | |||||
| <if test=" null != price "> | |||||
| and `price` = #{price} | |||||
| </if> | |||||
| <if test=" null != unit "> | |||||
| and `unit` = #{unit} | |||||
| </if> | |||||
| <if test=" null != remainInventory "> | |||||
| and `remain_inventory` = #{remainInventory} | |||||
| </if> | |||||
| <if test=" null != inventory "> | |||||
| and `inventory` = #{inventory} | |||||
| </if> | |||||
| <if test=" null != remark "> | |||||
| and `remark` like concat('%', #{remark},'%') | |||||
| </if> | |||||
| <if test=" null != status"> | |||||
| and `status` = #{status} | |||||
| </if> | |||||
| <if test=" null != startdate and null!=enddate"> | |||||
| and `create_date` between #{startdate} and #{enddate} | |||||
| </if> | |||||
| <if test=" null != updateDate "> | |||||
| and `update_date` = #{updateDate} | |||||
| </if> | |||||
| <if test=" null != business "> | |||||
| and `business` = #{business} | |||||
| </if> | |||||
| <if test=" null != supportTransfer "> | |||||
| and `support_transfer` = #{supportTransfer} | |||||
| </if> | |||||
| <if test=" null != subsidyType "> | |||||
| and `subsidy_type` = #{subsidyType} | |||||
| </if> | |||||
| <if test=" null != subsidyNum "> | |||||
| and `subsidy_num` = #{subsidyNum} | |||||
| </if> | |||||
| <if test=" null != pressLimitNum "> | |||||
| and `press_limit_num` = #{pressLimitNum} | |||||
| </if> | |||||
| <if test=" null != pressLimitHours "> | |||||
| and `press_limit_hours` = #{pressLimitHours} | |||||
| </if> | |||||
| <if test=" null != ids "> | |||||
| and id in | |||||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||||
| #{idItem} | |||||
| </foreach> | |||||
| </if> | |||||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||||
| </sql> | |||||
| <select id="findPressList" parameterType="com.iformall.domain.po.WxCoupon" resultMap="BaseResultMap"> | |||||
| select | |||||
| <include refid="allColumns"/> | |||||
| from wx_coupon | |||||
| <include refid="dynamicWhereConditionsForPress"/> | |||||
| </select> | |||||
| <resultMap id="WxCouponCVoMap" type="com.iformall.domain.vo.WxCouponCVo"> | <resultMap id="WxCouponCVoMap" type="com.iformall.domain.vo.WxCouponCVo"> | ||||
| <id column="id" jdbcType="BIGINT" property="id"/> | <id column="id" jdbcType="BIGINT" property="id"/> | ||||