parent
50fe314f9f
commit
0ca02ba3dc
@ -0,0 +1,81 @@ |
||||
package com.hai.dao; |
||||
|
||||
import com.hai.entity.HighCouponRecycle; |
||||
import com.hai.entity.HighCouponRecycleExample; |
||||
import java.util.List; |
||||
import org.apache.ibatis.annotations.DeleteProvider; |
||||
import org.apache.ibatis.annotations.Insert; |
||||
import org.apache.ibatis.annotations.InsertProvider; |
||||
import org.apache.ibatis.annotations.Options; |
||||
import org.apache.ibatis.annotations.Param; |
||||
import org.apache.ibatis.annotations.Result; |
||||
import org.apache.ibatis.annotations.Results; |
||||
import org.apache.ibatis.annotations.SelectProvider; |
||||
import org.apache.ibatis.annotations.UpdateProvider; |
||||
import org.apache.ibatis.type.JdbcType; |
||||
import org.springframework.stereotype.Repository; |
||||
|
||||
/** |
||||
* |
||||
* 代码由工具生成,请勿修改!!! |
||||
* 如果需要扩展请在其父类进行扩展 |
||||
* |
||||
**/ |
||||
@Repository |
||||
public interface HighCouponRecycleMapper extends HighCouponRecycleMapperExt { |
||||
@SelectProvider(type=HighCouponRecycleSqlProvider.class, method="countByExample") |
||||
long countByExample(HighCouponRecycleExample example); |
||||
|
||||
@DeleteProvider(type=HighCouponRecycleSqlProvider.class, method="deleteByExample") |
||||
int deleteByExample(HighCouponRecycleExample example); |
||||
|
||||
@Insert({ |
||||
"insert into high_coupon_recycle (coupon_id, coupon_name, ", |
||||
"merchant_id, coupon_sales_code, ", |
||||
"coupon_code_id, user_id, ", |
||||
"user_phone, order_no, ", |
||||
"order_id, receive_time, ", |
||||
"create_time, `status`, ", |
||||
"ext_1, ext_3, ext_2)", |
||||
"values (#{couponId,jdbcType=BIGINT}, #{couponName,jdbcType=VARCHAR}, ", |
||||
"#{merchantId,jdbcType=BIGINT}, #{couponSalesCode,jdbcType=VARCHAR}, ", |
||||
"#{couponCodeId,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT}, ", |
||||
"#{userPhone,jdbcType=VARCHAR}, #{orderNo,jdbcType=VARCHAR}, ", |
||||
"#{orderId,jdbcType=BIGINT}, #{receiveTime,jdbcType=TIMESTAMP}, ", |
||||
"#{createTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}, ", |
||||
"#{ext1,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR})" |
||||
}) |
||||
@Options(useGeneratedKeys=true,keyProperty="id") |
||||
int insert(HighCouponRecycle record); |
||||
|
||||
@InsertProvider(type=HighCouponRecycleSqlProvider.class, method="insertSelective") |
||||
@Options(useGeneratedKeys=true,keyProperty="id") |
||||
int insertSelective(HighCouponRecycle record); |
||||
|
||||
@SelectProvider(type=HighCouponRecycleSqlProvider.class, method="selectByExample") |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="coupon_id", property="couponId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="coupon_name", property="couponName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="merchant_id", property="merchantId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="coupon_sales_code", property="couponSalesCode", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="coupon_code_id", property="couponCodeId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="user_phone", property="userPhone", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="order_id", property="orderId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="receive_time", property="receiveTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR) |
||||
}) |
||||
List<HighCouponRecycle> selectByExample(HighCouponRecycleExample example); |
||||
|
||||
@UpdateProvider(type=HighCouponRecycleSqlProvider.class, method="updateByExampleSelective") |
||||
int updateByExampleSelective(@Param("record") HighCouponRecycle record, @Param("example") HighCouponRecycleExample example); |
||||
|
||||
@UpdateProvider(type=HighCouponRecycleSqlProvider.class, method="updateByExample") |
||||
int updateByExample(@Param("record") HighCouponRecycle record, @Param("example") HighCouponRecycleExample example); |
||||
} |
@ -0,0 +1,7 @@ |
||||
package com.hai.dao; |
||||
|
||||
/** |
||||
* mapper扩展类 |
||||
*/ |
||||
public interface HighCouponRecycleMapperExt { |
||||
} |
@ -0,0 +1,319 @@ |
||||
package com.hai.dao; |
||||
|
||||
import com.hai.entity.HighCouponRecycle; |
||||
import com.hai.entity.HighCouponRecycleExample.Criteria; |
||||
import com.hai.entity.HighCouponRecycleExample.Criterion; |
||||
import com.hai.entity.HighCouponRecycleExample; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import org.apache.ibatis.jdbc.SQL; |
||||
|
||||
public class HighCouponRecycleSqlProvider { |
||||
|
||||
public String countByExample(HighCouponRecycleExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.SELECT("count(*)").FROM("high_coupon_recycle"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String deleteByExample(HighCouponRecycleExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.DELETE_FROM("high_coupon_recycle"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String insertSelective(HighCouponRecycle record) { |
||||
SQL sql = new SQL(); |
||||
sql.INSERT_INTO("high_coupon_recycle"); |
||||
|
||||
if (record.getCouponId() != null) { |
||||
sql.VALUES("coupon_id", "#{couponId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getCouponName() != null) { |
||||
sql.VALUES("coupon_name", "#{couponName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getMerchantId() != null) { |
||||
sql.VALUES("merchant_id", "#{merchantId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getCouponSalesCode() != null) { |
||||
sql.VALUES("coupon_sales_code", "#{couponSalesCode,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getCouponCodeId() != null) { |
||||
sql.VALUES("coupon_code_id", "#{couponCodeId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getUserId() != null) { |
||||
sql.VALUES("user_id", "#{userId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getUserPhone() != null) { |
||||
sql.VALUES("user_phone", "#{userPhone,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getOrderNo() != null) { |
||||
sql.VALUES("order_no", "#{orderNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getOrderId() != null) { |
||||
sql.VALUES("order_id", "#{orderId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getReceiveTime() != null) { |
||||
sql.VALUES("receive_time", "#{receiveTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.VALUES("ext_1", "#{ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.VALUES("ext_3", "#{ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.VALUES("ext_2", "#{ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String selectByExample(HighCouponRecycleExample example) { |
||||
SQL sql = new SQL(); |
||||
if (example != null && example.isDistinct()) { |
||||
sql.SELECT_DISTINCT("id"); |
||||
} else { |
||||
sql.SELECT("id"); |
||||
} |
||||
sql.SELECT("coupon_id"); |
||||
sql.SELECT("coupon_name"); |
||||
sql.SELECT("merchant_id"); |
||||
sql.SELECT("coupon_sales_code"); |
||||
sql.SELECT("coupon_code_id"); |
||||
sql.SELECT("user_id"); |
||||
sql.SELECT("user_phone"); |
||||
sql.SELECT("order_no"); |
||||
sql.SELECT("order_id"); |
||||
sql.SELECT("receive_time"); |
||||
sql.SELECT("create_time"); |
||||
sql.SELECT("`status`"); |
||||
sql.SELECT("ext_1"); |
||||
sql.SELECT("ext_3"); |
||||
sql.SELECT("ext_2"); |
||||
sql.FROM("high_coupon_recycle"); |
||||
applyWhere(sql, example, false); |
||||
|
||||
if (example != null && example.getOrderByClause() != null) { |
||||
sql.ORDER_BY(example.getOrderByClause()); |
||||
} |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByExampleSelective(Map<String, Object> parameter) { |
||||
HighCouponRecycle record = (HighCouponRecycle) parameter.get("record"); |
||||
HighCouponRecycleExample example = (HighCouponRecycleExample) parameter.get("example"); |
||||
|
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("high_coupon_recycle"); |
||||
|
||||
if (record.getId() != null) { |
||||
sql.SET("id = #{record.id,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getCouponId() != null) { |
||||
sql.SET("coupon_id = #{record.couponId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getCouponName() != null) { |
||||
sql.SET("coupon_name = #{record.couponName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getMerchantId() != null) { |
||||
sql.SET("merchant_id = #{record.merchantId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getCouponSalesCode() != null) { |
||||
sql.SET("coupon_sales_code = #{record.couponSalesCode,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getCouponCodeId() != null) { |
||||
sql.SET("coupon_code_id = #{record.couponCodeId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getUserId() != null) { |
||||
sql.SET("user_id = #{record.userId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getUserPhone() != null) { |
||||
sql.SET("user_phone = #{record.userPhone,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getOrderNo() != null) { |
||||
sql.SET("order_no = #{record.orderNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getOrderId() != null) { |
||||
sql.SET("order_id = #{record.orderId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getReceiveTime() != null) { |
||||
sql.SET("receive_time = #{record.receiveTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
applyWhere(sql, example, true); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByExample(Map<String, Object> parameter) { |
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("high_coupon_recycle"); |
||||
|
||||
sql.SET("id = #{record.id,jdbcType=BIGINT}"); |
||||
sql.SET("coupon_id = #{record.couponId,jdbcType=BIGINT}"); |
||||
sql.SET("coupon_name = #{record.couponName,jdbcType=VARCHAR}"); |
||||
sql.SET("merchant_id = #{record.merchantId,jdbcType=BIGINT}"); |
||||
sql.SET("coupon_sales_code = #{record.couponSalesCode,jdbcType=VARCHAR}"); |
||||
sql.SET("coupon_code_id = #{record.couponCodeId,jdbcType=BIGINT}"); |
||||
sql.SET("user_id = #{record.userId,jdbcType=BIGINT}"); |
||||
sql.SET("user_phone = #{record.userPhone,jdbcType=VARCHAR}"); |
||||
sql.SET("order_no = #{record.orderNo,jdbcType=VARCHAR}"); |
||||
sql.SET("order_id = #{record.orderId,jdbcType=BIGINT}"); |
||||
sql.SET("receive_time = #{record.receiveTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); |
||||
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); |
||||
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); |
||||
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); |
||||
|
||||
HighCouponRecycleExample example = (HighCouponRecycleExample) parameter.get("example"); |
||||
applyWhere(sql, example, true); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
protected void applyWhere(SQL sql, HighCouponRecycleExample example, boolean includeExamplePhrase) { |
||||
if (example == null) { |
||||
return; |
||||
} |
||||
|
||||
String parmPhrase1; |
||||
String parmPhrase1_th; |
||||
String parmPhrase2; |
||||
String parmPhrase2_th; |
||||
String parmPhrase3; |
||||
String parmPhrase3_th; |
||||
if (includeExamplePhrase) { |
||||
parmPhrase1 = "%s #{example.oredCriteria[%d].allCriteria[%d].value}"; |
||||
parmPhrase1_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; |
||||
parmPhrase2 = "%s #{example.oredCriteria[%d].allCriteria[%d].value} and #{example.oredCriteria[%d].criteria[%d].secondValue}"; |
||||
parmPhrase2_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{example.oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; |
||||
parmPhrase3 = "#{example.oredCriteria[%d].allCriteria[%d].value[%d]}"; |
||||
parmPhrase3_th = "#{example.oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; |
||||
} else { |
||||
parmPhrase1 = "%s #{oredCriteria[%d].allCriteria[%d].value}"; |
||||
parmPhrase1_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; |
||||
parmPhrase2 = "%s #{oredCriteria[%d].allCriteria[%d].value} and #{oredCriteria[%d].criteria[%d].secondValue}"; |
||||
parmPhrase2_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; |
||||
parmPhrase3 = "#{oredCriteria[%d].allCriteria[%d].value[%d]}"; |
||||
parmPhrase3_th = "#{oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; |
||||
} |
||||
|
||||
StringBuilder sb = new StringBuilder(); |
||||
List<Criteria> oredCriteria = example.getOredCriteria(); |
||||
boolean firstCriteria = true; |
||||
for (int i = 0; i < oredCriteria.size(); i++) { |
||||
Criteria criteria = oredCriteria.get(i); |
||||
if (criteria.isValid()) { |
||||
if (firstCriteria) { |
||||
firstCriteria = false; |
||||
} else { |
||||
sb.append(" or "); |
||||
} |
||||
|
||||
sb.append('('); |
||||
List<Criterion> criterions = criteria.getAllCriteria(); |
||||
boolean firstCriterion = true; |
||||
for (int j = 0; j < criterions.size(); j++) { |
||||
Criterion criterion = criterions.get(j); |
||||
if (firstCriterion) { |
||||
firstCriterion = false; |
||||
} else { |
||||
sb.append(" and "); |
||||
} |
||||
|
||||
if (criterion.isNoValue()) { |
||||
sb.append(criterion.getCondition()); |
||||
} else if (criterion.isSingleValue()) { |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase1, criterion.getCondition(), i, j)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase1_th, criterion.getCondition(), i, j,criterion.getTypeHandler())); |
||||
} |
||||
} else if (criterion.isBetweenValue()) { |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase2, criterion.getCondition(), i, j, i, j)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase2_th, criterion.getCondition(), i, j, criterion.getTypeHandler(), i, j, criterion.getTypeHandler())); |
||||
} |
||||
} else if (criterion.isListValue()) { |
||||
sb.append(criterion.getCondition()); |
||||
sb.append(" ("); |
||||
List<?> listItems = (List<?>) criterion.getValue(); |
||||
boolean comma = false; |
||||
for (int k = 0; k < listItems.size(); k++) { |
||||
if (comma) { |
||||
sb.append(", "); |
||||
} else { |
||||
comma = true; |
||||
} |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase3, i, j, k)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase3_th, i, j, k, criterion.getTypeHandler())); |
||||
} |
||||
} |
||||
sb.append(')'); |
||||
} |
||||
} |
||||
sb.append(')'); |
||||
} |
||||
} |
||||
|
||||
if (sb.length() > 0) { |
||||
sql.WHERE(sb.toString()); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,296 @@ |
||||
package com.hai.entity; |
||||
|
||||
import java.io.Serializable; |
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* high_coupon_recycle |
||||
* @author |
||||
*/ |
||||
/** |
||||
* |
||||
* 代码由工具生成 |
||||
* |
||||
**/ |
||||
public class HighCouponRecycle implements Serializable { |
||||
/** |
||||
* 主键 |
||||
*/ |
||||
private Long id; |
||||
|
||||
/** |
||||
* 卡卷 |
||||
*/ |
||||
private Long couponId; |
||||
|
||||
/** |
||||
* 卡卷名称 |
||||
*/ |
||||
private String couponName; |
||||
|
||||
/** |
||||
* 商户 |
||||
*/ |
||||
private Long merchantId; |
||||
|
||||
/** |
||||
* 销售码 |
||||
*/ |
||||
private String couponSalesCode; |
||||
|
||||
/** |
||||
* 销售码id |
||||
*/ |
||||
private Long couponCodeId; |
||||
|
||||
/** |
||||
* 用户id |
||||
*/ |
||||
private Long userId; |
||||
|
||||
/** |
||||
* 用户手机号 |
||||
*/ |
||||
private String userPhone; |
||||
|
||||
/** |
||||
* 订单流水号 |
||||
*/ |
||||
private String orderNo; |
||||
|
||||
/** |
||||
* 订单id |
||||
*/ |
||||
private Long orderId; |
||||
|
||||
/** |
||||
* 领取时间 |
||||
*/ |
||||
private Date receiveTime; |
||||
|
||||
/** |
||||
* 创建时间 |
||||
*/ |
||||
private Date createTime; |
||||
|
||||
/** |
||||
* 状态:1.过期 2.退款 |
||||
*/ |
||||
private Integer status; |
||||
|
||||
private String ext1; |
||||
|
||||
private String ext3; |
||||
|
||||
private String ext2; |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
public Long getId() { |
||||
return id; |
||||
} |
||||
|
||||
public void setId(Long id) { |
||||
this.id = id; |
||||
} |
||||
|
||||
public Long getCouponId() { |
||||
return couponId; |
||||
} |
||||
|
||||
public void setCouponId(Long couponId) { |
||||
this.couponId = couponId; |
||||
} |
||||
|
||||
public String getCouponName() { |
||||
return couponName; |
||||
} |
||||
|
||||
public void setCouponName(String couponName) { |
||||
this.couponName = couponName; |
||||
} |
||||
|
||||
public Long getMerchantId() { |
||||
return merchantId; |
||||
} |
||||
|
||||
public void setMerchantId(Long merchantId) { |
||||
this.merchantId = merchantId; |
||||
} |
||||
|
||||
public String getCouponSalesCode() { |
||||
return couponSalesCode; |
||||
} |
||||
|
||||
public void setCouponSalesCode(String couponSalesCode) { |
||||
this.couponSalesCode = couponSalesCode; |
||||
} |
||||
|
||||
public Long getCouponCodeId() { |
||||
return couponCodeId; |
||||
} |
||||
|
||||
public void setCouponCodeId(Long couponCodeId) { |
||||
this.couponCodeId = couponCodeId; |
||||
} |
||||
|
||||
public Long getUserId() { |
||||
return userId; |
||||
} |
||||
|
||||
public void setUserId(Long userId) { |
||||
this.userId = userId; |
||||
} |
||||
|
||||
public String getUserPhone() { |
||||
return userPhone; |
||||
} |
||||
|
||||
public void setUserPhone(String userPhone) { |
||||
this.userPhone = userPhone; |
||||
} |
||||
|
||||
public String getOrderNo() { |
||||
return orderNo; |
||||
} |
||||
|
||||
public void setOrderNo(String orderNo) { |
||||
this.orderNo = orderNo; |
||||
} |
||||
|
||||
public Long getOrderId() { |
||||
return orderId; |
||||
} |
||||
|
||||
public void setOrderId(Long orderId) { |
||||
this.orderId = orderId; |
||||
} |
||||
|
||||
public Date getReceiveTime() { |
||||
return receiveTime; |
||||
} |
||||
|
||||
public void setReceiveTime(Date receiveTime) { |
||||
this.receiveTime = receiveTime; |
||||
} |
||||
|
||||
public Date getCreateTime() { |
||||
return createTime; |
||||
} |
||||
|
||||
public void setCreateTime(Date createTime) { |
||||
this.createTime = createTime; |
||||
} |
||||
|
||||
public Integer getStatus() { |
||||
return status; |
||||
} |
||||
|
||||
public void setStatus(Integer status) { |
||||
this.status = status; |
||||
} |
||||
|
||||
public String getExt1() { |
||||
return ext1; |
||||
} |
||||
|
||||
public void setExt1(String ext1) { |
||||
this.ext1 = ext1; |
||||
} |
||||
|
||||
public String getExt3() { |
||||
return ext3; |
||||
} |
||||
|
||||
public void setExt3(String ext3) { |
||||
this.ext3 = ext3; |
||||
} |
||||
|
||||
public String getExt2() { |
||||
return ext2; |
||||
} |
||||
|
||||
public void setExt2(String ext2) { |
||||
this.ext2 = ext2; |
||||
} |
||||
|
||||
@Override |
||||
public boolean equals(Object that) { |
||||
if (this == that) { |
||||
return true; |
||||
} |
||||
if (that == null) { |
||||
return false; |
||||
} |
||||
if (getClass() != that.getClass()) { |
||||
return false; |
||||
} |
||||
HighCouponRecycle other = (HighCouponRecycle) that; |
||||
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) |
||||
&& (this.getCouponId() == null ? other.getCouponId() == null : this.getCouponId().equals(other.getCouponId())) |
||||
&& (this.getCouponName() == null ? other.getCouponName() == null : this.getCouponName().equals(other.getCouponName())) |
||||
&& (this.getMerchantId() == null ? other.getMerchantId() == null : this.getMerchantId().equals(other.getMerchantId())) |
||||
&& (this.getCouponSalesCode() == null ? other.getCouponSalesCode() == null : this.getCouponSalesCode().equals(other.getCouponSalesCode())) |
||||
&& (this.getCouponCodeId() == null ? other.getCouponCodeId() == null : this.getCouponCodeId().equals(other.getCouponCodeId())) |
||||
&& (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId())) |
||||
&& (this.getUserPhone() == null ? other.getUserPhone() == null : this.getUserPhone().equals(other.getUserPhone())) |
||||
&& (this.getOrderNo() == null ? other.getOrderNo() == null : this.getOrderNo().equals(other.getOrderNo())) |
||||
&& (this.getOrderId() == null ? other.getOrderId() == null : this.getOrderId().equals(other.getOrderId())) |
||||
&& (this.getReceiveTime() == null ? other.getReceiveTime() == null : this.getReceiveTime().equals(other.getReceiveTime())) |
||||
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) |
||||
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) |
||||
&& (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1())) |
||||
&& (this.getExt3() == null ? other.getExt3() == null : this.getExt3().equals(other.getExt3())) |
||||
&& (this.getExt2() == null ? other.getExt2() == null : this.getExt2().equals(other.getExt2())); |
||||
} |
||||
|
||||
@Override |
||||
public int hashCode() { |
||||
final int prime = 31; |
||||
int result = 1; |
||||
result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); |
||||
result = prime * result + ((getCouponId() == null) ? 0 : getCouponId().hashCode()); |
||||
result = prime * result + ((getCouponName() == null) ? 0 : getCouponName().hashCode()); |
||||
result = prime * result + ((getMerchantId() == null) ? 0 : getMerchantId().hashCode()); |
||||
result = prime * result + ((getCouponSalesCode() == null) ? 0 : getCouponSalesCode().hashCode()); |
||||
result = prime * result + ((getCouponCodeId() == null) ? 0 : getCouponCodeId().hashCode()); |
||||
result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode()); |
||||
result = prime * result + ((getUserPhone() == null) ? 0 : getUserPhone().hashCode()); |
||||
result = prime * result + ((getOrderNo() == null) ? 0 : getOrderNo().hashCode()); |
||||
result = prime * result + ((getOrderId() == null) ? 0 : getOrderId().hashCode()); |
||||
result = prime * result + ((getReceiveTime() == null) ? 0 : getReceiveTime().hashCode()); |
||||
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); |
||||
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); |
||||
result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode()); |
||||
result = prime * result + ((getExt3() == null) ? 0 : getExt3().hashCode()); |
||||
result = prime * result + ((getExt2() == null) ? 0 : getExt2().hashCode()); |
||||
return result; |
||||
} |
||||
|
||||
@Override |
||||
public String toString() { |
||||
StringBuilder sb = new StringBuilder(); |
||||
sb.append(getClass().getSimpleName()); |
||||
sb.append(" ["); |
||||
sb.append("Hash = ").append(hashCode()); |
||||
sb.append(", id=").append(id); |
||||
sb.append(", couponId=").append(couponId); |
||||
sb.append(", couponName=").append(couponName); |
||||
sb.append(", merchantId=").append(merchantId); |
||||
sb.append(", couponSalesCode=").append(couponSalesCode); |
||||
sb.append(", couponCodeId=").append(couponCodeId); |
||||
sb.append(", userId=").append(userId); |
||||
sb.append(", userPhone=").append(userPhone); |
||||
sb.append(", orderNo=").append(orderNo); |
||||
sb.append(", orderId=").append(orderId); |
||||
sb.append(", receiveTime=").append(receiveTime); |
||||
sb.append(", createTime=").append(createTime); |
||||
sb.append(", status=").append(status); |
||||
sb.append(", ext1=").append(ext1); |
||||
sb.append(", ext3=").append(ext3); |
||||
sb.append(", ext2=").append(ext2); |
||||
sb.append(", serialVersionUID=").append(serialVersionUID); |
||||
sb.append("]"); |
||||
return sb.toString(); |
||||
} |
||||
} |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,36 @@ |
||||
package com.hai.enum_type; |
||||
|
||||
/** |
||||
* @Auther: 胡锐 |
||||
* @Description: |
||||
* @Date: 2021/3/14 20:41 |
||||
*/ |
||||
public enum ApproveType { |
||||
UP_SHELF_APPROVE(1, "卡卷上架审批") |
||||
; |
||||
|
||||
private Integer type; |
||||
|
||||
private String name; |
||||
|
||||
ApproveType(int type, String name) { |
||||
this.type = type; |
||||
this.name = name; |
||||
} |
||||
|
||||
public Integer getType() { |
||||
return type; |
||||
} |
||||
|
||||
public void setType(Integer type) { |
||||
this.type = type; |
||||
} |
||||
|
||||
public String getName() { |
||||
return name; |
||||
} |
||||
|
||||
public void setName(String name) { |
||||
this.name = name; |
||||
} |
||||
} |
@ -0,0 +1,19 @@ |
||||
package com.hai.service; |
||||
|
||||
import com.hai.entity.HighApprove; |
||||
|
||||
/** |
||||
* @Auther: 胡锐 |
||||
* @Description: |
||||
* @Date: 2021/3/14 20:46 |
||||
*/ |
||||
public interface HighApproveService { |
||||
|
||||
/** |
||||
* @Author 胡锐 |
||||
* @Description 增加审批 |
||||
* @Date 2021/3/14 20:46 |
||||
**/ |
||||
void insertApprove(HighApprove highApprove); |
||||
|
||||
} |
@ -0,0 +1,19 @@ |
||||
package com.hai.service; |
||||
|
||||
import com.hai.entity.HighCouponCode; |
||||
|
||||
/** |
||||
* @Auther: 胡锐 |
||||
* @Description: 卡券销售码 |
||||
* @Date: 2021/3/14 17:44 |
||||
*/ |
||||
public interface HighCouponCodeService { |
||||
|
||||
/** |
||||
* @Author 胡锐 |
||||
* @Description 增加 |
||||
* @Date 2021/3/14 17:44 |
||||
**/ |
||||
void insertCouponCode(HighCouponCode highCouponCode); |
||||
|
||||
} |
@ -0,0 +1,36 @@ |
||||
package com.hai.service; |
||||
|
||||
import com.hai.entity.HighGoodsPriceRefer; |
||||
|
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* @Auther: 胡锐 |
||||
* @Description: 产品销售价格配置 |
||||
* @Date: 2021/3/14 16:25 |
||||
*/ |
||||
public interface HighGoodsPriceReferService { |
||||
|
||||
/** |
||||
* @Author 胡锐 |
||||
* @Description 增加 |
||||
* @Date 2021/3/14 16:26 |
||||
**/ |
||||
void insertPriceRefer(HighGoodsPriceRefer highGoodsPriceRefer); |
||||
|
||||
/** |
||||
* @Author 胡锐 |
||||
* @Description 卡卷价格 处于待编辑、已生效、待生效、审批中 全部失效 |
||||
* @Date 2021/3/14 20:14 |
||||
**/ |
||||
void couponAllPriceInvalid(Long couponId); |
||||
|
||||
/** |
||||
* @Author 胡锐 |
||||
* @Description 卡卷价格 处于待编辑、待生效、审批中 全部失效。但保留当前生效的价格 |
||||
* @Date 2021/3/14 21:00 |
||||
**/ |
||||
void couponAllInvalidKeepCurrent(Long couponId); |
||||
|
||||
} |
@ -0,0 +1,46 @@ |
||||
package com.hai.service.impl; |
||||
|
||||
import com.hai.common.exception.ErrorCode; |
||||
import com.hai.common.exception.ErrorHelp; |
||||
import com.hai.common.exception.SysCode; |
||||
import com.hai.dao.HighApproveMapper; |
||||
import com.hai.entity.HighApprove; |
||||
import com.hai.entity.HighCoupon; |
||||
import com.hai.enum_type.ApproveType; |
||||
import com.hai.model.HighCouponModel; |
||||
import com.hai.service.HighApproveService; |
||||
import com.hai.service.HighCouponService; |
||||
import org.springframework.stereotype.Service; |
||||
import org.springframework.transaction.annotation.Propagation; |
||||
import org.springframework.transaction.annotation.Transactional; |
||||
|
||||
import javax.annotation.Resource; |
||||
import java.util.Date; |
||||
import java.util.Objects; |
||||
|
||||
/** |
||||
* @Auther: 胡锐 |
||||
* @Description: |
||||
* @Date: 2021/3/14 20:47 |
||||
*/ |
||||
@Service("highApproveService") |
||||
public class HighApproveServiceImpl implements HighApproveService { |
||||
|
||||
@Resource |
||||
private HighApproveMapper highApproveMapper; |
||||
|
||||
@Resource |
||||
private HighCouponService highCouponService; |
||||
|
||||
@Override |
||||
@Transactional(propagation= Propagation.REQUIRES_NEW) |
||||
public void insertApprove(HighApprove highApprove) { |
||||
|
||||
// 卡卷上架审批
|
||||
if (Objects.equals(highApprove.getObjectType(), ApproveType.UP_SHELF_APPROVE.getType())) { |
||||
highCouponService.upShelfApprove(highApprove.getObjectId()); |
||||
} |
||||
|
||||
highApproveMapper.insert(highApprove); |
||||
} |
||||
} |
@ -0,0 +1,27 @@ |
||||
package com.hai.service.impl; |
||||
|
||||
import com.hai.dao.HighCouponCodeMapper; |
||||
import com.hai.entity.HighCoupon; |
||||
import com.hai.entity.HighCouponCode; |
||||
import com.hai.model.HighCouponModel; |
||||
import com.hai.service.HighCouponCodeService; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import javax.annotation.Resource; |
||||
|
||||
/** |
||||
* @Auther: 胡锐 |
||||
* @Description: |
||||
* @Date: 2021/3/14 17:45 |
||||
*/ |
||||
@Service("highCouponCodeService") |
||||
public class HighCouponCodeServiceImpl implements HighCouponCodeService { |
||||
|
||||
@Resource |
||||
private HighCouponCodeMapper highCouponCodeMapper; |
||||
|
||||
@Override |
||||
public void insertCouponCode(HighCouponCode highCouponCode) { |
||||
highCouponCodeMapper.insert(highCouponCode); |
||||
} |
||||
} |
@ -0,0 +1,71 @@ |
||||
package com.hai.service.impl; |
||||
|
||||
import com.hai.dao.HighGoodsPriceReferMapper; |
||||
import com.hai.entity.HighGoodsPriceRefer; |
||||
import com.hai.entity.HighGoodsPriceReferExample; |
||||
import com.hai.entity.HighMerchant; |
||||
import com.hai.service.HighGoodsPriceReferService; |
||||
import org.apache.commons.collections4.MapUtils; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import javax.annotation.Resource; |
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* @Auther: 胡锐 |
||||
* @Description: 产品销售价格配置 |
||||
* @Date: 2021/3/14 16:26 |
||||
*/ |
||||
@Service("highGoodsPriceReferService") |
||||
public class HighGoodsPriceReferServiceImpl implements HighGoodsPriceReferService { |
||||
|
||||
@Resource |
||||
private HighGoodsPriceReferMapper highGoodsPriceReferMapper; |
||||
|
||||
@Override |
||||
public void insertPriceRefer(HighGoodsPriceRefer highGoodsPriceRefer) { |
||||
highGoodsPriceReferMapper.insert(highGoodsPriceRefer); |
||||
} |
||||
|
||||
@Override |
||||
public void couponAllPriceInvalid(Long couponId) { |
||||
List<Integer> statusList = new ArrayList<>(); |
||||
statusList.add(1); |
||||
statusList.add(2); |
||||
statusList.add(3); |
||||
statusList.add(101); |
||||
HighGoodsPriceReferExample example = new HighGoodsPriceReferExample(); |
||||
example.createCriteria().andObjectIdEqualTo(couponId).andStatusIn(statusList); |
||||
|
||||
List<HighGoodsPriceRefer> referList = highGoodsPriceReferMapper.selectByExample(example); |
||||
if (referList != null && referList.size() > 0) { |
||||
for (HighGoodsPriceRefer refer : referList) { |
||||
refer.setStatus(4); |
||||
highGoodsPriceReferMapper.updateByPrimaryKey(refer); |
||||
} |
||||
} |
||||
} |
||||
|
||||
@Override |
||||
public void couponAllInvalidKeepCurrent(Long couponId) { |
||||
List<Integer> statusList = new ArrayList<>(); |
||||
statusList.add(1); |
||||
statusList.add(2); |
||||
statusList.add(101); |
||||
|
||||
HighGoodsPriceReferExample example = new HighGoodsPriceReferExample(); |
||||
example.createCriteria().andObjectIdEqualTo(couponId).andStatusIn(statusList); |
||||
|
||||
List<HighGoodsPriceRefer> referList = highGoodsPriceReferMapper.selectByExample(example); |
||||
if (referList != null && referList.size() > 0) { |
||||
for (HighGoodsPriceRefer refer : referList) { |
||||
refer.setStatus(4); |
||||
highGoodsPriceReferMapper.updateByPrimaryKey(refer); |
||||
} |
||||
} |
||||
} |
||||
|
||||
|
||||
} |
Loading…
Reference in new issue