Просмотр исходного кода

[砍价][新增]:砍价相关接口

release_toaliyun_real
Stormeye Wu 7 лет назад
Родитель
Сommit
f54eaccdd2
4 измененных файлов: 151 добавлений и 5 удалений
  1. +11
    -1
      mallinkAdmin/src/main/java/com/iformall/controller/WxCouponController.java
  2. +1
    -0
      mallinkService/src/main/java/com/iformall/mapper/WxCouponMapper.java
  3. +4
    -4
      mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java
  4. +135
    -0
      mallinkService/src/main/resources/mapper/WxCouponMapper.xml

+ 11
- 1
mallinkAdmin/src/main/java/com/iformall/controller/WxCouponController.java Просмотреть файл

@@ -102,7 +102,7 @@ public class WxCouponController extends BaseController {
return listType(wxCoupon, pageNum, pageSize, 0); //券列表
}

@ApiOperation("分页列表接口")
@ApiOperation("分页列表接口")
@GetMapping("listCard")
@ApiImplicitParams({
@ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true),
@@ -112,6 +112,16 @@ public class WxCouponController extends BaseController {
return 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");
return listType(wxCoupon, pageNum, pageSize, EnumCouponType.COUPON_PRESS.getCode()); //砍价列表
}

@ApiOperation("分页列表接口")
@GetMapping("list")
@ApiImplicitParams({


+ 1
- 0
mallinkService/src/main/java/com/iformall/mapper/WxCouponMapper.java Просмотреть файл

@@ -12,6 +12,7 @@ public interface WxCouponMapper extends CommonMapper<WxCoupon, Long> {
List<WxCoupon> findList(WxCoupon wxCoupon);
List<WxCoupon> findCardList(WxCoupon wxCoupon);
List<WxCoupon> findCouponList(WxCoupon wxCoupon);
List<WxCoupon> findPressList(WxCoupon wxCoupon);

WxCouponCVo findVoDetail(@Param("id")Long id);



+ 4
- 4
mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java Просмотреть файл

@@ -51,11 +51,11 @@ public class WxCouponServiceImpl implements WxCouponService {
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())) {
} else if (type.equals(EnumCouponType.CARD_MULTIMCH.getCode())) {
return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCouponMapper.findCardList(record));
}
else {
} 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));
}
}


+ 135
- 0
mallinkService/src/main/resources/mapper/WxCouponMapper.xml Просмотреть файл

@@ -445,6 +445,141 @@
<include refid="dynamicWhereConditionsForCoupon"/>
</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">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>


Загрузка…
Отмена
Сохранить