部分修改
This commit is contained in:
parent
0659f26e62
commit
483721db8f
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -23,10 +23,10 @@ public class SmsCouponController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private SmsCouponService couponService;
|
private SmsCouponService couponService;
|
||||||
@ApiOperation("添加优惠券")
|
@ApiOperation("添加优惠券")
|
||||||
@RequestMapping(value = "/add", method = RequestMethod.POST)
|
@RequestMapping(value = "/create", method = RequestMethod.POST)
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public Object add(@RequestBody SmsCouponParam couponParam) {
|
public Object add(@RequestBody SmsCouponParam couponParam) {
|
||||||
int count = couponService.add(couponParam);
|
int count = couponService.create(couponParam);
|
||||||
if(count>0){
|
if(count>0){
|
||||||
return new CommonResult().success(count);
|
return new CommonResult().success(count);
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ public interface SmsCouponService {
|
|||||||
* 添加优惠券
|
* 添加优惠券
|
||||||
*/
|
*/
|
||||||
@Transactional
|
@Transactional
|
||||||
int add(SmsCouponParam couponParam);
|
int create(SmsCouponParam couponParam);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据优惠券id删除优惠券
|
* 根据优惠券id删除优惠券
|
||||||
|
@ -35,7 +35,10 @@ public class SmsCouponServiceImpl implements SmsCouponService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private SmsCouponDao couponDao;
|
private SmsCouponDao couponDao;
|
||||||
@Override
|
@Override
|
||||||
public int add(SmsCouponParam couponParam) {
|
public int create(SmsCouponParam couponParam) {
|
||||||
|
couponParam.setCount(couponParam.getPublishCount());
|
||||||
|
couponParam.setUseCount(0);
|
||||||
|
couponParam.setReceiveCount(0);
|
||||||
//插入优惠券表
|
//插入优惠券表
|
||||||
int count = couponMapper.insert(couponParam);
|
int count = couponMapper.insert(couponParam);
|
||||||
//插入优惠券和商品关系表
|
//插入优惠券和商品关系表
|
||||||
|
@ -111,13 +111,6 @@ public class SmsCoupon implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private Integer memberLevel;
|
private Integer memberLevel;
|
||||||
|
|
||||||
/**
|
|
||||||
* 发行数量:0->表示无限制
|
|
||||||
*
|
|
||||||
* @mbggenerated
|
|
||||||
*/
|
|
||||||
private Integer distributionCount;
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
public Long getId() {
|
public Long getId() {
|
||||||
@ -264,14 +257,6 @@ public class SmsCoupon implements Serializable {
|
|||||||
this.memberLevel = memberLevel;
|
this.memberLevel = memberLevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getDistributionCount() {
|
|
||||||
return distributionCount;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDistributionCount(Integer distributionCount) {
|
|
||||||
this.distributionCount = distributionCount;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
@ -296,7 +281,6 @@ public class SmsCoupon implements Serializable {
|
|||||||
sb.append(", enableTime=").append(enableTime);
|
sb.append(", enableTime=").append(enableTime);
|
||||||
sb.append(", code=").append(code);
|
sb.append(", code=").append(code);
|
||||||
sb.append(", memberLevel=").append(memberLevel);
|
sb.append(", memberLevel=").append(memberLevel);
|
||||||
sb.append(", distributionCount=").append(distributionCount);
|
|
||||||
sb.append(", serialVersionUID=").append(serialVersionUID);
|
sb.append(", serialVersionUID=").append(serialVersionUID);
|
||||||
sb.append("]");
|
sb.append("]");
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
|
@ -1215,66 +1215,6 @@ public class SmsCouponExample {
|
|||||||
addCriterion("member_level not between", value1, value2, "memberLevel");
|
addCriterion("member_level not between", value1, value2, "memberLevel");
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Criteria andDistributionCountIsNull() {
|
|
||||||
addCriterion("distribution_count is null");
|
|
||||||
return (Criteria) this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Criteria andDistributionCountIsNotNull() {
|
|
||||||
addCriterion("distribution_count is not null");
|
|
||||||
return (Criteria) this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Criteria andDistributionCountEqualTo(Integer value) {
|
|
||||||
addCriterion("distribution_count =", value, "distributionCount");
|
|
||||||
return (Criteria) this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Criteria andDistributionCountNotEqualTo(Integer value) {
|
|
||||||
addCriterion("distribution_count <>", value, "distributionCount");
|
|
||||||
return (Criteria) this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Criteria andDistributionCountGreaterThan(Integer value) {
|
|
||||||
addCriterion("distribution_count >", value, "distributionCount");
|
|
||||||
return (Criteria) this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Criteria andDistributionCountGreaterThanOrEqualTo(Integer value) {
|
|
||||||
addCriterion("distribution_count >=", value, "distributionCount");
|
|
||||||
return (Criteria) this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Criteria andDistributionCountLessThan(Integer value) {
|
|
||||||
addCriterion("distribution_count <", value, "distributionCount");
|
|
||||||
return (Criteria) this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Criteria andDistributionCountLessThanOrEqualTo(Integer value) {
|
|
||||||
addCriterion("distribution_count <=", value, "distributionCount");
|
|
||||||
return (Criteria) this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Criteria andDistributionCountIn(List<Integer> values) {
|
|
||||||
addCriterion("distribution_count in", values, "distributionCount");
|
|
||||||
return (Criteria) this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Criteria andDistributionCountNotIn(List<Integer> values) {
|
|
||||||
addCriterion("distribution_count not in", values, "distributionCount");
|
|
||||||
return (Criteria) this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Criteria andDistributionCountBetween(Integer value1, Integer value2) {
|
|
||||||
addCriterion("distribution_count between", value1, value2, "distributionCount");
|
|
||||||
return (Criteria) this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Criteria andDistributionCountNotBetween(Integer value1, Integer value2) {
|
|
||||||
addCriterion("distribution_count not between", value1, value2, "distributionCount");
|
|
||||||
return (Criteria) this;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Criteria extends GeneratedCriteria {
|
public static class Criteria extends GeneratedCriteria {
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
<result column="enable_time" jdbcType="TIMESTAMP" property="enableTime" />
|
<result column="enable_time" jdbcType="TIMESTAMP" property="enableTime" />
|
||||||
<result column="code" jdbcType="VARCHAR" property="code" />
|
<result column="code" jdbcType="VARCHAR" property="code" />
|
||||||
<result column="member_level" jdbcType="INTEGER" property="memberLevel" />
|
<result column="member_level" jdbcType="INTEGER" property="memberLevel" />
|
||||||
<result column="distribution_count" jdbcType="INTEGER" property="distributionCount" />
|
|
||||||
</resultMap>
|
</resultMap>
|
||||||
<sql id="Example_Where_Clause">
|
<sql id="Example_Where_Clause">
|
||||||
<where>
|
<where>
|
||||||
@ -82,8 +81,7 @@
|
|||||||
</sql>
|
</sql>
|
||||||
<sql id="Base_Column_List">
|
<sql id="Base_Column_List">
|
||||||
id, type, name, platform, count, amount, per_limit, min_point, start_time, end_time,
|
id, type, name, platform, count, amount, per_limit, min_point, start_time, end_time,
|
||||||
use_type, note, publish_count, use_count, receive_count, enable_time, code, member_level,
|
use_type, note, publish_count, use_count, receive_count, enable_time, code, member_level
|
||||||
distribution_count
|
|
||||||
</sql>
|
</sql>
|
||||||
<select id="selectByExample" parameterType="com.macro.mall.model.SmsCouponExample" resultMap="BaseResultMap">
|
<select id="selectByExample" parameterType="com.macro.mall.model.SmsCouponExample" resultMap="BaseResultMap">
|
||||||
select
|
select
|
||||||
@ -124,15 +122,13 @@
|
|||||||
min_point, start_time, end_time,
|
min_point, start_time, end_time,
|
||||||
use_type, note, publish_count,
|
use_type, note, publish_count,
|
||||||
use_count, receive_count, enable_time,
|
use_count, receive_count, enable_time,
|
||||||
code, member_level, distribution_count
|
code, member_level)
|
||||||
)
|
|
||||||
values (#{type,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{platform,jdbcType=INTEGER},
|
values (#{type,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{platform,jdbcType=INTEGER},
|
||||||
#{count,jdbcType=INTEGER}, #{amount,jdbcType=DECIMAL}, #{perLimit,jdbcType=INTEGER},
|
#{count,jdbcType=INTEGER}, #{amount,jdbcType=DECIMAL}, #{perLimit,jdbcType=INTEGER},
|
||||||
#{minPoint,jdbcType=DECIMAL}, #{startTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP},
|
#{minPoint,jdbcType=DECIMAL}, #{startTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP},
|
||||||
#{useType,jdbcType=INTEGER}, #{note,jdbcType=VARCHAR}, #{publishCount,jdbcType=INTEGER},
|
#{useType,jdbcType=INTEGER}, #{note,jdbcType=VARCHAR}, #{publishCount,jdbcType=INTEGER},
|
||||||
#{useCount,jdbcType=INTEGER}, #{receiveCount,jdbcType=INTEGER}, #{enableTime,jdbcType=TIMESTAMP},
|
#{useCount,jdbcType=INTEGER}, #{receiveCount,jdbcType=INTEGER}, #{enableTime,jdbcType=TIMESTAMP},
|
||||||
#{code,jdbcType=VARCHAR}, #{memberLevel,jdbcType=INTEGER}, #{distributionCount,jdbcType=INTEGER}
|
#{code,jdbcType=VARCHAR}, #{memberLevel,jdbcType=INTEGER})
|
||||||
)
|
|
||||||
</insert>
|
</insert>
|
||||||
<insert id="insertSelective" parameterType="com.macro.mall.model.SmsCoupon">
|
<insert id="insertSelective" parameterType="com.macro.mall.model.SmsCoupon">
|
||||||
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
|
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
|
||||||
@ -191,9 +187,6 @@
|
|||||||
<if test="memberLevel != null">
|
<if test="memberLevel != null">
|
||||||
member_level,
|
member_level,
|
||||||
</if>
|
</if>
|
||||||
<if test="distributionCount != null">
|
|
||||||
distribution_count,
|
|
||||||
</if>
|
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
<if test="type != null">
|
<if test="type != null">
|
||||||
@ -247,9 +240,6 @@
|
|||||||
<if test="memberLevel != null">
|
<if test="memberLevel != null">
|
||||||
#{memberLevel,jdbcType=INTEGER},
|
#{memberLevel,jdbcType=INTEGER},
|
||||||
</if>
|
</if>
|
||||||
<if test="distributionCount != null">
|
|
||||||
#{distributionCount,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
<select id="countByExample" parameterType="com.macro.mall.model.SmsCouponExample" resultType="java.lang.Integer">
|
<select id="countByExample" parameterType="com.macro.mall.model.SmsCouponExample" resultType="java.lang.Integer">
|
||||||
@ -315,9 +305,6 @@
|
|||||||
<if test="record.memberLevel != null">
|
<if test="record.memberLevel != null">
|
||||||
member_level = #{record.memberLevel,jdbcType=INTEGER},
|
member_level = #{record.memberLevel,jdbcType=INTEGER},
|
||||||
</if>
|
</if>
|
||||||
<if test="record.distributionCount != null">
|
|
||||||
distribution_count = #{record.distributionCount,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
</set>
|
</set>
|
||||||
<if test="_parameter != null">
|
<if test="_parameter != null">
|
||||||
<include refid="Update_By_Example_Where_Clause" />
|
<include refid="Update_By_Example_Where_Clause" />
|
||||||
@ -342,8 +329,7 @@
|
|||||||
receive_count = #{record.receiveCount,jdbcType=INTEGER},
|
receive_count = #{record.receiveCount,jdbcType=INTEGER},
|
||||||
enable_time = #{record.enableTime,jdbcType=TIMESTAMP},
|
enable_time = #{record.enableTime,jdbcType=TIMESTAMP},
|
||||||
code = #{record.code,jdbcType=VARCHAR},
|
code = #{record.code,jdbcType=VARCHAR},
|
||||||
member_level = #{record.memberLevel,jdbcType=INTEGER},
|
member_level = #{record.memberLevel,jdbcType=INTEGER}
|
||||||
distribution_count = #{record.distributionCount,jdbcType=INTEGER}
|
|
||||||
<if test="_parameter != null">
|
<if test="_parameter != null">
|
||||||
<include refid="Update_By_Example_Where_Clause" />
|
<include refid="Update_By_Example_Where_Clause" />
|
||||||
</if>
|
</if>
|
||||||
@ -402,9 +388,6 @@
|
|||||||
<if test="memberLevel != null">
|
<if test="memberLevel != null">
|
||||||
member_level = #{memberLevel,jdbcType=INTEGER},
|
member_level = #{memberLevel,jdbcType=INTEGER},
|
||||||
</if>
|
</if>
|
||||||
<if test="distributionCount != null">
|
|
||||||
distribution_count = #{distributionCount,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
</set>
|
</set>
|
||||||
where id = #{id,jdbcType=BIGINT}
|
where id = #{id,jdbcType=BIGINT}
|
||||||
</update>
|
</update>
|
||||||
@ -426,8 +409,7 @@
|
|||||||
receive_count = #{receiveCount,jdbcType=INTEGER},
|
receive_count = #{receiveCount,jdbcType=INTEGER},
|
||||||
enable_time = #{enableTime,jdbcType=TIMESTAMP},
|
enable_time = #{enableTime,jdbcType=TIMESTAMP},
|
||||||
code = #{code,jdbcType=VARCHAR},
|
code = #{code,jdbcType=VARCHAR},
|
||||||
member_level = #{memberLevel,jdbcType=INTEGER},
|
member_level = #{memberLevel,jdbcType=INTEGER}
|
||||||
distribution_count = #{distributionCount,jdbcType=INTEGER}
|
|
||||||
where id = #{id,jdbcType=BIGINT}
|
where id = #{id,jdbcType=BIGINT}
|
||||||
</update>
|
</update>
|
||||||
</mapper>
|
</mapper>
|
Loading…
x
Reference in New Issue
Block a user