提交代码

dev-discount
胡锐 3 years ago
parent 52c876bb39
commit eb1c32ef47
  1. 17
      hai-service/src/main/java/com/hai/dao/HighCouponAgentCodeMapper.java
  2. 14
      hai-service/src/main/java/com/hai/dao/HighCouponAgentCodeSqlProvider.java
  3. 6
      hai-service/src/main/java/com/hai/dao/HighCouponAgentRelMapperExt.java
  4. 16
      hai-service/src/main/java/com/hai/entity/HighCouponAgentCode.java
  5. 60
      hai-service/src/main/java/com/hai/entity/HighCouponAgentCodeExample.java
  6. 1
      hai-service/src/main/java/com/hai/service/impl/HighCouponAgentServiceImpl.java

@ -45,16 +45,18 @@ public interface HighCouponAgentCodeMapper extends HighCouponAgentCodeMapperExt
"coupon_code_id, coupon_code, ",
"qr_code, `status`, ",
"remark, create_time, ",
"operator_id, operator_name, ",
"ext_1, ext_2, ext_3)",
"sales_time, operator_id, ",
"operator_name, ext_1, ",
"ext_2, ext_3)",
"values (#{type,jdbcType=INTEGER}, #{couponAgentId,jdbcType=BIGINT}, ",
"#{couponId,jdbcType=BIGINT}, #{agentId,jdbcType=BIGINT}, ",
"#{couponAgentRecordId,jdbcType=BIGINT}, #{convertCode,jdbcType=VARCHAR}, ",
"#{couponCodeId,jdbcType=BIGINT}, #{couponCode,jdbcType=VARCHAR}, ",
"#{qrCode,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ",
"#{remark,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, ",
"#{operatorId,jdbcType=BIGINT}, #{operatorName,jdbcType=VARCHAR}, ",
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
"#{salesTime,jdbcType=TIMESTAMP}, #{operatorId,jdbcType=BIGINT}, ",
"#{operatorName,jdbcType=VARCHAR}, #{ext1,jdbcType=VARCHAR}, ",
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(HighCouponAgentCode record);
@ -78,6 +80,7 @@ public interface HighCouponAgentCodeMapper extends HighCouponAgentCodeMapperExt
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="remark", property="remark", jdbcType=JdbcType.VARCHAR),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="sales_time", property="salesTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="operator_id", property="operatorId", jdbcType=JdbcType.BIGINT),
@Result(column="operator_name", property="operatorName", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
@ -89,8 +92,8 @@ public interface HighCouponAgentCodeMapper extends HighCouponAgentCodeMapperExt
@Select({
"select",
"id, `type`, coupon_agent_id, coupon_id, agent_id, coupon_agent_record_id, convert_code, ",
"coupon_code_id, coupon_code, qr_code, `status`, remark, create_time, operator_id, ",
"operator_name, ext_1, ext_2, ext_3",
"coupon_code_id, coupon_code, qr_code, `status`, remark, create_time, sales_time, ",
"operator_id, operator_name, ext_1, ext_2, ext_3",
"from high_coupon_agent_code",
"where id = #{id,jdbcType=BIGINT}"
})
@ -108,6 +111,7 @@ public interface HighCouponAgentCodeMapper extends HighCouponAgentCodeMapperExt
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="remark", property="remark", jdbcType=JdbcType.VARCHAR),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="sales_time", property="salesTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="operator_id", property="operatorId", jdbcType=JdbcType.BIGINT),
@Result(column="operator_name", property="operatorName", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
@ -139,6 +143,7 @@ public interface HighCouponAgentCodeMapper extends HighCouponAgentCodeMapperExt
"`status` = #{status,jdbcType=INTEGER},",
"remark = #{remark,jdbcType=VARCHAR},",
"create_time = #{createTime,jdbcType=TIMESTAMP},",
"sales_time = #{salesTime,jdbcType=TIMESTAMP},",
"operator_id = #{operatorId,jdbcType=BIGINT},",
"operator_name = #{operatorName,jdbcType=VARCHAR},",
"ext_1 = #{ext1,jdbcType=VARCHAR},",

@ -76,6 +76,10 @@ public class HighCouponAgentCodeSqlProvider {
sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}");
}
if (record.getSalesTime() != null) {
sql.VALUES("sales_time", "#{salesTime,jdbcType=TIMESTAMP}");
}
if (record.getOperatorId() != null) {
sql.VALUES("operator_id", "#{operatorId,jdbcType=BIGINT}");
}
@ -118,6 +122,7 @@ public class HighCouponAgentCodeSqlProvider {
sql.SELECT("`status`");
sql.SELECT("remark");
sql.SELECT("create_time");
sql.SELECT("sales_time");
sql.SELECT("operator_id");
sql.SELECT("operator_name");
sql.SELECT("ext_1");
@ -192,6 +197,10 @@ public class HighCouponAgentCodeSqlProvider {
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
}
if (record.getSalesTime() != null) {
sql.SET("sales_time = #{record.salesTime,jdbcType=TIMESTAMP}");
}
if (record.getOperatorId() != null) {
sql.SET("operator_id = #{record.operatorId,jdbcType=BIGINT}");
}
@ -233,6 +242,7 @@ public class HighCouponAgentCodeSqlProvider {
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
sql.SET("remark = #{record.remark,jdbcType=VARCHAR}");
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
sql.SET("sales_time = #{record.salesTime,jdbcType=TIMESTAMP}");
sql.SET("operator_id = #{record.operatorId,jdbcType=BIGINT}");
sql.SET("operator_name = #{record.operatorName,jdbcType=VARCHAR}");
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}");
@ -296,6 +306,10 @@ public class HighCouponAgentCodeSqlProvider {
sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}");
}
if (record.getSalesTime() != null) {
sql.SET("sales_time = #{salesTime,jdbcType=TIMESTAMP}");
}
if (record.getOperatorId() != null) {
sql.SET("operator_id = #{operatorId,jdbcType=BIGINT}");
}

@ -22,12 +22,12 @@ public interface HighCouponAgentRelMapperExt {
" case when sum(c.sales_price) is not null then sum(c.sales_price) else 0 end salesCountPrice " +
" from high_coupon_agent_code a,high_coupon_code b,high_coupon_agent_rel c" +
" where c.id = a.coupon_agent_id and c.agent_id = #{agentId}" +
" and b.status = 3 and a.coupon_code_id = b.id and b.consume_time >= #{consumeTimeS} and b.consume_time <= #{consumeTimeE}")
" and a.status in (2,3) and a.coupon_code_id = b.id and a.sales_time >= #{consumeTimeS} and a.sales_time <= #{consumeTimeE}")
AgentSalesModel getAgentSales(@Param("agentId") Long agentId, @Param("consumeTimeS")String consumeTimeS, @Param("consumeTimeE")String consumeTimeE);
@Select(" select a.* from high_coupon_agent_code a,high_coupon_code b,high_coupon_agent_rel c " +
" where c.id = a.coupon_agent_id and c.agent_id = #{agentId} and b.`status` = 3 and a.coupon_code_id = b.id " +
" and b.consume_time >= #{consumeTimeS} and b.consume_time <= #{consumeTimeE} ORDER BY b.consume_time desc")
" where c.id = a.coupon_agent_id and c.agent_id = #{agentId} and a.status in (2,3) and a.coupon_code_id = b.id " +
" and a.sales_time >= #{consumeTimeS} and a.sales_time <= #{consumeTimeE} ORDER BY a.sales_time desc")
@Results({
@Result(column="id", property="id", jdbcType= JdbcType.BIGINT, id=true),
@Result(column="coupon_agent_id", property="couponAgentId", jdbcType=JdbcType.BIGINT),

@ -80,6 +80,11 @@ public class HighCouponAgentCode extends HighCouponAgentCodeModel implements Ser
*/
private Date createTime;
/**
* 销售时间
*/
private Date salesTime;
/**
* 操作人
*/
@ -202,6 +207,14 @@ public class HighCouponAgentCode extends HighCouponAgentCodeModel implements Ser
this.createTime = createTime;
}
public Date getSalesTime() {
return salesTime;
}
public void setSalesTime(Date salesTime) {
this.salesTime = salesTime;
}
public Long getOperatorId() {
return operatorId;
}
@ -267,6 +280,7 @@ public class HighCouponAgentCode extends HighCouponAgentCodeModel implements Ser
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
&& (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getSalesTime() == null ? other.getSalesTime() == null : this.getSalesTime().equals(other.getSalesTime()))
&& (this.getOperatorId() == null ? other.getOperatorId() == null : this.getOperatorId().equals(other.getOperatorId()))
&& (this.getOperatorName() == null ? other.getOperatorName() == null : this.getOperatorName().equals(other.getOperatorName()))
&& (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1()))
@ -291,6 +305,7 @@ public class HighCouponAgentCode extends HighCouponAgentCodeModel implements Ser
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getSalesTime() == null) ? 0 : getSalesTime().hashCode());
result = prime * result + ((getOperatorId() == null) ? 0 : getOperatorId().hashCode());
result = prime * result + ((getOperatorName() == null) ? 0 : getOperatorName().hashCode());
result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode());
@ -318,6 +333,7 @@ public class HighCouponAgentCode extends HighCouponAgentCodeModel implements Ser
sb.append(", status=").append(status);
sb.append(", remark=").append(remark);
sb.append(", createTime=").append(createTime);
sb.append(", salesTime=").append(salesTime);
sb.append(", operatorId=").append(operatorId);
sb.append(", operatorName=").append(operatorName);
sb.append(", ext1=").append(ext1);

@ -945,6 +945,66 @@ public class HighCouponAgentCodeExample {
return (Criteria) this;
}
public Criteria andSalesTimeIsNull() {
addCriterion("sales_time is null");
return (Criteria) this;
}
public Criteria andSalesTimeIsNotNull() {
addCriterion("sales_time is not null");
return (Criteria) this;
}
public Criteria andSalesTimeEqualTo(Date value) {
addCriterion("sales_time =", value, "salesTime");
return (Criteria) this;
}
public Criteria andSalesTimeNotEqualTo(Date value) {
addCriterion("sales_time <>", value, "salesTime");
return (Criteria) this;
}
public Criteria andSalesTimeGreaterThan(Date value) {
addCriterion("sales_time >", value, "salesTime");
return (Criteria) this;
}
public Criteria andSalesTimeGreaterThanOrEqualTo(Date value) {
addCriterion("sales_time >=", value, "salesTime");
return (Criteria) this;
}
public Criteria andSalesTimeLessThan(Date value) {
addCriterion("sales_time <", value, "salesTime");
return (Criteria) this;
}
public Criteria andSalesTimeLessThanOrEqualTo(Date value) {
addCriterion("sales_time <=", value, "salesTime");
return (Criteria) this;
}
public Criteria andSalesTimeIn(List<Date> values) {
addCriterion("sales_time in", values, "salesTime");
return (Criteria) this;
}
public Criteria andSalesTimeNotIn(List<Date> values) {
addCriterion("sales_time not in", values, "salesTime");
return (Criteria) this;
}
public Criteria andSalesTimeBetween(Date value1, Date value2) {
addCriterion("sales_time between", value1, value2, "salesTime");
return (Criteria) this;
}
public Criteria andSalesTimeNotBetween(Date value1, Date value2) {
addCriterion("sales_time not between", value1, value2, "salesTime");
return (Criteria) this;
}
public Criteria andOperatorIdIsNull() {
addCriterion("operator_id is null");
return (Criteria) this;

@ -243,6 +243,7 @@ public class HighCouponAgentServiceImpl implements HighCouponAgentService {
}
couponAgentCode.setStatus(2); // 状态:1.待销售 2.未使用 3.已使用
couponAgentCode.setRemark(remark);
couponAgentCode.setSalesTime(new Date());
highCouponAgentCodeMapper.updateByPrimaryKey(couponAgentCode);
HighCouponAgentRel couponAgent = getRelByCouponAgent(couponAgentCode.getCouponId(), couponAgentCode.getAgentId(), couponAgentCode.getType());

Loading…
Cancel
Save