commit
8c84841362
@ -0,0 +1,4 @@
|
||||
package cn.iocoder.mall.promotion.api.bo;
|
||||
|
||||
public class CouponCardBO {
|
||||
}
|
||||
@ -0,0 +1,4 @@
|
||||
package cn.iocoder.mall.promotion.api.bo;
|
||||
|
||||
public class CouponCardTemplateBO {
|
||||
}
|
||||
@ -0,0 +1,5 @@
|
||||
package cn.iocoder.mall.promotion.api.bo;
|
||||
|
||||
public class CouponCardTemplatePageBO {
|
||||
|
||||
}
|
||||
@ -0,0 +1,4 @@
|
||||
package cn.iocoder.mall.promotion.api.bo;
|
||||
|
||||
public class CouponCodeTemplateBO {
|
||||
}
|
||||
@ -0,0 +1,4 @@
|
||||
package cn.iocoder.mall.promotion.api.bo;
|
||||
|
||||
public class CouponCodeTemplatePageBO {
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
package cn.iocoder.mall.promotion.api.dto;
|
||||
|
||||
/**
|
||||
* 优惠劵模板分页 DTO
|
||||
*/
|
||||
public class CouponCardTemplatePageDTO {
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
private String title;
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 优惠类型
|
||||
*/
|
||||
private Integer preferentialType;
|
||||
|
||||
}
|
||||
@ -0,0 +1,4 @@
|
||||
package cn.iocoder.mall.promotion.api.dto;
|
||||
|
||||
public class CouponCardTemplateUpdateDTO {
|
||||
}
|
||||
@ -0,0 +1,4 @@
|
||||
package cn.iocoder.mall.promotion.api.dto;
|
||||
|
||||
public class CouponCodeTemplateAddDTO {
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
package cn.iocoder.mall.promotion.api.dto;
|
||||
|
||||
/**
|
||||
* 优惠码模板分页 DTO
|
||||
*/
|
||||
public class CouponCodeTemplatePageDTO {
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
private String title;
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 优惠类型
|
||||
*/
|
||||
private Integer preferentialType;
|
||||
|
||||
}
|
||||
@ -0,0 +1,4 @@
|
||||
package cn.iocoder.mall.promotion.api.dto;
|
||||
|
||||
public class CouponCodeTemplateUpdateDTO {
|
||||
}
|
||||
@ -0,0 +1,28 @@
|
||||
package cn.iocoder.mall.promotion.biz.dao;
|
||||
|
||||
import cn.iocoder.mall.promotion.biz.dataobject.CouponTemplateDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Repository
|
||||
public interface CouponTemplateMapper {
|
||||
|
||||
CouponTemplateDO selectById(@Param("id") Integer id);
|
||||
|
||||
List<CouponTemplateDO> selectListByPage(@Param("title") String title,
|
||||
@Param("status") Integer status,
|
||||
@Param("preferentialType") Integer preferentialType,
|
||||
@Param("offset") Integer offset,
|
||||
@Param("limit") Integer limit);
|
||||
|
||||
Integer selectCountByPage(@Param("title") String title,
|
||||
@Param("status") Integer status,
|
||||
@Param("preferentialType") Integer preferentialType);
|
||||
|
||||
void insert(CouponTemplateDO couponTemplate);
|
||||
|
||||
int update(CouponTemplateDO couponTemplate);
|
||||
|
||||
}
|
||||
@ -0,0 +1,4 @@
|
||||
package cn.iocoder.mall.promotion.biz.service;
|
||||
|
||||
public class CouponServiceImpl {
|
||||
}
|
||||
@ -0,0 +1,143 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="cn.iocoder.mall.promotion.biz.dao.CouponTemplateMapper">
|
||||
|
||||
<sql id="FIELDS">
|
||||
id, title, description, type, code_type,
|
||||
status, quota, stock, price_available, range_type,
|
||||
range_values, date_type, valid_start_time, valid_end_time, fixed_term,
|
||||
preferential_type, percent_off, price_off, discount_price_limit, stat_fetch_num,
|
||||
create_time
|
||||
</sql>
|
||||
|
||||
<!-- <select id="selectListByPidAndStatusOrderBySort" resultType="CouponTemplateDO">-->
|
||||
<!-- SELECT-->
|
||||
<!-- <include refid="FIELDS" />-->
|
||||
<!-- FROM coupon_template-->
|
||||
<!-- WHERE pid = #{pid}-->
|
||||
<!-- AND status = #{status}-->
|
||||
<!-- AND deleted = 0-->
|
||||
<!-- ORDER BY sort ASC-->
|
||||
<!-- </select>-->
|
||||
|
||||
<!-- <select id="selectList" resultType="CouponTemplateDO">-->
|
||||
<!-- SELECT-->
|
||||
<!-- <include refid="FIELDS" />-->
|
||||
<!-- FROM coupon_template-->
|
||||
<!-- WHERE deleted = 0-->
|
||||
<!-- </select>-->
|
||||
|
||||
<select id="selectById" parameterType="Integer" resultType="CouponTemplateDO">
|
||||
SELECT
|
||||
<include refid="FIELDS" />
|
||||
FROM coupon_template
|
||||
WHERE id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="selectListByPage" resultType="CouponTemplateDO">
|
||||
SELECT
|
||||
<include refid="FIELDS" />
|
||||
FROM coupon_template
|
||||
<where>
|
||||
<if test="title != null">
|
||||
title LIKE "%"#{title}"%"
|
||||
</if>
|
||||
<if test="status != null">
|
||||
AND status = #{status}
|
||||
</if>
|
||||
<if test="preferentialType != null">
|
||||
AND preferential_type = #{preferentialType}
|
||||
</if>
|
||||
</where>
|
||||
LIMIT #{offset}, #{limit}
|
||||
</select>
|
||||
|
||||
<select id="selectCountByPage" resultType="Integer">
|
||||
SELECT
|
||||
COUNT(1)
|
||||
FROM coupon_template
|
||||
<where>
|
||||
<if test="title != null">
|
||||
title LIKE "%"#{title}"%"
|
||||
</if>
|
||||
<if test="status != null">
|
||||
AND status = #{status}
|
||||
</if>
|
||||
<if test="preferentialType != null">
|
||||
AND preferential_type = #{preferentialType}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<insert id="insert" parameterType="CouponTemplateDO" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
|
||||
INSERT INTO coupon_template (
|
||||
title, description, type, code_type,
|
||||
status, quota, stock, price_available, range_type,
|
||||
range_values, date_type, valid_start_time, valid_end_time, fixed_term,
|
||||
preferential_type, percent_off, price_off, discount_price_limit, stat_fetch_num,
|
||||
create_time
|
||||
) VALUES (
|
||||
#{title}, #{description, #{type, #{code_type},
|
||||
#{status}, #{quota, #{stock}, #{priceAvailable}, #{rangeType},
|
||||
#{rangeValues}, #{dateType}, #{validStartTime}, #{validEndTime, #{fixedTerm},
|
||||
#{preferentialType, #{percentOff}, #{priceOff}, #{discountPriceLimit}, #{statFetchNum},
|
||||
#{createTime}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="update" parameterType="CouponTemplateDO">
|
||||
UPDATE coupon_template
|
||||
<set>
|
||||
<if test="title != null">
|
||||
title = #{title},
|
||||
</if>
|
||||
<if test="description != null">
|
||||
description = #{description},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
status = #{status},
|
||||
</if>
|
||||
<if test="quota != null">
|
||||
quota = #{quota},
|
||||
</if>
|
||||
<if test="stock != null">
|
||||
stock = #{stock},
|
||||
</if>
|
||||
<if test="priceAvailable != null">
|
||||
price_available = #{priceAvailable}
|
||||
</if>
|
||||
<if test="rangeType != null">
|
||||
range_type = #{rangeType}
|
||||
</if>
|
||||
<if test="rangeValues != null">
|
||||
range_values = #{rangeValues}
|
||||
</if>
|
||||
<if test="dateType != null">
|
||||
date_type = #{dateType}
|
||||
</if>
|
||||
<if test="validStartTime != null">
|
||||
valid_start_time = #{validStartTime}
|
||||
</if>
|
||||
<if test="validEndTime != null">
|
||||
valid_end_time = #{validEndTime}
|
||||
</if>
|
||||
<if test="fixedTerm != null">
|
||||
fixed_term = #{fixedTerm}
|
||||
</if>
|
||||
<if test="preferentialType != null">
|
||||
preferential_type = #{preferentialType}
|
||||
</if>
|
||||
<if test="percentOff != null">
|
||||
percent_off = #{percentOff}
|
||||
</if>
|
||||
<if test="priceOff != null">
|
||||
price_off = #{priceOff}
|
||||
</if>
|
||||
<if test="discountPriceLimit != null">
|
||||
discount_price_limit = #{discountPriceLimit}
|
||||
</if>
|
||||
</set>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
Loading…
Reference in new issue