添加优惠券管理接口
This commit is contained in:
parent
a5faaf1567
commit
201b405a08
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?PowerDesigner AppLocale="UTF16" ID="{7BB41C87-EFE8-409A-A86E-B1C3FCE34F8C}" Label="" LastModificationDate="1535439531" Name="mall" Objects="1022" Symbols="127" Target="MySQL 5.0" Type="{CDE44E21-9669-11D1-9914-006097355D9B}" signature="PDM_DATA_MODEL_XML" version="16.5.0.3982"?>
|
||||
<?PowerDesigner AppLocale="UTF16" ID="{7BB41C87-EFE8-409A-A86E-B1C3FCE34F8C}" Label="" LastModificationDate="1535445907" Name="mall" Objects="1023" Symbols="127" Target="MySQL 5.0" Type="{CDE44E21-9669-11D1-9914-006097355D9B}" signature="PDM_DATA_MODEL_XML" version="16.5.0.3982"?>
|
||||
<!-- do not edit this file -->
|
||||
|
||||
<Model xmlns:a="attribute" xmlns:c="collection" xmlns:o="object">
|
||||
@ -4739,8 +4739,8 @@ DESTINATION 0 新宋体,8,N</a:FontList>
|
||||
<o:ReferenceSymbol Id="o90">
|
||||
<a:CreationDate>1522215975</a:CreationDate>
|
||||
<a:ModificationDate>1522398810</a:ModificationDate>
|
||||
<a:Rect>((62000,154582), (65163,155832))</a:Rect>
|
||||
<a:ListOfPoints>((62400,155207),(64763,155207))</a:ListOfPoints>
|
||||
<a:Rect>((62000,154586), (65163,155836))</a:Rect>
|
||||
<a:ListOfPoints>((62400,155211),(64763,155211))</a:ListOfPoints>
|
||||
<a:CornerStyle>1</a:CornerStyle>
|
||||
<a:ArrowStyle>1</a:ArrowStyle>
|
||||
<a:LineColor>12615680</a:LineColor>
|
||||
@ -4783,8 +4783,8 @@ DESTINATION 0 新宋体,8,N</a:FontList>
|
||||
<o:ReferenceSymbol Id="o96">
|
||||
<a:CreationDate>1522216251</a:CreationDate>
|
||||
<a:ModificationDate>1522398808</a:ModificationDate>
|
||||
<a:Rect>((62486,144995), (65163,146245))</a:Rect>
|
||||
<a:ListOfPoints>((62886,145620),(64763,145620))</a:ListOfPoints>
|
||||
<a:Rect>((62486,144992), (65163,146242))</a:Rect>
|
||||
<a:ListOfPoints>((62886,145617),(64763,145617))</a:ListOfPoints>
|
||||
<a:CornerStyle>1</a:CornerStyle>
|
||||
<a:ArrowStyle>1</a:ArrowStyle>
|
||||
<a:LineColor>12615680</a:LineColor>
|
||||
@ -4827,8 +4827,8 @@ DESTINATION 0 新宋体,8,N</a:FontList>
|
||||
<o:ReferenceSymbol Id="o101">
|
||||
<a:CreationDate>1522220508</a:CreationDate>
|
||||
<a:ModificationDate>1522398822</a:ModificationDate>
|
||||
<a:Rect>((77597,151204), (82750,152454))</a:Rect>
|
||||
<a:ListOfPoints>((82350,151829),(77997,151829))</a:ListOfPoints>
|
||||
<a:Rect>((77597,151205), (82750,152455))</a:Rect>
|
||||
<a:ListOfPoints>((82350,151830),(77997,151830))</a:ListOfPoints>
|
||||
<a:CornerStyle>1</a:CornerStyle>
|
||||
<a:ArrowStyle>1</a:ArrowStyle>
|
||||
<a:LineColor>12615680</a:LineColor>
|
||||
@ -5356,8 +5356,8 @@ DESTINATION 0 新宋体,8,N</a:FontList>
|
||||
<o:ReferenceSymbol Id="o170">
|
||||
<a:CreationDate>1522724329</a:CreationDate>
|
||||
<a:ModificationDate>1522724329</a:ModificationDate>
|
||||
<a:Rect>((-100297,77071), (65163,153165))</a:Rect>
|
||||
<a:ListOfPoints>((-99897,102538),(-99897,77471),(35821,77471),(35821,152540),(64763,152540))</a:ListOfPoints>
|
||||
<a:Rect>((-100297,77071), (65163,153166))</a:Rect>
|
||||
<a:ListOfPoints>((-99897,102538),(-99897,77471),(35821,77471),(35821,152541),(64763,152541))</a:ListOfPoints>
|
||||
<a:CornerStyle>1</a:CornerStyle>
|
||||
<a:ArrowStyle>1</a:ArrowStyle>
|
||||
<a:LineColor>12615680</a:LineColor>
|
||||
@ -6285,7 +6285,7 @@ LABL 0 新宋体,8,N</a:FontList>
|
||||
<a:CreationDate>1522215010</a:CreationDate>
|
||||
<a:ModificationDate>1535438727</a:ModificationDate>
|
||||
<a:IconMode>-1</a:IconMode>
|
||||
<a:Rect>((64763,140886), (77997,157158))</a:Rect>
|
||||
<a:Rect>((64763,140885), (77997,157159))</a:Rect>
|
||||
<a:LineColor>12615680</a:LineColor>
|
||||
<a:FillColor>16570034</a:FillColor>
|
||||
<a:ShadowColor>12632256</a:ShadowColor>
|
||||
@ -11041,7 +11041,7 @@ LABL 0 新宋体,8,N</a:FontList>
|
||||
<a:Code>sms_coupon</a:Code>
|
||||
<a:CreationDate>1522215010</a:CreationDate>
|
||||
<a:Creator>zhenghong</a:Creator>
|
||||
<a:ModificationDate>1535439531</a:ModificationDate>
|
||||
<a:ModificationDate>1535444414</a:ModificationDate>
|
||||
<a:Modifier>zhenghong</a:Modifier>
|
||||
<a:Comment>优惠卷表</a:Comment>
|
||||
<a:TotalSavingCurrency/>
|
||||
@ -11087,10 +11087,10 @@ LABL 0 新宋体,8,N</a:FontList>
|
||||
<a:Code>platform</a:Code>
|
||||
<a:CreationDate>1522215086</a:CreationDate>
|
||||
<a:Creator>zhenghong</a:Creator>
|
||||
<a:ModificationDate>1522215279</a:ModificationDate>
|
||||
<a:ModificationDate>1535445907</a:ModificationDate>
|
||||
<a:Modifier>zhenghong</a:Modifier>
|
||||
<a:Comment>使用平台:0->全部;1->移动;2->PC</a:Comment>
|
||||
<a:DataType>varchar(1)</a:DataType>
|
||||
<a:DataType>int(1)</a:DataType>
|
||||
<a:Length>1</a:Length>
|
||||
</o:Column>
|
||||
<o:Column Id="o559">
|
||||
@ -11301,9 +11301,9 @@ LABL 0 新宋体,8,N</a:FontList>
|
||||
<a:Code>coupon_id</a:Code>
|
||||
<a:CreationDate>1522215975</a:CreationDate>
|
||||
<a:Creator>zhenghong</a:Creator>
|
||||
<a:ModificationDate>1522215991</a:ModificationDate>
|
||||
<a:ModificationDate>1535445127</a:ModificationDate>
|
||||
<a:Modifier>zhenghong</a:Modifier>
|
||||
<a:DataType>int</a:DataType>
|
||||
<a:DataType>bigint</a:DataType>
|
||||
</o:Column>
|
||||
<o:Column Id="o576">
|
||||
<a:ObjectID>39E7492F-B104-48BA-9460-88C66C6B971E</a:ObjectID>
|
||||
|
@ -5,7 +5,6 @@ import com.macro.mall.dto.PmsProductParam;
|
||||
import com.macro.mall.dto.PmsProductQueryParam;
|
||||
import com.macro.mall.dto.PmsProductResult;
|
||||
import com.macro.mall.model.PmsProduct;
|
||||
import com.macro.mall.model.PmsProductVertifyRecord;
|
||||
import com.macro.mall.service.PmsProductService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@ -60,7 +59,7 @@ public class PmsProductController {
|
||||
}
|
||||
|
||||
@ApiOperation("查询商品")
|
||||
@RequestMapping(value = "list", method = RequestMethod.GET)
|
||||
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public Object getList(PmsProductQueryParam productQueryParam,
|
||||
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
|
||||
|
@ -0,0 +1,69 @@
|
||||
package com.macro.mall.controller;
|
||||
|
||||
import com.macro.mall.dto.CommonResult;
|
||||
import com.macro.mall.dto.SmsCouponParam;
|
||||
import com.macro.mall.model.SmsCoupon;
|
||||
import com.macro.mall.service.SmsCouponService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 优惠券管理Controller
|
||||
* Created by macro on 2018/8/28.
|
||||
*/
|
||||
@Controller
|
||||
@Api(tags = "SmsCouponController", description = "优惠券管理")
|
||||
@RequestMapping("/coupon")
|
||||
public class SmsCouponController {
|
||||
@Autowired
|
||||
private SmsCouponService couponService;
|
||||
@ApiOperation("添加优惠券")
|
||||
@RequestMapping(value = "/add", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Object add(@RequestBody SmsCouponParam couponParam) {
|
||||
int count = couponService.add(couponParam);
|
||||
if(count>0){
|
||||
return new CommonResult().success(count);
|
||||
}
|
||||
return new CommonResult().failed();
|
||||
}
|
||||
|
||||
@ApiOperation("删除优惠券")
|
||||
@RequestMapping(value = "/delete/{id}", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Object delete(@PathVariable Long id) {
|
||||
int count = couponService.delete(id);
|
||||
if(count>0){
|
||||
return new CommonResult().success(count);
|
||||
}
|
||||
return new CommonResult().failed();
|
||||
}
|
||||
|
||||
@ApiOperation("修改优惠券")
|
||||
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Object update(@PathVariable Long id,@RequestBody SmsCouponParam couponParam) {
|
||||
int count = couponService.update(id,couponParam);
|
||||
if(count>0){
|
||||
return new CommonResult().success(count);
|
||||
}
|
||||
return new CommonResult().failed();
|
||||
}
|
||||
|
||||
@ApiOperation("根据优惠券名称和类型分页获取优惠券列表")
|
||||
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public Object list(
|
||||
@RequestParam(value = "name",required = false) String name,
|
||||
@RequestParam(value = "type",required = false) Integer type,
|
||||
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
|
||||
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
|
||||
List<SmsCoupon> couponList = couponService.list(name,type,pageSize,pageNum);
|
||||
return new CommonResult().pageSuccess(couponList);
|
||||
}
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package com.macro.mall.dao;
|
||||
|
||||
import com.macro.mall.model.SmsCouponProductCategoryRelation;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 优惠券和商品分类关系自定义Dao
|
||||
* Created by macro on 2018/8/28.
|
||||
*/
|
||||
public interface SmsCouponProductCategoryRelationDao {
|
||||
int insertList(@Param("list")List<SmsCouponProductCategoryRelation> productCategoryRelationList);
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package com.macro.mall.dao;
|
||||
|
||||
import com.macro.mall.model.SmsCouponProductRelation;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 优惠券和产品关系自定义Dao
|
||||
* Created by macro on 2018/8/28.
|
||||
*/
|
||||
public interface SmsCouponProductRelationDao {
|
||||
int insertList(@Param("list")List<SmsCouponProductRelation> productRelationList);
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package com.macro.mall.dto;
|
||||
|
||||
import com.macro.mall.model.SmsCoupon;
|
||||
import com.macro.mall.model.SmsCouponProductCategoryRelation;
|
||||
import com.macro.mall.model.SmsCouponProductRelation;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 优惠券信息封装,包括绑定商品和绑定分类
|
||||
* Created by macro on 2018/8/28.
|
||||
*/
|
||||
public class SmsCouponParam extends SmsCoupon {
|
||||
//优惠券绑定的商品
|
||||
private List<SmsCouponProductRelation> productRelationList;
|
||||
//优惠券绑定的商品分类
|
||||
private List<SmsCouponProductCategoryRelation> productCategoryRelationList;
|
||||
|
||||
public List<SmsCouponProductRelation> getProductRelationList() {
|
||||
return productRelationList;
|
||||
}
|
||||
|
||||
public void setProductRelationList(List<SmsCouponProductRelation> productRelationList) {
|
||||
this.productRelationList = productRelationList;
|
||||
}
|
||||
|
||||
public List<SmsCouponProductCategoryRelation> getProductCategoryRelationList() {
|
||||
return productCategoryRelationList;
|
||||
}
|
||||
|
||||
public void setProductCategoryRelationList(List<SmsCouponProductCategoryRelation> productCategoryRelationList) {
|
||||
this.productCategoryRelationList = productCategoryRelationList;
|
||||
}
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
package com.macro.mall.service;
|
||||
|
||||
import com.macro.mall.dto.SmsCouponParam;
|
||||
import com.macro.mall.model.SmsCoupon;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 优惠券管理Service
|
||||
* Created by macro on 2018/8/28.
|
||||
*/
|
||||
public interface SmsCouponService {
|
||||
/**
|
||||
* 添加优惠券
|
||||
*/
|
||||
@Transactional
|
||||
int add(SmsCouponParam couponParam);
|
||||
|
||||
/**
|
||||
* 根据优惠券id删除优惠券
|
||||
*/
|
||||
@Transactional
|
||||
int delete(Long id);
|
||||
|
||||
/**
|
||||
* 根据优惠券id更新优惠券信息
|
||||
*/
|
||||
@Transactional
|
||||
int update(Long id, SmsCouponParam couponParam);
|
||||
|
||||
/**
|
||||
* 分页获取优惠券列表
|
||||
*/
|
||||
List<SmsCoupon> list(String name, Integer type, Integer pageSize, Integer pageNum);
|
||||
}
|
@ -0,0 +1,115 @@
|
||||
package com.macro.mall.service.impl;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.macro.mall.dao.SmsCouponProductCategoryRelationDao;
|
||||
import com.macro.mall.dao.SmsCouponProductRelationDao;
|
||||
import com.macro.mall.dto.SmsCouponParam;
|
||||
import com.macro.mall.mapper.SmsCouponMapper;
|
||||
import com.macro.mall.mapper.SmsCouponProductCategoryRelationMapper;
|
||||
import com.macro.mall.mapper.SmsCouponProductRelationMapper;
|
||||
import com.macro.mall.model.*;
|
||||
import com.macro.mall.service.SmsCouponService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 优惠券管理Service实现类
|
||||
* Created by macro on 2018/8/28.
|
||||
*/
|
||||
@Service
|
||||
public class SmsCouponServiceImpl implements SmsCouponService {
|
||||
@Autowired
|
||||
private SmsCouponMapper couponMapper;
|
||||
@Autowired
|
||||
private SmsCouponProductRelationMapper productRelationMapper;
|
||||
@Autowired
|
||||
private SmsCouponProductCategoryRelationMapper productCategoryRelationMapper;
|
||||
@Autowired
|
||||
private SmsCouponProductRelationDao productRelationDao;
|
||||
@Autowired
|
||||
private SmsCouponProductCategoryRelationDao productCategoryRelationDao;
|
||||
@Override
|
||||
public int add(SmsCouponParam couponParam) {
|
||||
//插入优惠券表
|
||||
// TODO: 2018/8/28 生成优惠券条码
|
||||
int count = couponMapper.insert(couponParam);
|
||||
//插入优惠券和商品关系表
|
||||
if(couponParam.getUseType().equals(2)){
|
||||
for(SmsCouponProductRelation productRelation:couponParam.getProductRelationList()){
|
||||
productRelation.setCouponId(couponParam.getId());
|
||||
}
|
||||
productRelationDao.insertList(couponParam.getProductRelationList());
|
||||
}
|
||||
//插入优惠券和商品分类关系表
|
||||
if(couponParam.getUseType().equals(1)){
|
||||
for (SmsCouponProductCategoryRelation couponProductCategoryRelation : couponParam.getProductCategoryRelationList()) {
|
||||
couponProductCategoryRelation.setCouponId(couponParam.getId());
|
||||
}
|
||||
productCategoryRelationDao.insertList(couponParam.getProductCategoryRelationList());
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int delete(Long id) {
|
||||
//删除优惠券
|
||||
int count = couponMapper.deleteByPrimaryKey(id);
|
||||
//删除商品关联
|
||||
deleteProductRelation(id);
|
||||
//删除商品分类关联
|
||||
deleteProductCategoryRelation(id);
|
||||
return count;
|
||||
}
|
||||
|
||||
private void deleteProductCategoryRelation(Long id) {
|
||||
SmsCouponProductCategoryRelationExample productCategoryRelationExample = new SmsCouponProductCategoryRelationExample();
|
||||
productCategoryRelationExample.createCriteria().andCouponIdEqualTo(id);
|
||||
productCategoryRelationMapper.deleteByExample(productCategoryRelationExample);
|
||||
}
|
||||
|
||||
private void deleteProductRelation(Long id) {
|
||||
SmsCouponProductRelationExample productRelationExample = new SmsCouponProductRelationExample();
|
||||
productRelationExample.createCriteria().andCouponIdEqualTo(id);
|
||||
productRelationMapper.deleteByExample(productRelationExample);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int update(Long id, SmsCouponParam couponParam) {
|
||||
couponParam.setId(id);
|
||||
int count =couponMapper.updateByPrimaryKey(couponParam);
|
||||
//删除后插入优惠券和商品关系表
|
||||
if(couponParam.getUseType().equals(2)){
|
||||
for(SmsCouponProductRelation productRelation:couponParam.getProductRelationList()){
|
||||
productRelation.setCouponId(couponParam.getId());
|
||||
}
|
||||
deleteProductRelation(id);
|
||||
productRelationDao.insertList(couponParam.getProductRelationList());
|
||||
}
|
||||
//删除后插入优惠券和商品分类关系表
|
||||
if(couponParam.getUseType().equals(1)){
|
||||
for (SmsCouponProductCategoryRelation couponProductCategoryRelation : couponParam.getProductCategoryRelationList()) {
|
||||
couponProductCategoryRelation.setCouponId(couponParam.getId());
|
||||
}
|
||||
deleteProductCategoryRelation(id);
|
||||
productCategoryRelationDao.insertList(couponParam.getProductCategoryRelationList());
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SmsCoupon> list(String name, Integer type, Integer pageSize, Integer pageNum) {
|
||||
SmsCouponExample example = new SmsCouponExample();
|
||||
SmsCouponExample.Criteria criteria = example.createCriteria();
|
||||
if(!StringUtils.isEmpty(name)){
|
||||
criteria.andNameLike("%"+name+"%");
|
||||
}
|
||||
if(type!=null){
|
||||
criteria.andTypeEqualTo(type);
|
||||
}
|
||||
PageHelper.startPage(pageNum,pageSize);
|
||||
return couponMapper.selectByExample(example);
|
||||
}
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
<?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="com.macro.mall.dao.SmsCouponProductCategoryRelationDao">
|
||||
<insert id="insertList">
|
||||
INSERT INTO sms_coupon_product_category_relation (product_category_id,coupon_id) VALUES
|
||||
<foreach collection="list" item="item" index="index" separator=",">
|
||||
(#{item.productCategoryId,jdbcType=BIGINT},
|
||||
#{item.couponId,jdbcType=INTEGER})
|
||||
</foreach>
|
||||
</insert>
|
||||
</mapper>
|
@ -0,0 +1,11 @@
|
||||
<?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="com.macro.mall.dao.SmsCouponProductRelationDao">
|
||||
<insert id="insertList">
|
||||
INSERT INTO sms_coupon_product_relation (product_id,coupon_id) VALUES
|
||||
<foreach collection="list" item="item" index="index" separator=",">
|
||||
(#{item.productId,jdbcType=BIGINT},
|
||||
#{item.couponId,jdbcType=INTEGER})
|
||||
</foreach>
|
||||
</insert>
|
||||
</mapper>
|
@ -21,7 +21,7 @@ public class SmsCoupon implements Serializable {
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
private String platform;
|
||||
private Integer platform;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
@ -137,11 +137,11 @@ public class SmsCoupon implements Serializable {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getPlatform() {
|
||||
public Integer getPlatform() {
|
||||
return platform;
|
||||
}
|
||||
|
||||
public void setPlatform(String platform) {
|
||||
public void setPlatform(Integer platform) {
|
||||
this.platform = platform;
|
||||
}
|
||||
|
||||
|
@ -306,62 +306,52 @@ public class SmsCouponExample {
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPlatformEqualTo(String value) {
|
||||
public Criteria andPlatformEqualTo(Integer value) {
|
||||
addCriterion("platform =", value, "platform");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPlatformNotEqualTo(String value) {
|
||||
public Criteria andPlatformNotEqualTo(Integer value) {
|
||||
addCriterion("platform <>", value, "platform");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPlatformGreaterThan(String value) {
|
||||
public Criteria andPlatformGreaterThan(Integer value) {
|
||||
addCriterion("platform >", value, "platform");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPlatformGreaterThanOrEqualTo(String value) {
|
||||
public Criteria andPlatformGreaterThanOrEqualTo(Integer value) {
|
||||
addCriterion("platform >=", value, "platform");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPlatformLessThan(String value) {
|
||||
public Criteria andPlatformLessThan(Integer value) {
|
||||
addCriterion("platform <", value, "platform");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPlatformLessThanOrEqualTo(String value) {
|
||||
public Criteria andPlatformLessThanOrEqualTo(Integer value) {
|
||||
addCriterion("platform <=", value, "platform");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPlatformLike(String value) {
|
||||
addCriterion("platform like", value, "platform");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPlatformNotLike(String value) {
|
||||
addCriterion("platform not like", value, "platform");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPlatformIn(List<String> values) {
|
||||
public Criteria andPlatformIn(List<Integer> values) {
|
||||
addCriterion("platform in", values, "platform");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPlatformNotIn(List<String> values) {
|
||||
public Criteria andPlatformNotIn(List<Integer> values) {
|
||||
addCriterion("platform not in", values, "platform");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPlatformBetween(String value1, String value2) {
|
||||
public Criteria andPlatformBetween(Integer value1, Integer value2) {
|
||||
addCriterion("platform between", value1, value2, "platform");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPlatformNotBetween(String value1, String value2) {
|
||||
public Criteria andPlatformNotBetween(Integer value1, Integer value2) {
|
||||
addCriterion("platform not between", value1, value2, "platform");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ import java.io.Serializable;
|
||||
public class SmsCouponProductRelation implements Serializable {
|
||||
private Long id;
|
||||
|
||||
private Integer couponId;
|
||||
private Long couponId;
|
||||
|
||||
private Long productId;
|
||||
|
||||
@ -19,11 +19,11 @@ public class SmsCouponProductRelation implements Serializable {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Integer getCouponId() {
|
||||
public Long getCouponId() {
|
||||
return couponId;
|
||||
}
|
||||
|
||||
public void setCouponId(Integer couponId) {
|
||||
public void setCouponId(Long couponId) {
|
||||
this.couponId = couponId;
|
||||
}
|
||||
|
||||
|
@ -174,52 +174,52 @@ public class SmsCouponProductRelationExample {
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCouponIdEqualTo(Integer value) {
|
||||
public Criteria andCouponIdEqualTo(Long value) {
|
||||
addCriterion("coupon_id =", value, "couponId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCouponIdNotEqualTo(Integer value) {
|
||||
public Criteria andCouponIdNotEqualTo(Long value) {
|
||||
addCriterion("coupon_id <>", value, "couponId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCouponIdGreaterThan(Integer value) {
|
||||
public Criteria andCouponIdGreaterThan(Long value) {
|
||||
addCriterion("coupon_id >", value, "couponId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCouponIdGreaterThanOrEqualTo(Integer value) {
|
||||
public Criteria andCouponIdGreaterThanOrEqualTo(Long value) {
|
||||
addCriterion("coupon_id >=", value, "couponId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCouponIdLessThan(Integer value) {
|
||||
public Criteria andCouponIdLessThan(Long value) {
|
||||
addCriterion("coupon_id <", value, "couponId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCouponIdLessThanOrEqualTo(Integer value) {
|
||||
public Criteria andCouponIdLessThanOrEqualTo(Long value) {
|
||||
addCriterion("coupon_id <=", value, "couponId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCouponIdIn(List<Integer> values) {
|
||||
public Criteria andCouponIdIn(List<Long> values) {
|
||||
addCriterion("coupon_id in", values, "couponId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCouponIdNotIn(List<Integer> values) {
|
||||
public Criteria andCouponIdNotIn(List<Long> values) {
|
||||
addCriterion("coupon_id not in", values, "couponId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCouponIdBetween(Integer value1, Integer value2) {
|
||||
public Criteria andCouponIdBetween(Long value1, Long value2) {
|
||||
addCriterion("coupon_id between", value1, value2, "couponId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCouponIdNotBetween(Integer value1, Integer value2) {
|
||||
public Criteria andCouponIdNotBetween(Long value1, Long value2) {
|
||||
addCriterion("coupon_id not between", value1, value2, "couponId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
@ -5,7 +5,7 @@
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="type" jdbcType="INTEGER" property="type" />
|
||||
<result column="name" jdbcType="VARCHAR" property="name" />
|
||||
<result column="platform" jdbcType="VARCHAR" property="platform" />
|
||||
<result column="platform" jdbcType="INTEGER" property="platform" />
|
||||
<result column="count" jdbcType="INTEGER" property="count" />
|
||||
<result column="amount" jdbcType="DECIMAL" property="amount" />
|
||||
<result column="per_limit" jdbcType="INTEGER" property="perLimit" />
|
||||
@ -123,7 +123,7 @@
|
||||
use_type, note, publish_count,
|
||||
use_count, receive_count, enable_time,
|
||||
code, member_level)
|
||||
values (#{type,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{platform,jdbcType=VARCHAR},
|
||||
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},
|
||||
@ -196,7 +196,7 @@
|
||||
#{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="platform != null">
|
||||
#{platform,jdbcType=VARCHAR},
|
||||
#{platform,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="count != null">
|
||||
#{count,jdbcType=INTEGER},
|
||||
@ -261,7 +261,7 @@
|
||||
name = #{record.name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.platform != null">
|
||||
platform = #{record.platform,jdbcType=VARCHAR},
|
||||
platform = #{record.platform,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="record.count != null">
|
||||
count = #{record.count,jdbcType=INTEGER},
|
||||
@ -315,7 +315,7 @@
|
||||
set id = #{record.id,jdbcType=BIGINT},
|
||||
type = #{record.type,jdbcType=INTEGER},
|
||||
name = #{record.name,jdbcType=VARCHAR},
|
||||
platform = #{record.platform,jdbcType=VARCHAR},
|
||||
platform = #{record.platform,jdbcType=INTEGER},
|
||||
count = #{record.count,jdbcType=INTEGER},
|
||||
amount = #{record.amount,jdbcType=DECIMAL},
|
||||
per_limit = #{record.perLimit,jdbcType=INTEGER},
|
||||
@ -344,7 +344,7 @@
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="platform != null">
|
||||
platform = #{platform,jdbcType=VARCHAR},
|
||||
platform = #{platform,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="count != null">
|
||||
count = #{count,jdbcType=INTEGER},
|
||||
@ -395,7 +395,7 @@
|
||||
update sms_coupon
|
||||
set type = #{type,jdbcType=INTEGER},
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
platform = #{platform,jdbcType=VARCHAR},
|
||||
platform = #{platform,jdbcType=INTEGER},
|
||||
count = #{count,jdbcType=INTEGER},
|
||||
amount = #{amount,jdbcType=DECIMAL},
|
||||
per_limit = #{perLimit,jdbcType=INTEGER},
|
||||
|
@ -3,7 +3,7 @@
|
||||
<mapper namespace="com.macro.mall.mapper.SmsCouponProductRelationMapper">
|
||||
<resultMap id="BaseResultMap" type="com.macro.mall.model.SmsCouponProductRelation">
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="coupon_id" jdbcType="INTEGER" property="couponId" />
|
||||
<result column="coupon_id" jdbcType="BIGINT" property="couponId" />
|
||||
<result column="product_id" jdbcType="BIGINT" property="productId" />
|
||||
</resultMap>
|
||||
<sql id="Example_Where_Clause">
|
||||
@ -102,7 +102,7 @@
|
||||
SELECT LAST_INSERT_ID()
|
||||
</selectKey>
|
||||
insert into sms_coupon_product_relation (coupon_id, product_id)
|
||||
values (#{couponId,jdbcType=INTEGER}, #{productId,jdbcType=BIGINT})
|
||||
values (#{couponId,jdbcType=BIGINT}, #{productId,jdbcType=BIGINT})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.macro.mall.model.SmsCouponProductRelation">
|
||||
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
|
||||
@ -119,7 +119,7 @@
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="couponId != null">
|
||||
#{couponId,jdbcType=INTEGER},
|
||||
#{couponId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="productId != null">
|
||||
#{productId,jdbcType=BIGINT},
|
||||
@ -139,7 +139,7 @@
|
||||
id = #{record.id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.couponId != null">
|
||||
coupon_id = #{record.couponId,jdbcType=INTEGER},
|
||||
coupon_id = #{record.couponId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.productId != null">
|
||||
product_id = #{record.productId,jdbcType=BIGINT},
|
||||
@ -152,7 +152,7 @@
|
||||
<update id="updateByExample" parameterType="map">
|
||||
update sms_coupon_product_relation
|
||||
set id = #{record.id,jdbcType=BIGINT},
|
||||
coupon_id = #{record.couponId,jdbcType=INTEGER},
|
||||
coupon_id = #{record.couponId,jdbcType=BIGINT},
|
||||
product_id = #{record.productId,jdbcType=BIGINT}
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
@ -162,7 +162,7 @@
|
||||
update sms_coupon_product_relation
|
||||
<set>
|
||||
<if test="couponId != null">
|
||||
coupon_id = #{couponId,jdbcType=INTEGER},
|
||||
coupon_id = #{couponId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="productId != null">
|
||||
product_id = #{productId,jdbcType=BIGINT},
|
||||
@ -172,7 +172,7 @@
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.macro.mall.model.SmsCouponProductRelation">
|
||||
update sms_coupon_product_relation
|
||||
set coupon_id = #{couponId,jdbcType=INTEGER},
|
||||
set coupon_id = #{couponId,jdbcType=BIGINT},
|
||||
product_id = #{productId,jdbcType=BIGINT}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
|
Loading…
x
Reference in New Issue
Block a user