Commit 589e0cb7 by 吕明尚

修改优惠卷表字段

parent 526d8d18
...@@ -2,6 +2,8 @@ package share.web.controller.system; ...@@ -2,6 +2,8 @@ package share.web.controller.system;
import java.util.List; import java.util.List;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang3.StringUtils;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
...@@ -16,6 +18,8 @@ import share.common.annotation.Log; ...@@ -16,6 +18,8 @@ import share.common.annotation.Log;
import share.common.core.controller.BaseController; import share.common.core.controller.BaseController;
import share.common.core.domain.AjaxResult; import share.common.core.domain.AjaxResult;
import share.common.enums.BusinessType; import share.common.enums.BusinessType;
import share.common.enums.RoomType;
import share.common.enums.StoreType;
import share.system.domain.SCoupon; import share.system.domain.SCoupon;
import share.system.service.ISCouponService; import share.system.service.ISCouponService;
import share.common.utils.poi.ExcelUtil; import share.common.utils.poi.ExcelUtil;
...@@ -77,6 +81,12 @@ public class SCouponController extends BaseController ...@@ -77,6 +81,12 @@ public class SCouponController extends BaseController
@PostMapping @PostMapping
public AjaxResult add(@RequestBody SCoupon sCoupon) public AjaxResult add(@RequestBody SCoupon sCoupon)
{ {
if (StringUtils.isNotBlank(sCoupon.getRoomType())){
sCoupon.setRoomType(String.valueOf(RoomType.getCodeList()));
}
if (StringUtils.isNotBlank(sCoupon.getStoreType())){
sCoupon.setStoreType(String.valueOf(StoreType.getCodeList()));
}
return toAjax(sCouponService.insertSCoupon(sCoupon)); return toAjax(sCouponService.insertSCoupon(sCoupon));
} }
......
...@@ -18,27 +18,27 @@ public class MTController { ...@@ -18,27 +18,27 @@ public class MTController {
@GetMapping("/verificationVouchers") @GetMapping("/verificationVouchers")
@Log(title = "执行验券") @Log(title = "执行验券")
public String verificationVouchers(String code, int num){ public String verificationVouchers(String code, int num){
return mtService.verificationVouchers(code, num); return mtService.verificationVouchers(code, num).getMsg();
} }
@GetMapping("/revoke") @GetMapping("/revoke")
@Log(title = "撤销验券") @Log(title = "撤销验券")
public String revoke(String ERPId ,String ERPName ,String couponCode){ public String revoke(String ERPId ,String ERPName ,String couponCode){
return mtService.revoke(ERPId, ERPName, couponCode); return mtService.revoke(ERPId, ERPName, couponCode).getMsg();
} }
@GetMapping("/preparation") @GetMapping("/preparation")
@Log(title = "验券准备") @Log(title = "验券准备")
public String preparation(String code){ public String preparation(String code){
return mtService.preparation(code); return mtService.preparation(code).getMsg();
} }
@GetMapping("/consume") @GetMapping("/consume")
@Log(title = "已验券码查询") @Log(title = "已验券码查询")
public String verified(String code){ public String verified(String code){
return mtService.verified(code); return mtService.verified(code).getMsg();
} }
} }
...@@ -27,6 +27,34 @@ public class SCoupon extends BaseEntity ...@@ -27,6 +27,34 @@ public class SCoupon extends BaseEntity
@Excel(name = "优惠券名称") @Excel(name = "优惠券名称")
private String name; private String name;
/** 有效期开始 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "有效期开始", width = 30, dateFormat = "yyyy-MM-dd")
private Date startDate;
/** 有效期结束 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "有效期结束", width = 30, dateFormat = "yyyy-MM-dd")
private Date endDate;
/** 有效开始时段 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "有效开始时段", width = 30, dateFormat = "yyyy-MM-dd")
private Date validStartTime;
/** 有效结束时段 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "有效结束时段", width = 30, dateFormat = "yyyy-MM-dd")
private Date validEndTime;
//门店类型
@Excel(name = "门店类型(1:标准店,2:外卖店,3:酒店,4:其他)")
private String storeType;
//房间类型
@Excel(name = "房间类型(1:标间,2:豪华间,3:总统套房,4:商务套房,5:行政套房,6:其他)")
private String roomType;
/** 优惠券类型(1:折扣券,2,团购券,3:满减券,4:核销券,5:充值送金额) */ /** 优惠券类型(1:折扣券,2,团购券,3:满减券,4:核销券,5:充值送金额) */
@Excel(name = "优惠券类型(1:折扣券,2,团购券,3:满减券,4:核销券,5:充值送金额)") @Excel(name = "优惠券类型(1:折扣券,2,团购券,3:满减券,4:核销券,5:充值送金额)")
private Integer couponType; private Integer couponType;
...@@ -44,28 +72,22 @@ public class SCoupon extends BaseEntity ...@@ -44,28 +72,22 @@ public class SCoupon extends BaseEntity
private String duration; private String duration;
/** 满减最小可使用金额 */ /** 满减最小可使用金额 */
@Excel(name = "满减最小可使用金额") @Excel(name = "门槛金额")
private BigDecimal minPrice; private BigDecimal minPrice;
/** 减去金额(满减券单位:元,折扣为系数) */ /** 减去金额(满减券单位:元,折扣为系数) */
@Excel(name = "减去金额(满减券单位:元,折扣为系数)") @Excel(name = "减去金额(满减券单位:元,折扣为系数)")
private BigDecimal subPrice; private BigDecimal subPrice;
/** 第三方平台名称 */ /** 是否可叠加使用(0:不可叠加,1:可叠加) */
@Excel(name = "第三方平台名称") @Excel(name = "是否可叠加使用(0:不可叠加,1:可叠加)")
private String platform; private Integer isOverlay;
/** 第三方平台类型(1:美团,2,大众点评) */ /** 第三方平台类型(1:美团,2,大众点评) */
@Excel(name = "第三方平台类型(1:美团,2,大众点评)") @Excel(name = "第三方平台类型(1:美团,2,大众点评)")
private Integer platformType; private Integer platformType;
/** 有效期开始 */ /** 优惠券数量 */
@JsonFormat(pattern = "yyyy-MM-dd") @Excel(name = "优惠券数量")
@Excel(name = "有效期开始", width = 30, dateFormat = "yyyy-MM-dd") private Integer number;
private Date startDate;
/** 有效期结束 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "有效期结束", width = 30, dateFormat = "yyyy-MM-dd")
private Date endDate;
} }
...@@ -58,4 +58,6 @@ public interface SCouponMapper ...@@ -58,4 +58,6 @@ public interface SCouponMapper
* @return 结果 * @return 结果
*/ */
public int deleteSCouponByIds(Long[] ids); public int deleteSCouponByIds(Long[] ids);
SCoupon selectSCouponByName(String dealTitle);
} }
...@@ -58,4 +58,11 @@ public interface ISCouponService ...@@ -58,4 +58,11 @@ public interface ISCouponService
* @return 结果 * @return 结果
*/ */
public int deleteSCouponById(Long id); public int deleteSCouponById(Long id);
/**
* 根据优惠券名称查询优惠券
* @param dealTitle 优惠券名称
* @return 结果
*/
SCoupon selectSCouponByName(String dealTitle);
} }
package share.system.service; package share.system.service;
import com.meituan.sdk.MeituanResponse;
public interface MTService { public interface MTService {
public String verificationVouchers(String code, int num); MeituanResponse verificationVouchers(String code, int num);
public String revoke (String ERPId ,String ERPName ,String couponCode); MeituanResponse revoke (String ERPId ,String ERPName ,String couponCode);
String preparation (String code); MeituanResponse preparation (String code);
String verified (String code); MeituanResponse verified (String code);
} }
...@@ -12,8 +12,13 @@ import com.meituan.sdk.model.tuangouNg.coupon.msSuperPrepare.MsSuperPrepareReque ...@@ -12,8 +12,13 @@ import com.meituan.sdk.model.tuangouNg.coupon.msSuperPrepare.MsSuperPrepareReque
import com.meituan.sdk.model.tuangouNg.coupon.msSuperPrepare.MsSuperPrepareResponse; import com.meituan.sdk.model.tuangouNg.coupon.msSuperPrepare.MsSuperPrepareResponse;
import com.meituan.sdk.model.tuangouNg.coupon.queryCouponById.QueryCouponByIdRequest; import com.meituan.sdk.model.tuangouNg.coupon.queryCouponById.QueryCouponByIdRequest;
import com.meituan.sdk.model.tuangouNg.coupon.queryCouponById.QueryCouponByIdResponse; import com.meituan.sdk.model.tuangouNg.coupon.queryCouponById.QueryCouponByIdResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import share.system.domain.SConsumerCoupon;
import share.system.domain.SCoupon;
import share.system.service.ISConsumerCouponService;
import share.system.service.ISCouponService;
import share.system.service.MTService; import share.system.service.MTService;
@Service @Service
...@@ -24,9 +29,29 @@ public class MTServiceImpl implements MTService { ...@@ -24,9 +29,29 @@ public class MTServiceImpl implements MTService {
private String appAuthToken; private String appAuthToken;
@Value("${meituan.developerId}") @Value("${meituan.developerId}")
private Long developerId; private Long developerId;
@Autowired
private ISCouponService isCouponService;
@Autowired
private ISConsumerCouponService isConsumerCouponService;
//执行验券 //执行验券
@Override @Override
public String verificationVouchers(String code, int num) { public MeituanResponse verificationVouchers(String code, int num) {
//验券准备
MeituanResponse preparation = preparation(code);
//验券准备失败
if(!preparation.isSuccess()){
throw new RuntimeException(preparation.getMsg());
}
//返回验券准备数据
MsSuperPrepareResponse data = (MsSuperPrepareResponse)preparation.getData();
SCoupon sCoupon = isCouponService.selectSCouponByName(data.getDealTitle());
if(sCoupon == null){
throw new RuntimeException("未找到对应的优惠券");
}
//执行验券
//developerId 服务商身份标识 signKey 服务商签名密钥 //developerId 服务商身份标识 signKey 服务商签名密钥
MeituanClient meituanClient = DefaultMeituanClient.builder(developerId, signKey).build(); MeituanClient meituanClient = DefaultMeituanClient.builder(developerId, signKey).build();
MsSuperConsumeRequest msSuperConsumeRequest = new MsSuperConsumeRequest(); MsSuperConsumeRequest msSuperConsumeRequest = new MsSuperConsumeRequest();
...@@ -40,18 +65,20 @@ public class MTServiceImpl implements MTService { ...@@ -40,18 +65,20 @@ public class MTServiceImpl implements MTService {
} catch (MtSdkException e) { } catch (MtSdkException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
if (response.isSuccess()) { if (response.isSuccess()){
MsSuperConsumeResponse resp = response.getData(); SConsumerCoupon sConsumerCoupon = new SConsumerCoupon();
return resp.toString(); sConsumerCoupon.setStoreType(sCoupon.getStoreType());
} else { sConsumerCoupon.setRoomType(sCoupon.getRoomType());
System.out.println("调用失败"); isConsumerCouponService.insertSConsumerCoupon(sConsumerCoupon);
}else{
return response;
} }
return null; return response;
} }
//撤销验券 //撤销验券
@Override @Override
public String revoke(String ERPId, String ERPName, String couponCode) { public MeituanResponse revoke(String ERPId, String ERPName, String couponCode) {
MeituanClient meituanClient = DefaultMeituanClient.builder(developerId,signKey).build(); MeituanClient meituanClient = DefaultMeituanClient.builder(developerId,signKey).build();
CouponCancelRequest couponCancelRequest = new CouponCancelRequest(); CouponCancelRequest couponCancelRequest = new CouponCancelRequest();
couponCancelRequest.setEId(ERPId); couponCancelRequest.setEId(ERPId);
...@@ -64,18 +91,12 @@ public class MTServiceImpl implements MTService { ...@@ -64,18 +91,12 @@ public class MTServiceImpl implements MTService {
} catch (MtSdkException e) { } catch (MtSdkException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
if (response.isSuccess()) { return response;
CouponCancelResponse resp = response.getData();
return resp.toString();
} else {
System.out.println("调用失败");
}
return null;
} }
//验券准备 //验券准备
@Override @Override
public String preparation(String code) { public MeituanResponse preparation(String code) {
MeituanClient meituanClient = DefaultMeituanClient.builder(developerId, signKey).build(); MeituanClient meituanClient = DefaultMeituanClient.builder(developerId, signKey).build();
MsSuperPrepareRequest msSuperPrepareRequest = new MsSuperPrepareRequest(); MsSuperPrepareRequest msSuperPrepareRequest = new MsSuperPrepareRequest();
msSuperPrepareRequest.setCode(code); msSuperPrepareRequest.setCode(code);
...@@ -85,18 +106,12 @@ public class MTServiceImpl implements MTService { ...@@ -85,18 +106,12 @@ public class MTServiceImpl implements MTService {
} catch (MtSdkException e) { } catch (MtSdkException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
if (response.isSuccess()) { return response;
MsSuperPrepareResponse resp = response.getData();
return resp.toString();
} else {
System.out.println("调用失败");
}
return null;
} }
//已验券码查询 //已验券码查询
@Override @Override
public String verified(String code) { public MeituanResponse verified(String code) {
MeituanClient meituanClient = DefaultMeituanClient.builder(developerId, signKey).build(); MeituanClient meituanClient = DefaultMeituanClient.builder(developerId, signKey).build();
QueryCouponByIdRequest queryCouponByIdRequest = new QueryCouponByIdRequest(); QueryCouponByIdRequest queryCouponByIdRequest = new QueryCouponByIdRequest();
queryCouponByIdRequest.setCouponCode(code); queryCouponByIdRequest.setCouponCode(code);
...@@ -106,14 +121,7 @@ public class MTServiceImpl implements MTService { ...@@ -106,14 +121,7 @@ public class MTServiceImpl implements MTService {
} catch (MtSdkException e) { } catch (MtSdkException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
return response;
if (response.isSuccess()) {
QueryCouponByIdResponse resp = response.getData();
return resp.toString();
} else {
System.out.println("调用失败");
}
return null;
} }
} }
...@@ -93,4 +93,14 @@ public class SCouponServiceImpl implements ISCouponService ...@@ -93,4 +93,14 @@ public class SCouponServiceImpl implements ISCouponService
{ {
return sCouponMapper.deleteSCouponById(id); return sCouponMapper.deleteSCouponById(id);
} }
/**
* 根据优惠券名称查询优惠券
* @param dealTitle
* @return
*/
@Override
public SCoupon selectSCouponByName(String dealTitle) {
return sCouponMapper.selectSCouponByName(dealTitle);
}
} }
...@@ -7,16 +7,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -7,16 +7,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="SCoupon" id="SCouponResult"> <resultMap type="SCoupon" id="SCouponResult">
<result property="id" column="id" /> <result property="id" column="id" />
<result property="name" column="name" /> <result property="name" column="name" />
<result property="startDate" column="start_date" />
<result property="endDate" column="end_date" />
<result property="validStartTime" column="valid_start_time" />
<result property="validEndTime" column="valid_end_time" />
<result property="storeType" column="store_type" />
<result property="roomType" column="room_type" />
<result property="couponType" column="coupon_type" /> <result property="couponType" column="coupon_type" />
<result property="duration" column="duration" /> <result property="duration" column="duration" />
<result property="minDuration" column="min_duration" /> <result property="minDuration" column="min_duration" />
<result property="maxDuration" column="max_duration" /> <result property="maxDuration" column="max_duration" />
<result property="minPrice" column="min_price" /> <result property="minPrice" column="min_price" />
<result property="subPrice" column="sub_price" /> <result property="subPrice" column="sub_price" />
<result property="platform" column="platform" /> <result property="isOverlay" column="is_overlay" />
<result property="platformType" column="platform_type" /> <result property="platformType" column="platform_type" />
<result property="startDate" column="start_date" /> <result property="number" column="number" />
<result property="endDate" column="end_date" />
<result property="createBy" column="create_by" /> <result property="createBy" column="create_by" />
<result property="createTime" column="create_time" /> <result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" /> <result property="updateBy" column="update_by" />
...@@ -25,23 +30,39 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -25,23 +30,39 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectSCouponVo"> <sql id="selectSCouponVo">
select id, name, coupon_type, duration,min_duration,max_duration, min_price, sub_price, platform, platform_type, start_date, end_date, create_by, create_time, update_by, update_time, remark from s_coupon select id,name,start_date,
end_date,valid_start_time,valid_end_time,
store_type,room_type,coupon_type,
duration,min_duration,max_duration,
min_price,sub_price,is_overlay,
platform_type,number,create_by,
create_time,update_by,update_time,
remark from s_coupon
</sql> </sql>
<select id="selectSCouponList" parameterType="SCoupon" resultMap="SCouponResult"> <select id="selectSCouponList" parameterType="SCoupon" resultMap="SCouponResult">
<include refid="selectSCouponVo"/> <include refid="selectSCouponVo"/>
<where> <where>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if> <if test="name != null and name != ''"> and name like concat('%', #{name}, '%'),</if>
<if test="couponType != null "> and coupon_type = #{couponType}</if> <if test="startDate != null"> and start_date = #{startDate},</if>
<if test="duration != null and duration != ''"> and duration = #{duration}</if> <if test="endDate != null"> and end_date = #{endDate},</if>
<if test="validStartTime != null"> and valid_start_time = #{validStartTime},</if>
<if test="validEndTime != null"> and valid_end_time = #{validEndTime},</if>
<if test="storeType != null"> and store_type = #{storeType},</if>
<if test="roomType != null"> and room_type = #{roomType},</if>
<if test="couponType != null"> and coupon_type = #{couponType},</if>
<if test="duration != null and duration != ''"> and duration = #{duration},</if>
<if test="minDuration != null and minDuration != ''"> and min_duration = #{minDuration},</if> <if test="minDuration != null and minDuration != ''"> and min_duration = #{minDuration},</if>
<if test="maxDuration != null and maxDuration != ''"> and max_duration = #{maxDuration},</if> <if test="maxDuration != null and maxDuration != ''"> and max_duration = #{maxDuration},</if>
<if test="minPrice != null "> and min_price = #{minPrice}</if> <if test="minPrice != null and minPrice != ''"> and min_price = #{minPrice},</if>
<if test="subPrice != null "> and sub_price = #{subPrice}</if> <if test="subPrice != null and subPrice != ''"> and sub_price = #{subPrice},</if>
<if test="platform != null and platform != ''"> and platform = #{platform}</if> <if test="isOverlay != null"> and is_overlay = #{isOverlay},</if>
<if test="platformType != null "> and platform_type = #{platformType}</if> <if test="platformType != null"> and platform_type = #{platformType},</if>
<if test="startDate != null "> and start_date = #{startDate}</if> <if test="number != null"> and number = #{number},</if>
<if test="endDate != null "> and end_date = #{endDate}</if> <if test="createBy != null"> and create_by = #{createBy},</if>
<if test="createTime != null"> and create_time = #{createTime},</if>
<if test="updateBy != null"> and update_by = #{updateBy},</if>
<if test="updateTime != null"> and update_time = #{updateTime},</if>
</where> </where>
</select> </select>
...@@ -49,43 +70,53 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -49,43 +70,53 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectSCouponVo"/> <include refid="selectSCouponVo"/>
where id = #{id} where id = #{id}
</select> </select>
<select id="selectSCouponByName" resultType="share.system.domain.SCoupon">
<include refid="selectSCouponVo"/>
where name = #{name}
</select>
<insert id="insertSCoupon" parameterType="SCoupon" useGeneratedKeys="true" keyProperty="id"> <insert id="insertSCoupon" parameterType="SCoupon" useGeneratedKeys="true" keyProperty="id">
insert into s_coupon insert into s_coupon
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="name != null and name != ''">name,</if> <if test="name != null and name != ''">name,</if>
<if test="startDate != null">start_date,</if>
<if test="endDate != null">end_date,</if>
<if test="validStartTime != null">valid_start_time,</if>
<if test="validEndTime != null">valid_end_time,</if>
<if test="storeType != null">store_type,</if>
<if test="roomType != null">room_type,</if>
<if test="couponType != null">coupon_type,</if> <if test="couponType != null">coupon_type,</if>
<if test="duration != null and duration != ''">duration,</if> <if test="duration != null and duration != ''">duration,</if>
<if test="minDuration != null and minDuration != ''">min_duration = #{minDuration},</if> <if test="minDuration != null and minDuration != ''">min_duration,</if>
<if test="maxDuration != null and maxDuration != ''">max_duration = #{maxDuration},</if> <if test="maxDuration != null and maxDuration != ''">max_duration,</if>
<if test="minPrice != null">min_price,</if> <if test="minPrice != null and minPrice != ''">min_price,</if>
<if test="subPrice != null">sub_price,</if> <if test="subPrice != null and subPrice != ''">sub_price,</if>
<if test="platform != null">platform,</if> <if test="isOverlay != null">is_overlay,</if>
<if test="platformType != null">platform_type,</if> <if test="platformType != null">platform_type,</if>
<if test="startDate != null">start_date,</if> <if test="number != null">number,</if>
<if test="endDate != null">end_date,</if>
<if test="createBy != null">create_by,</if> <if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if> <if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if> <if test="remark != null">remark,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null and name != ''">#{name},</if> <if test="name != null and name != ''">#{name},</if>
<if test="startDate != null">#{startDate},</if>
<if test="endDate != null">#{endDate},</if>
<if test="validStartTime != null">#{validStartTime},</if>
<if test="validEndTime != null">#{validEndTime},</if>
<if test="storeType != null">#{storeType},</if>
<if test="roomType != null">#{roomType},</if>
<if test="couponType != null">#{couponType},</if> <if test="couponType != null">#{couponType},</if>
<if test="duration != null and duration != ''">#{duration},</if> <if test="duration != null and duration != ''">#{duration},</if>
<if test="minDuration != null and minDuration != ''">#{minDuration},</if> <if test="minDuration != null and minDuration != ''">#{minDuration},</if>
<if test="maxDuration != null and maxDuration != ''">#{maxDuration},</if> <if test="maxDuration != null and maxDuration != ''">#{maxDuration},</if>
<if test="minPrice != null">#{minPrice},</if> <if test="minPrice != null and minPrice != ''">#{minPrice},</if>
<if test="subPrice != null">#{subPrice},</if> <if test="subPrice != null and subPrice != ''">#{subPrice},</if>
<if test="platform != null">#{platform},</if> <if test="isOverlay != null">#{isOverlay},</if>
<if test="platformType != null">#{platformType},</if> <if test="platformType != null">#{platformType},</if>
<if test="startDate != null">#{startDate},</if> <if test="number != null">#{number},</if>
<if test="endDate != null">#{endDate},</if>
<if test="createBy != null">#{createBy},</if> <if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if> <if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if> <if test="remark != null">#{remark},</if>
</trim> </trim>
</insert> </insert>
...@@ -94,16 +125,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -94,16 +125,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update s_coupon update s_coupon
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="name != null and name != ''">name = #{name},</if> <if test="name != null and name != ''">name = #{name},</if>
<if test="startDate != null">start_date = #{startDate},</if>
<if test="endDate != null">end_date = #{endDate},</if>
<if test="validStartTime != null">valid_start_time = #{validStartTime},</if>
<if test="validEndTime != null">valid_end_time = #{validEndTime},</if>
<if test="storeType != null">store_type = #{storeType},</if>
<if test="roomType != null">room_type = #{roomType},</if>
<if test="couponType != null">coupon_type = #{couponType},</if> <if test="couponType != null">coupon_type = #{couponType},</if>
<if test="duration != null and duration != ''">duration = #{duration},</if> <if test="duration != null and duration != ''">duration = #{duration},</if>
<if test="minDuration != null and minDuration != ''">min_duration = #{minDuration},</if> <if test="minDuration != null and minDuration != ''">min_duration = #{minDuration},</if>
<if test="maxDuration != null and maxDuration != ''">max_duration = #{maxDuration},</if> <if test="maxDuration != null and maxDuration != ''">max_duration = #{maxDuration},</if>
<if test="minPrice != null">min_price = #{minPrice},</if> <if test="minPrice != null and minPrice != ''">min_price = #{minPrice},</if>
<if test="subPrice != null">sub_price = #{subPrice},</if> <if test="subPrice != null and subPrice != ''">sub_price = #{subPrice},</if>
<if test="platform != null">platform = #{platform},</if> <if test="isOverlay != null">is_overlay = #{isOverlay},</if>
<if test="platformType != null">platform_type = #{platformType},</if> <if test="platformType != null">platform_type = #{platformType},</if>
<if test="startDate != null">start_date = #{startDate},</if> <if test="number != null">number = #{number},</if>
<if test="endDate != null">end_date = #{endDate},</if>
<if test="createBy != null">create_by = #{createBy},</if> <if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if> <if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if> <if test="updateBy != null">update_by = #{updateBy},</if>
......
...@@ -101,35 +101,35 @@ ...@@ -101,35 +101,35 @@
<insert id="insertSOrder" parameterType="SOrder" useGeneratedKeys="true" keyProperty="id"> <insert id="insertSOrder" parameterType="SOrder" useGeneratedKeys="true" keyProperty="id">
insert into s_order insert into s_order
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="orderNo != null"> order_no = #{orderNo},</if> <if test="orderNo != null and orderNo != ''"> order_no,</if>
<if test="orderType != null"> order_type = #{orderType},</if> <if test="orderType != null and orderType != ''"> order_type,</if>
<if test="payType != null"> pay_type = #{payType},</if> <if test="payType != null and payType != ''"> pay_type,</if>
<if test="payStatus != null"> pay_status = #{payStatus},</if> <if test="payStatus != null and payStatus != ''"> pay_status,</if>
<if test="storeId != null"> store_id = #{storeId},</if> <if test="storeId != null and storeId != ''"> store_id,</if>
<if test="roomId != null"> room_id = #{roomId},</if> <if test="roomId != null and roomId != ''"> room_id,</if>
<if test="consumerId != null"> consumer_id = #{consumerId},</if> <if test="consumerId != null and consumerId != ''"> consumer_id,</if>
<if test="consumerName != null"> consumer_name = #{consumerName},</if> <if test="consumerName != null and consumerName != ''"> consumer_name,</if>
<if test="consumerPhone != null"> consumer_phone = #{consumerPhone},</if> <if test="consumerPhone != null and consumerPhone != ''"> consumer_phone,</if>
<if test="packId != null"> pack_id = #{packId},</if> <if test="packId != null and packId != ''"> pack_id,</if>
<if test="packPrice != null"> pack_price = #{packPrice},</if> <if test="packPrice != null and packPrice != ''"> pack_price,</if>
<if test="couponId != null"> coupon_id = #{couponId},</if> <if test="couponId != null and couponId != ''"> coupon_id,</if>
<if test="couponPrice != null"> coupon_price = #{couponPrice},</if> <if test="couponPrice != null and couponPrice != ''"> coupon_price,</if>
<if test="totalPrice != null"> total_price = #{totalPrice},</if> <if test="totalPrice != null and totalPrice != ''"> total_price,</if>
<if test="payPrice != null"> pay_price = #{payPrice},</if> <if test="payPrice != null and payPrice != ''"> pay_price,</if>
<if test="payTime != null"> pay_time = #{payTime},</if> <if test="payTime != null and payTime != ''"> pay_time,</if>
<if test="timeLong != null"> time_long = #{timeLong},</if> <if test="timeLong != null and timeLong != ''"> time_long,</if>
<if test="preStartDate != null"> pre_start_date = #{preStartDate},</if> <if test="preStartDate != null and preStartDate != ''"> pre_start_date,</if>
<if test="preEndDate != null"> pre_end_date = #{preEndDate},</if> <if test="preEndDate != null and preEndDate != ''"> pre_end_date,</if>
<if test="startDate != null"> start_date = #{startDate},</if> <if test="startDate != null and startDate != ''"> start_date,</if>
<if test="endDate != null"> end_date = #{endDate},</if> <if test="endDate != null and endDate != ''"> end_date,</if>
<if test="status != null"> status = #{status},</if> <if test="status != null and status != ''"> status,</if>
<if test="refundStatus != null"> refund_status = #{refundStatus},</if> <if test="refundStatus != null and refundStatus != ''"> refund_status,</if>
<if test="refundReason != null"> refund_reason = #{refundReason},</if> <if test="refundReason != null and refundReason != ''"> refund_reason,</if>
<if test="refundReasonTime != null"> refund_reason_time = #{refundReasonTime},</if> <if test="refundReasonTime != null and refundReasonTime != ''"> refund_reason_time,</if>
<if test="refundPrice != null"> refund_price = #{refundPrice},</if> <if test="refundPrice != null and refundPrice != ''"> refund_price,</if>
<if test="isDelete != null"> is_delete = #{isDelete},</if> <if test="isDelete != null and isDelete != ''"> is_delete,</if>
<if test="createBy != null"> create_by = #{createBy},</if> <if test="createBy != null and createBy != ''"> create_by,</if>
<if test="createTime != null"> create_time = #{createTime},</if> <if test="createTime != null and createTime != ''"> create_time,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="orderNo != null"> #{orderNo},</if> <if test="orderNo != null"> #{orderNo},</if>
...@@ -160,7 +160,7 @@ ...@@ -160,7 +160,7 @@
<if test="refundPrice != null"> #{refundPrice},</if> <if test="refundPrice != null"> #{refundPrice},</if>
<if test="isDelete != null"> 0,</if> <if test="isDelete != null"> 0,</if>
<if test="createBy != null"> #{createBy},</if> <if test="createBy != null"> #{createBy},</if>
<if test="createTime != null"> NOW(),</if> <if test="createTime != null"> #{createTime},</if>
</trim> </trim>
</insert> </insert>
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4"> <module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8"> <component name="AdditionalModuleElements">
<output url="file://$MODULE_DIR$/target/classes" /> <content url="file://$MODULE_DIR$" dumb="true">
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/target" /> <excludeFolder url="file://$MODULE_DIR$/target" />
</content> </content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component> </component>
</module> </module>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment