Skip to content

Commit

Permalink
部分修改
Browse files Browse the repository at this point in the history
  • Loading branch information
zhh committed Nov 8, 2018
1 parent 0659f26 commit 483721d
Show file tree
Hide file tree
Showing 8 changed files with 1,197 additions and 1,283 deletions.
1,054 changes: 535 additions & 519 deletions document/pdm/mall.pdb

Large diffs are not rendered by default.

1,311 changes: 650 additions & 661 deletions document/pdm/mall.pdm

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ public class SmsCouponController {
@Autowired
private SmsCouponService couponService;
@ApiOperation("添加优惠券")
@RequestMapping(value = "/add", method = RequestMethod.POST)
@RequestMapping(value = "/create", method = RequestMethod.POST)
@ResponseBody
public Object add(@RequestBody SmsCouponParam couponParam) {
int count = couponService.add(couponParam);
int count = couponService.create(couponParam);
if(count>0){
return new CommonResult().success(count);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public interface SmsCouponService {
* 添加优惠券
*/
@Transactional
int add(SmsCouponParam couponParam);
int create(SmsCouponParam couponParam);

/**
* 根据优惠券id删除优惠券
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ public class SmsCouponServiceImpl implements SmsCouponService {
@Autowired
private SmsCouponDao couponDao;
@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);
//插入优惠券和商品关系表
Expand Down
16 changes: 0 additions & 16 deletions mall-mbg/src/main/java/com/macro/mall/model/SmsCoupon.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,6 @@ public class SmsCoupon implements Serializable {
*/
private Integer memberLevel;

/**
* 发行数量:0->表示无限制
*
* @mbggenerated
*/
private Integer distributionCount;

private static final long serialVersionUID = 1L;

public Long getId() {
Expand Down Expand Up @@ -264,14 +257,6 @@ public void setMemberLevel(Integer memberLevel) {
this.memberLevel = memberLevel;
}

public Integer getDistributionCount() {
return distributionCount;
}

public void setDistributionCount(Integer distributionCount) {
this.distributionCount = distributionCount;
}

@Override
public String toString() {
StringBuilder sb = new StringBuilder();
Expand All @@ -296,7 +281,6 @@ public String toString() {
sb.append(", enableTime=").append(enableTime);
sb.append(", code=").append(code);
sb.append(", memberLevel=").append(memberLevel);
sb.append(", distributionCount=").append(distributionCount);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
Expand Down
60 changes: 0 additions & 60 deletions mall-mbg/src/main/java/com/macro/mall/model/SmsCouponExample.java
Original file line number Diff line number Diff line change
Expand Up @@ -1215,66 +1215,6 @@ public Criteria andMemberLevelNotBetween(Integer value1, Integer value2) {
addCriterion("member_level not between", value1, value2, "memberLevel");
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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
<result column="enable_time" jdbcType="TIMESTAMP" property="enableTime" />
<result column="code" jdbcType="VARCHAR" property="code" />
<result column="member_level" jdbcType="INTEGER" property="memberLevel" />
<result column="distribution_count" jdbcType="INTEGER" property="distributionCount" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
Expand Down Expand Up @@ -82,8 +81,7 @@
</sql>
<sql id="Base_Column_List">
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,
distribution_count
use_type, note, publish_count, use_count, receive_count, enable_time, code, member_level
</sql>
<select id="selectByExample" parameterType="com.macro.mall.model.SmsCouponExample" resultMap="BaseResultMap">
select
Expand Down Expand Up @@ -124,15 +122,13 @@
min_point, start_time, end_time,
use_type, note, publish_count,
use_count, receive_count, enable_time,
code, member_level, distribution_count
)
code, member_level)
values (#{type,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{platform,jdbcType=INTEGER},
#{count,jdbcType=INTEGER}, #{amount,jdbcType=DECIMAL}, #{perLimit,jdbcType=INTEGER},
#{minPoint,jdbcType=DECIMAL}, #{startTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP},
#{useType,jdbcType=INTEGER}, #{note,jdbcType=VARCHAR}, #{publishCount,jdbcType=INTEGER},
#{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 id="insertSelective" parameterType="com.macro.mall.model.SmsCoupon">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
Expand Down Expand Up @@ -191,9 +187,6 @@
<if test="memberLevel != null">
member_level,
</if>
<if test="distributionCount != null">
distribution_count,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="type != null">
Expand Down Expand Up @@ -247,9 +240,6 @@
<if test="memberLevel != null">
#{memberLevel,jdbcType=INTEGER},
</if>
<if test="distributionCount != null">
#{distributionCount,jdbcType=INTEGER},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.macro.mall.model.SmsCouponExample" resultType="java.lang.Integer">
Expand Down Expand Up @@ -315,9 +305,6 @@
<if test="record.memberLevel != null">
member_level = #{record.memberLevel,jdbcType=INTEGER},
</if>
<if test="record.distributionCount != null">
distribution_count = #{record.distributionCount,jdbcType=INTEGER},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
Expand All @@ -342,8 +329,7 @@
receive_count = #{record.receiveCount,jdbcType=INTEGER},
enable_time = #{record.enableTime,jdbcType=TIMESTAMP},
code = #{record.code,jdbcType=VARCHAR},
member_level = #{record.memberLevel,jdbcType=INTEGER},
distribution_count = #{record.distributionCount,jdbcType=INTEGER}
member_level = #{record.memberLevel,jdbcType=INTEGER}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
Expand Down Expand Up @@ -402,9 +388,6 @@
<if test="memberLevel != null">
member_level = #{memberLevel,jdbcType=INTEGER},
</if>
<if test="distributionCount != null">
distribution_count = #{distributionCount,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
Expand All @@ -426,8 +409,7 @@
receive_count = #{receiveCount,jdbcType=INTEGER},
enable_time = #{enableTime,jdbcType=TIMESTAMP},
code = #{code,jdbcType=VARCHAR},
member_level = #{memberLevel,jdbcType=INTEGER},
distribution_count = #{distributionCount,jdbcType=INTEGER}
member_level = #{memberLevel,jdbcType=INTEGER}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

0 comments on commit 483721d

Please sign in to comment.