parent
4edcdf484c
commit
7ae7d81e3c
@ -0,0 +1,111 @@ |
||||
package com.bweb.controller; |
||||
|
||||
import com.hai.common.exception.ErrorCode; |
||||
import com.hai.common.exception.ErrorHelp; |
||||
import com.hai.common.exception.SysCode; |
||||
import com.hai.common.security.SessionObject; |
||||
import com.hai.common.security.UserCenter; |
||||
import com.hai.common.utils.MemberValidateUtil; |
||||
import com.hai.common.utils.ResponseMsgUtil; |
||||
import com.hai.entity.HighCoupon; |
||||
import com.hai.entity.HighCouponHandsel; |
||||
import com.hai.entity.HighMerchant; |
||||
import com.hai.entity.HighMerchantStore; |
||||
import com.hai.model.HighCouponModel; |
||||
import com.hai.model.ResponseData; |
||||
import com.hai.model.UserInfoModel; |
||||
import com.hai.service.HighCouponService; |
||||
import com.hai.service.HighMerchantService; |
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
import org.apache.commons.lang3.StringUtils; |
||||
import org.slf4j.Logger; |
||||
import org.slf4j.LoggerFactory; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.stereotype.Controller; |
||||
import org.springframework.web.bind.annotation.RequestBody; |
||||
import org.springframework.web.bind.annotation.RequestMapping; |
||||
import org.springframework.web.bind.annotation.RequestMethod; |
||||
import org.springframework.web.bind.annotation.ResponseBody; |
||||
|
||||
import javax.annotation.Resource; |
||||
import javax.servlet.http.HttpServletRequest; |
||||
import java.time.Year; |
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* @Auther: 胡锐 |
||||
* @Description: |
||||
* @Date: 2021/3/11 22:16 |
||||
*/ |
||||
@Controller |
||||
@RequestMapping(value = "/coupon") |
||||
@Api(value = "卡卷接口") |
||||
public class HighCouponController { |
||||
|
||||
private static Logger log = LoggerFactory.getLogger(HighCouponController.class); |
||||
|
||||
@Autowired |
||||
private UserCenter userCenter; |
||||
|
||||
@Resource |
||||
private HighMerchantService highMerchantService; |
||||
|
||||
@Resource |
||||
private HighCouponService highCouponService; |
||||
|
||||
@RequestMapping(value="/insertCoupon",method = RequestMethod.POST) |
||||
@ResponseBody |
||||
@ApiOperation(value = "增加卡卷") |
||||
public ResponseData insertCoupon(@RequestBody HighCouponModel highCoupon, HttpServletRequest request) { |
||||
try { |
||||
SessionObject sessionObject = userCenter.getSessionObject(request); |
||||
UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject(); |
||||
if (highCoupon.getMerchantId() == null |
||||
|| StringUtils.isNotBlank(highCoupon.getCouponKey()) |
||||
|| StringUtils.isNotBlank(highCoupon.getCouponName()) |
||||
|| StringUtils.isNotBlank(highCoupon.getCouponValue()) |
||||
|| StringUtils.isNotBlank(highCoupon.getCouponImg()) |
||||
|| highCoupon.getIsPresent() == null |
||||
|| highCoupon.getCouponPrice() == null) { |
||||
log.error("HighCouponController -> insertCoupon() error!","参数错误"); |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); |
||||
} |
||||
|
||||
// 是否赠送卡卷
|
||||
if (highCoupon.getIsPresent() == true) { |
||||
if (highCoupon.getHandselCouponList() == null || highCoupon.getHandselCouponList().size() == 0) { |
||||
log.error("HighCouponController -> insertCoupon() error!","请选择赠送卡卷名单"); |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.SELECT_HANDSEL_COUPON_ERROR, ""); |
||||
} |
||||
for (HighCouponHandsel handsel : highCoupon.getHandselCouponList()) { |
||||
handsel.setCreateTime(new Date()); |
||||
handsel.setStatus(1); // 状态 0:删除 1:正常
|
||||
handsel.setOperatorId(userInfoModel.getSecUser().getId()); |
||||
handsel.setOperatorName(userInfoModel.getSecUser().getUserName()); |
||||
} |
||||
} |
||||
|
||||
// 查询商户
|
||||
HighMerchant merchant = highMerchantService.getMerchantById(highCoupon.getCompanyId()); |
||||
if (merchant == null) { |
||||
log.error("HighCouponController -> insertCoupon() error!","未找到商户"); |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.MERCHANT_NOF_FOUND, ""); |
||||
} |
||||
|
||||
highCoupon.setCompanyId(merchant.getCompanyId()); |
||||
highCoupon.setOperatorId(userInfoModel.getSecUser().getId()); |
||||
highCoupon.setOperatorName(userInfoModel.getSecUser().getUserName()); |
||||
highCoupon.setCreateTime(new Date()); |
||||
highCoupon.setUpdateTime(new Date()); |
||||
highCoupon.setStatus(1); // 状态:0.删除 1.编辑中 2.已上架 3.已下架 101.上架审批中
|
||||
highCouponService.insertCoupon(highCoupon); |
||||
|
||||
return ResponseMsgUtil.success(highCoupon); |
||||
} catch (Exception e) { |
||||
log.error("HighCouponController -> insertCoupon() error!",e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,81 @@ |
||||
package com.hai.dao; |
||||
|
||||
import com.hai.entity.HighCouponCode; |
||||
import com.hai.entity.HighCouponCodeExample; |
||||
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 HighCouponCodeMapper extends HighCouponCodeMapperExt { |
||||
@SelectProvider(type=HighCouponCodeSqlProvider.class, method="countByExample") |
||||
long countByExample(HighCouponCodeExample example); |
||||
|
||||
@DeleteProvider(type=HighCouponCodeSqlProvider.class, method="deleteByExample") |
||||
int deleteByExample(HighCouponCodeExample example); |
||||
|
||||
@Insert({ |
||||
"insert into high_coupon_code (coupon_id, merchant_id, ", |
||||
"order_id, sales_code, ", |
||||
"sales_end_time, use_end_time, ", |
||||
"create_time, receive_time, ", |
||||
"consume_time, `status`, ", |
||||
"operator_id, operator_name, ", |
||||
"ext_1, ext_2, ext_3)", |
||||
"values (#{couponId,jdbcType=BIGINT}, #{merchantId,jdbcType=BIGINT}, ", |
||||
"#{orderId,jdbcType=BIGINT}, #{salesCode,jdbcType=VARCHAR}, ", |
||||
"#{salesEndTime,jdbcType=TIMESTAMP}, #{useEndTime,jdbcType=TIMESTAMP}, ", |
||||
"#{createTime,jdbcType=TIMESTAMP}, #{receiveTime,jdbcType=TIMESTAMP}, ", |
||||
"#{consumeTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}, ", |
||||
"#{operatorId,jdbcType=BIGINT}, #{operatorName,jdbcType=VARCHAR}, ", |
||||
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" |
||||
}) |
||||
@Options(useGeneratedKeys=true,keyProperty="id") |
||||
int insert(HighCouponCode record); |
||||
|
||||
@InsertProvider(type=HighCouponCodeSqlProvider.class, method="insertSelective") |
||||
@Options(useGeneratedKeys=true,keyProperty="id") |
||||
int insertSelective(HighCouponCode record); |
||||
|
||||
@SelectProvider(type=HighCouponCodeSqlProvider.class, method="selectByExample") |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="coupon_id", property="couponId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="merchant_id", property="merchantId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="order_id", property="orderId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="sales_code", property="salesCode", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="sales_end_time", property="salesEndTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="use_end_time", property="useEndTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="receive_time", property="receiveTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="consume_time", property="consumeTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER), |
||||
@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), |
||||
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) |
||||
}) |
||||
List<HighCouponCode> selectByExample(HighCouponCodeExample example); |
||||
|
||||
@UpdateProvider(type=HighCouponCodeSqlProvider.class, method="updateByExampleSelective") |
||||
int updateByExampleSelective(@Param("record") HighCouponCode record, @Param("example") HighCouponCodeExample example); |
||||
|
||||
@UpdateProvider(type=HighCouponCodeSqlProvider.class, method="updateByExample") |
||||
int updateByExample(@Param("record") HighCouponCode record, @Param("example") HighCouponCodeExample example); |
||||
} |
@ -0,0 +1,7 @@ |
||||
package com.hai.dao; |
||||
|
||||
/** |
||||
* mapper扩展类 |
||||
*/ |
||||
public interface HighCouponCodeMapperExt { |
||||
} |
@ -0,0 +1,319 @@ |
||||
package com.hai.dao; |
||||
|
||||
import com.hai.entity.HighCouponCode; |
||||
import com.hai.entity.HighCouponCodeExample.Criteria; |
||||
import com.hai.entity.HighCouponCodeExample.Criterion; |
||||
import com.hai.entity.HighCouponCodeExample; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import org.apache.ibatis.jdbc.SQL; |
||||
|
||||
public class HighCouponCodeSqlProvider { |
||||
|
||||
public String countByExample(HighCouponCodeExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.SELECT("count(*)").FROM("high_coupon_code"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String deleteByExample(HighCouponCodeExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.DELETE_FROM("high_coupon_code"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String insertSelective(HighCouponCode record) { |
||||
SQL sql = new SQL(); |
||||
sql.INSERT_INTO("high_coupon_code"); |
||||
|
||||
if (record.getCouponId() != null) { |
||||
sql.VALUES("coupon_id", "#{couponId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getMerchantId() != null) { |
||||
sql.VALUES("merchant_id", "#{merchantId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getOrderId() != null) { |
||||
sql.VALUES("order_id", "#{orderId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getSalesCode() != null) { |
||||
sql.VALUES("sales_code", "#{salesCode,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getSalesEndTime() != null) { |
||||
sql.VALUES("sales_end_time", "#{salesEndTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getUseEndTime() != null) { |
||||
sql.VALUES("use_end_time", "#{useEndTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getReceiveTime() != null) { |
||||
sql.VALUES("receive_time", "#{receiveTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getConsumeTime() != null) { |
||||
sql.VALUES("consume_time", "#{consumeTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getOperatorId() != null) { |
||||
sql.VALUES("operator_id", "#{operatorId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getOperatorName() != null) { |
||||
sql.VALUES("operator_name", "#{operatorName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.VALUES("ext_1", "#{ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.VALUES("ext_2", "#{ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.VALUES("ext_3", "#{ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String selectByExample(HighCouponCodeExample example) { |
||||
SQL sql = new SQL(); |
||||
if (example != null && example.isDistinct()) { |
||||
sql.SELECT_DISTINCT("id"); |
||||
} else { |
||||
sql.SELECT("id"); |
||||
} |
||||
sql.SELECT("coupon_id"); |
||||
sql.SELECT("merchant_id"); |
||||
sql.SELECT("order_id"); |
||||
sql.SELECT("sales_code"); |
||||
sql.SELECT("sales_end_time"); |
||||
sql.SELECT("use_end_time"); |
||||
sql.SELECT("create_time"); |
||||
sql.SELECT("receive_time"); |
||||
sql.SELECT("consume_time"); |
||||
sql.SELECT("`status`"); |
||||
sql.SELECT("operator_id"); |
||||
sql.SELECT("operator_name"); |
||||
sql.SELECT("ext_1"); |
||||
sql.SELECT("ext_2"); |
||||
sql.SELECT("ext_3"); |
||||
sql.FROM("high_coupon_code"); |
||||
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) { |
||||
HighCouponCode record = (HighCouponCode) parameter.get("record"); |
||||
HighCouponCodeExample example = (HighCouponCodeExample) parameter.get("example"); |
||||
|
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("high_coupon_code"); |
||||
|
||||
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.getMerchantId() != null) { |
||||
sql.SET("merchant_id = #{record.merchantId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getOrderId() != null) { |
||||
sql.SET("order_id = #{record.orderId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getSalesCode() != null) { |
||||
sql.SET("sales_code = #{record.salesCode,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getSalesEndTime() != null) { |
||||
sql.SET("sales_end_time = #{record.salesEndTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getUseEndTime() != null) { |
||||
sql.SET("use_end_time = #{record.useEndTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getReceiveTime() != null) { |
||||
sql.SET("receive_time = #{record.receiveTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getConsumeTime() != null) { |
||||
sql.SET("consume_time = #{record.consumeTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getOperatorId() != null) { |
||||
sql.SET("operator_id = #{record.operatorId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getOperatorName() != null) { |
||||
sql.SET("operator_name = #{record.operatorName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
applyWhere(sql, example, true); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByExample(Map<String, Object> parameter) { |
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("high_coupon_code"); |
||||
|
||||
sql.SET("id = #{record.id,jdbcType=BIGINT}"); |
||||
sql.SET("coupon_id = #{record.couponId,jdbcType=BIGINT}"); |
||||
sql.SET("merchant_id = #{record.merchantId,jdbcType=BIGINT}"); |
||||
sql.SET("order_id = #{record.orderId,jdbcType=BIGINT}"); |
||||
sql.SET("sales_code = #{record.salesCode,jdbcType=VARCHAR}"); |
||||
sql.SET("sales_end_time = #{record.salesEndTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("use_end_time = #{record.useEndTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("receive_time = #{record.receiveTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("consume_time = #{record.consumeTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); |
||||
sql.SET("operator_id = #{record.operatorId,jdbcType=BIGINT}"); |
||||
sql.SET("operator_name = #{record.operatorName,jdbcType=VARCHAR}"); |
||||
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); |
||||
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); |
||||
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); |
||||
|
||||
HighCouponCodeExample example = (HighCouponCodeExample) parameter.get("example"); |
||||
applyWhere(sql, example, true); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
protected void applyWhere(SQL sql, HighCouponCodeExample 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,117 @@ |
||||
package com.hai.dao; |
||||
|
||||
import com.hai.entity.HighCouponHandsel; |
||||
import com.hai.entity.HighCouponHandselExample; |
||||
import java.util.List; |
||||
import org.apache.ibatis.annotations.Delete; |
||||
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.Select; |
||||
import org.apache.ibatis.annotations.SelectProvider; |
||||
import org.apache.ibatis.annotations.Update; |
||||
import org.apache.ibatis.annotations.UpdateProvider; |
||||
import org.apache.ibatis.type.JdbcType; |
||||
import org.springframework.stereotype.Repository; |
||||
|
||||
/** |
||||
* |
||||
* 代码由工具生成,请勿修改!!! |
||||
* 如果需要扩展请在其父类进行扩展 |
||||
* |
||||
**/ |
||||
@Repository |
||||
public interface HighCouponHandselMapper extends HighCouponHandselMapperExt { |
||||
@SelectProvider(type=HighCouponHandselSqlProvider.class, method="countByExample") |
||||
long countByExample(HighCouponHandselExample example); |
||||
|
||||
@DeleteProvider(type=HighCouponHandselSqlProvider.class, method="deleteByExample") |
||||
int deleteByExample(HighCouponHandselExample example); |
||||
|
||||
@Delete({ |
||||
"delete from high_coupon_handsel", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
int deleteByPrimaryKey(Long id); |
||||
|
||||
@Insert({ |
||||
"insert into high_coupon_handsel (coupon_id, handsel_coupon_id, ", |
||||
"create_time, `status`, ", |
||||
"operator_id, operator_name, ", |
||||
"ext_1, ext_2, ext_3)", |
||||
"values (#{couponId,jdbcType=BIGINT}, #{handselCouponId,jdbcType=BIGINT}, ", |
||||
"#{createTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}, ", |
||||
"#{operatorId,jdbcType=BIGINT}, #{operatorName,jdbcType=VARCHAR}, ", |
||||
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" |
||||
}) |
||||
@Options(useGeneratedKeys=true,keyProperty="id") |
||||
int insert(HighCouponHandsel record); |
||||
|
||||
@InsertProvider(type=HighCouponHandselSqlProvider.class, method="insertSelective") |
||||
@Options(useGeneratedKeys=true,keyProperty="id") |
||||
int insertSelective(HighCouponHandsel record); |
||||
|
||||
@SelectProvider(type=HighCouponHandselSqlProvider.class, method="selectByExample") |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), |
||||
@Result(column="coupon_id", property="couponId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="handsel_coupon_id", property="handselCouponId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER), |
||||
@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), |
||||
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) |
||||
}) |
||||
List<HighCouponHandsel> selectByExample(HighCouponHandselExample example); |
||||
|
||||
@Select({ |
||||
"select", |
||||
"id, coupon_id, handsel_coupon_id, create_time, `status`, operator_id, operator_name, ", |
||||
"ext_1, ext_2, ext_3", |
||||
"from high_coupon_handsel", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), |
||||
@Result(column="coupon_id", property="couponId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="handsel_coupon_id", property="handselCouponId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER), |
||||
@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), |
||||
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) |
||||
}) |
||||
HighCouponHandsel selectByPrimaryKey(Long id); |
||||
|
||||
@UpdateProvider(type=HighCouponHandselSqlProvider.class, method="updateByExampleSelective") |
||||
int updateByExampleSelective(@Param("record") HighCouponHandsel record, @Param("example") HighCouponHandselExample example); |
||||
|
||||
@UpdateProvider(type=HighCouponHandselSqlProvider.class, method="updateByExample") |
||||
int updateByExample(@Param("record") HighCouponHandsel record, @Param("example") HighCouponHandselExample example); |
||||
|
||||
@UpdateProvider(type=HighCouponHandselSqlProvider.class, method="updateByPrimaryKeySelective") |
||||
int updateByPrimaryKeySelective(HighCouponHandsel record); |
||||
|
||||
@Update({ |
||||
"update high_coupon_handsel", |
||||
"set coupon_id = #{couponId,jdbcType=BIGINT},", |
||||
"handsel_coupon_id = #{handselCouponId,jdbcType=BIGINT},", |
||||
"create_time = #{createTime,jdbcType=TIMESTAMP},", |
||||
"`status` = #{status,jdbcType=INTEGER},", |
||||
"operator_id = #{operatorId,jdbcType=BIGINT},", |
||||
"operator_name = #{operatorName,jdbcType=VARCHAR},", |
||||
"ext_1 = #{ext1,jdbcType=VARCHAR},", |
||||
"ext_2 = #{ext2,jdbcType=VARCHAR},", |
||||
"ext_3 = #{ext3,jdbcType=VARCHAR}", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
int updateByPrimaryKey(HighCouponHandsel record); |
||||
} |
@ -0,0 +1,7 @@ |
||||
package com.hai.dao; |
||||
|
||||
/** |
||||
* mapper扩展类 |
||||
*/ |
||||
public interface HighCouponHandselMapperExt { |
||||
} |
@ -0,0 +1,304 @@ |
||||
package com.hai.dao; |
||||
|
||||
import com.hai.entity.HighCouponHandsel; |
||||
import com.hai.entity.HighCouponHandselExample.Criteria; |
||||
import com.hai.entity.HighCouponHandselExample.Criterion; |
||||
import com.hai.entity.HighCouponHandselExample; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import org.apache.ibatis.jdbc.SQL; |
||||
|
||||
public class HighCouponHandselSqlProvider { |
||||
|
||||
public String countByExample(HighCouponHandselExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.SELECT("count(*)").FROM("high_coupon_handsel"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String deleteByExample(HighCouponHandselExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.DELETE_FROM("high_coupon_handsel"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String insertSelective(HighCouponHandsel record) { |
||||
SQL sql = new SQL(); |
||||
sql.INSERT_INTO("high_coupon_handsel"); |
||||
|
||||
if (record.getCouponId() != null) { |
||||
sql.VALUES("coupon_id", "#{couponId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getHandselCouponId() != null) { |
||||
sql.VALUES("handsel_coupon_id", "#{handselCouponId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getOperatorId() != null) { |
||||
sql.VALUES("operator_id", "#{operatorId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getOperatorName() != null) { |
||||
sql.VALUES("operator_name", "#{operatorName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.VALUES("ext_1", "#{ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.VALUES("ext_2", "#{ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.VALUES("ext_3", "#{ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String selectByExample(HighCouponHandselExample example) { |
||||
SQL sql = new SQL(); |
||||
if (example != null && example.isDistinct()) { |
||||
sql.SELECT_DISTINCT("id"); |
||||
} else { |
||||
sql.SELECT("id"); |
||||
} |
||||
sql.SELECT("coupon_id"); |
||||
sql.SELECT("handsel_coupon_id"); |
||||
sql.SELECT("create_time"); |
||||
sql.SELECT("`status`"); |
||||
sql.SELECT("operator_id"); |
||||
sql.SELECT("operator_name"); |
||||
sql.SELECT("ext_1"); |
||||
sql.SELECT("ext_2"); |
||||
sql.SELECT("ext_3"); |
||||
sql.FROM("high_coupon_handsel"); |
||||
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) { |
||||
HighCouponHandsel record = (HighCouponHandsel) parameter.get("record"); |
||||
HighCouponHandselExample example = (HighCouponHandselExample) parameter.get("example"); |
||||
|
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("high_coupon_handsel"); |
||||
|
||||
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.getHandselCouponId() != null) { |
||||
sql.SET("handsel_coupon_id = #{record.handselCouponId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
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.getOperatorId() != null) { |
||||
sql.SET("operator_id = #{record.operatorId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getOperatorName() != null) { |
||||
sql.SET("operator_name = #{record.operatorName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
applyWhere(sql, example, true); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByExample(Map<String, Object> parameter) { |
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("high_coupon_handsel"); |
||||
|
||||
sql.SET("id = #{record.id,jdbcType=BIGINT}"); |
||||
sql.SET("coupon_id = #{record.couponId,jdbcType=BIGINT}"); |
||||
sql.SET("handsel_coupon_id = #{record.handselCouponId,jdbcType=BIGINT}"); |
||||
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); |
||||
sql.SET("operator_id = #{record.operatorId,jdbcType=BIGINT}"); |
||||
sql.SET("operator_name = #{record.operatorName,jdbcType=VARCHAR}"); |
||||
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); |
||||
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); |
||||
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); |
||||
|
||||
HighCouponHandselExample example = (HighCouponHandselExample) parameter.get("example"); |
||||
applyWhere(sql, example, true); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByPrimaryKeySelective(HighCouponHandsel record) { |
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("high_coupon_handsel"); |
||||
|
||||
if (record.getCouponId() != null) { |
||||
sql.SET("coupon_id = #{couponId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getHandselCouponId() != null) { |
||||
sql.SET("handsel_coupon_id = #{handselCouponId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.SET("`status` = #{status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getOperatorId() != null) { |
||||
sql.SET("operator_id = #{operatorId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getOperatorName() != null) { |
||||
sql.SET("operator_name = #{operatorName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.SET("ext_1 = #{ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.SET("ext_2 = #{ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.SET("ext_3 = #{ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
sql.WHERE("id = #{id,jdbcType=BIGINT}"); |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
protected void applyWhere(SQL sql, HighCouponHandselExample 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,147 @@ |
||||
package com.hai.dao; |
||||
|
||||
import com.hai.entity.HighCoupon; |
||||
import com.hai.entity.HighCouponExample; |
||||
import java.util.List; |
||||
import org.apache.ibatis.annotations.Delete; |
||||
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.Select; |
||||
import org.apache.ibatis.annotations.SelectProvider; |
||||
import org.apache.ibatis.annotations.Update; |
||||
import org.apache.ibatis.annotations.UpdateProvider; |
||||
import org.apache.ibatis.type.JdbcType; |
||||
import org.springframework.stereotype.Repository; |
||||
|
||||
/** |
||||
* |
||||
* 代码由工具生成,请勿修改!!! |
||||
* 如果需要扩展请在其父类进行扩展 |
||||
* |
||||
**/ |
||||
@Repository |
||||
public interface HighCouponMapper extends HighCouponMapperExt { |
||||
@SelectProvider(type=HighCouponSqlProvider.class, method="countByExample") |
||||
long countByExample(HighCouponExample example); |
||||
|
||||
@DeleteProvider(type=HighCouponSqlProvider.class, method="deleteByExample") |
||||
int deleteByExample(HighCouponExample example); |
||||
|
||||
@Delete({ |
||||
"delete from high_coupon", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
int deleteByPrimaryKey(Long id); |
||||
|
||||
@Insert({ |
||||
"insert into high_coupon (company_id, merchant_id, ", |
||||
"coupon_key, coupon_name, ", |
||||
"coupon_value, coupon_img, ", |
||||
"coupon_price, is_present, ", |
||||
"create_time, update_time, ", |
||||
"operator_id, operator_name, ", |
||||
"`status`, ext_1, ext_2, ", |
||||
"ext_3)", |
||||
"values (#{companyId,jdbcType=BIGINT}, #{merchantId,jdbcType=BIGINT}, ", |
||||
"#{couponKey,jdbcType=VARCHAR}, #{couponName,jdbcType=VARCHAR}, ", |
||||
"#{couponValue,jdbcType=VARCHAR}, #{couponImg,jdbcType=VARCHAR}, ", |
||||
"#{couponPrice,jdbcType=DECIMAL}, #{isPresent,jdbcType=BIT}, ", |
||||
"#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ", |
||||
"#{operatorId,jdbcType=BIGINT}, #{operatorName,jdbcType=VARCHAR}, ", |
||||
"#{status,jdbcType=INTEGER}, #{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, ", |
||||
"#{ext3,jdbcType=VARCHAR})" |
||||
}) |
||||
@Options(useGeneratedKeys=true,keyProperty="id") |
||||
int insert(HighCoupon record); |
||||
|
||||
@InsertProvider(type=HighCouponSqlProvider.class, method="insertSelective") |
||||
@Options(useGeneratedKeys=true,keyProperty="id") |
||||
int insertSelective(HighCoupon record); |
||||
|
||||
@SelectProvider(type=HighCouponSqlProvider.class, method="selectByExample") |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), |
||||
@Result(column="company_id", property="companyId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="merchant_id", property="merchantId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="coupon_key", property="couponKey", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="coupon_name", property="couponName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="coupon_value", property="couponValue", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="coupon_img", property="couponImg", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="coupon_price", property="couponPrice", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="is_present", property="isPresent", jdbcType=JdbcType.BIT), |
||||
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="operator_id", property="operatorId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="operator_name", property="operatorName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) |
||||
}) |
||||
List<HighCoupon> selectByExample(HighCouponExample example); |
||||
|
||||
@Select({ |
||||
"select", |
||||
"id, company_id, merchant_id, coupon_key, coupon_name, coupon_value, coupon_img, ", |
||||
"coupon_price, is_present, create_time, update_time, operator_id, operator_name, ", |
||||
"`status`, ext_1, ext_2, ext_3", |
||||
"from high_coupon", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), |
||||
@Result(column="company_id", property="companyId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="merchant_id", property="merchantId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="coupon_key", property="couponKey", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="coupon_name", property="couponName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="coupon_value", property="couponValue", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="coupon_img", property="couponImg", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="coupon_price", property="couponPrice", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="is_present", property="isPresent", jdbcType=JdbcType.BIT), |
||||
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="operator_id", property="operatorId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="operator_name", property="operatorName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) |
||||
}) |
||||
HighCoupon selectByPrimaryKey(Long id); |
||||
|
||||
@UpdateProvider(type=HighCouponSqlProvider.class, method="updateByExampleSelective") |
||||
int updateByExampleSelective(@Param("record") HighCoupon record, @Param("example") HighCouponExample example); |
||||
|
||||
@UpdateProvider(type=HighCouponSqlProvider.class, method="updateByExample") |
||||
int updateByExample(@Param("record") HighCoupon record, @Param("example") HighCouponExample example); |
||||
|
||||
@UpdateProvider(type=HighCouponSqlProvider.class, method="updateByPrimaryKeySelective") |
||||
int updateByPrimaryKeySelective(HighCoupon record); |
||||
|
||||
@Update({ |
||||
"update high_coupon", |
||||
"set company_id = #{companyId,jdbcType=BIGINT},", |
||||
"merchant_id = #{merchantId,jdbcType=BIGINT},", |
||||
"coupon_key = #{couponKey,jdbcType=VARCHAR},", |
||||
"coupon_name = #{couponName,jdbcType=VARCHAR},", |
||||
"coupon_value = #{couponValue,jdbcType=VARCHAR},", |
||||
"coupon_img = #{couponImg,jdbcType=VARCHAR},", |
||||
"coupon_price = #{couponPrice,jdbcType=DECIMAL},", |
||||
"is_present = #{isPresent,jdbcType=BIT},", |
||||
"create_time = #{createTime,jdbcType=TIMESTAMP},", |
||||
"update_time = #{updateTime,jdbcType=TIMESTAMP},", |
||||
"operator_id = #{operatorId,jdbcType=BIGINT},", |
||||
"operator_name = #{operatorName,jdbcType=VARCHAR},", |
||||
"`status` = #{status,jdbcType=INTEGER},", |
||||
"ext_1 = #{ext1,jdbcType=VARCHAR},", |
||||
"ext_2 = #{ext2,jdbcType=VARCHAR},", |
||||
"ext_3 = #{ext3,jdbcType=VARCHAR}", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
int updateByPrimaryKey(HighCoupon record); |
||||
} |
@ -0,0 +1,7 @@ |
||||
package com.hai.dao; |
||||
|
||||
/** |
||||
* mapper扩展类 |
||||
*/ |
||||
public interface HighCouponMapperExt { |
||||
} |
@ -0,0 +1,402 @@ |
||||
package com.hai.dao; |
||||
|
||||
import com.hai.entity.HighCoupon; |
||||
import com.hai.entity.HighCouponExample.Criteria; |
||||
import com.hai.entity.HighCouponExample.Criterion; |
||||
import com.hai.entity.HighCouponExample; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import org.apache.ibatis.jdbc.SQL; |
||||
|
||||
public class HighCouponSqlProvider { |
||||
|
||||
public String countByExample(HighCouponExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.SELECT("count(*)").FROM("high_coupon"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String deleteByExample(HighCouponExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.DELETE_FROM("high_coupon"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String insertSelective(HighCoupon record) { |
||||
SQL sql = new SQL(); |
||||
sql.INSERT_INTO("high_coupon"); |
||||
|
||||
if (record.getCompanyId() != null) { |
||||
sql.VALUES("company_id", "#{companyId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getMerchantId() != null) { |
||||
sql.VALUES("merchant_id", "#{merchantId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getCouponKey() != null) { |
||||
sql.VALUES("coupon_key", "#{couponKey,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getCouponName() != null) { |
||||
sql.VALUES("coupon_name", "#{couponName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getCouponValue() != null) { |
||||
sql.VALUES("coupon_value", "#{couponValue,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getCouponImg() != null) { |
||||
sql.VALUES("coupon_img", "#{couponImg,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getCouponPrice() != null) { |
||||
sql.VALUES("coupon_price", "#{couponPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getIsPresent() != null) { |
||||
sql.VALUES("is_present", "#{isPresent,jdbcType=BIT}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getUpdateTime() != null) { |
||||
sql.VALUES("update_time", "#{updateTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getOperatorId() != null) { |
||||
sql.VALUES("operator_id", "#{operatorId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getOperatorName() != null) { |
||||
sql.VALUES("operator_name", "#{operatorName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.VALUES("ext_1", "#{ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.VALUES("ext_2", "#{ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.VALUES("ext_3", "#{ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String selectByExample(HighCouponExample example) { |
||||
SQL sql = new SQL(); |
||||
if (example != null && example.isDistinct()) { |
||||
sql.SELECT_DISTINCT("id"); |
||||
} else { |
||||
sql.SELECT("id"); |
||||
} |
||||
sql.SELECT("company_id"); |
||||
sql.SELECT("merchant_id"); |
||||
sql.SELECT("coupon_key"); |
||||
sql.SELECT("coupon_name"); |
||||
sql.SELECT("coupon_value"); |
||||
sql.SELECT("coupon_img"); |
||||
sql.SELECT("coupon_price"); |
||||
sql.SELECT("is_present"); |
||||
sql.SELECT("create_time"); |
||||
sql.SELECT("update_time"); |
||||
sql.SELECT("operator_id"); |
||||
sql.SELECT("operator_name"); |
||||
sql.SELECT("`status`"); |
||||
sql.SELECT("ext_1"); |
||||
sql.SELECT("ext_2"); |
||||
sql.SELECT("ext_3"); |
||||
sql.FROM("high_coupon"); |
||||
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) { |
||||
HighCoupon record = (HighCoupon) parameter.get("record"); |
||||
HighCouponExample example = (HighCouponExample) parameter.get("example"); |
||||
|
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("high_coupon"); |
||||
|
||||
if (record.getId() != null) { |
||||
sql.SET("id = #{record.id,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getCompanyId() != null) { |
||||
sql.SET("company_id = #{record.companyId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getMerchantId() != null) { |
||||
sql.SET("merchant_id = #{record.merchantId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getCouponKey() != null) { |
||||
sql.SET("coupon_key = #{record.couponKey,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getCouponName() != null) { |
||||
sql.SET("coupon_name = #{record.couponName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getCouponValue() != null) { |
||||
sql.SET("coupon_value = #{record.couponValue,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getCouponImg() != null) { |
||||
sql.SET("coupon_img = #{record.couponImg,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getCouponPrice() != null) { |
||||
sql.SET("coupon_price = #{record.couponPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getIsPresent() != null) { |
||||
sql.SET("is_present = #{record.isPresent,jdbcType=BIT}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getUpdateTime() != null) { |
||||
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getOperatorId() != null) { |
||||
sql.SET("operator_id = #{record.operatorId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getOperatorName() != null) { |
||||
sql.SET("operator_name = #{record.operatorName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
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.getExt2() != null) { |
||||
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
applyWhere(sql, example, true); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByExample(Map<String, Object> parameter) { |
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("high_coupon"); |
||||
|
||||
sql.SET("id = #{record.id,jdbcType=BIGINT}"); |
||||
sql.SET("company_id = #{record.companyId,jdbcType=BIGINT}"); |
||||
sql.SET("merchant_id = #{record.merchantId,jdbcType=BIGINT}"); |
||||
sql.SET("coupon_key = #{record.couponKey,jdbcType=VARCHAR}"); |
||||
sql.SET("coupon_name = #{record.couponName,jdbcType=VARCHAR}"); |
||||
sql.SET("coupon_value = #{record.couponValue,jdbcType=VARCHAR}"); |
||||
sql.SET("coupon_img = #{record.couponImg,jdbcType=VARCHAR}"); |
||||
sql.SET("coupon_price = #{record.couponPrice,jdbcType=DECIMAL}"); |
||||
sql.SET("is_present = #{record.isPresent,jdbcType=BIT}"); |
||||
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("operator_id = #{record.operatorId,jdbcType=BIGINT}"); |
||||
sql.SET("operator_name = #{record.operatorName,jdbcType=VARCHAR}"); |
||||
sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); |
||||
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); |
||||
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); |
||||
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); |
||||
|
||||
HighCouponExample example = (HighCouponExample) parameter.get("example"); |
||||
applyWhere(sql, example, true); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByPrimaryKeySelective(HighCoupon record) { |
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("high_coupon"); |
||||
|
||||
if (record.getCompanyId() != null) { |
||||
sql.SET("company_id = #{companyId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getMerchantId() != null) { |
||||
sql.SET("merchant_id = #{merchantId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getCouponKey() != null) { |
||||
sql.SET("coupon_key = #{couponKey,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getCouponName() != null) { |
||||
sql.SET("coupon_name = #{couponName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getCouponValue() != null) { |
||||
sql.SET("coupon_value = #{couponValue,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getCouponImg() != null) { |
||||
sql.SET("coupon_img = #{couponImg,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getCouponPrice() != null) { |
||||
sql.SET("coupon_price = #{couponPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getIsPresent() != null) { |
||||
sql.SET("is_present = #{isPresent,jdbcType=BIT}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getUpdateTime() != null) { |
||||
sql.SET("update_time = #{updateTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getOperatorId() != null) { |
||||
sql.SET("operator_id = #{operatorId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getOperatorName() != null) { |
||||
sql.SET("operator_name = #{operatorName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.SET("`status` = #{status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.SET("ext_1 = #{ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.SET("ext_2 = #{ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.SET("ext_3 = #{ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
sql.WHERE("id = #{id,jdbcType=BIGINT}"); |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
protected void applyWhere(SQL sql, HighCouponExample 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,130 @@ |
||||
package com.hai.dao; |
||||
|
||||
import com.hai.entity.HighGoodsPriceRefer; |
||||
import com.hai.entity.HighGoodsPriceReferExample; |
||||
import java.util.List; |
||||
import org.apache.ibatis.annotations.Delete; |
||||
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.Select; |
||||
import org.apache.ibatis.annotations.SelectProvider; |
||||
import org.apache.ibatis.annotations.Update; |
||||
import org.apache.ibatis.annotations.UpdateProvider; |
||||
import org.apache.ibatis.type.JdbcType; |
||||
import org.springframework.stereotype.Repository; |
||||
|
||||
/** |
||||
* |
||||
* 代码由工具生成,请勿修改!!! |
||||
* 如果需要扩展请在其父类进行扩展 |
||||
* |
||||
**/ |
||||
@Repository |
||||
public interface HighGoodsPriceReferMapper extends HighGoodsPriceReferMapperExt { |
||||
@SelectProvider(type=HighGoodsPriceReferSqlProvider.class, method="countByExample") |
||||
long countByExample(HighGoodsPriceReferExample example); |
||||
|
||||
@DeleteProvider(type=HighGoodsPriceReferSqlProvider.class, method="deleteByExample") |
||||
int deleteByExample(HighGoodsPriceReferExample example); |
||||
|
||||
@Delete({ |
||||
"delete from high_goods_price_refer", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
int deleteByPrimaryKey(Long id); |
||||
|
||||
@Insert({ |
||||
"insert into high_goods_price_refer (goods_type, goods_id, ", |
||||
"new_sale_price, effective_time, ", |
||||
"create_time, update_time, ", |
||||
"operator_id, operator_name, ", |
||||
"`status`, ext_1, ext_2, ", |
||||
"ext_3)", |
||||
"values (#{goodsType,jdbcType=INTEGER}, #{goodsId,jdbcType=BIGINT}, ", |
||||
"#{newSalePrice,jdbcType=REAL}, #{effectiveTime,jdbcType=TIMESTAMP}, ", |
||||
"#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ", |
||||
"#{operatorId,jdbcType=BIGINT}, #{operatorName,jdbcType=VARCHAR}, ", |
||||
"#{status,jdbcType=INTEGER}, #{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, ", |
||||
"#{ext3,jdbcType=VARCHAR})" |
||||
}) |
||||
@Options(useGeneratedKeys=true,keyProperty="id") |
||||
int insert(HighGoodsPriceRefer record); |
||||
|
||||
@InsertProvider(type=HighGoodsPriceReferSqlProvider.class, method="insertSelective") |
||||
@Options(useGeneratedKeys=true,keyProperty="id") |
||||
int insertSelective(HighGoodsPriceRefer record); |
||||
|
||||
@SelectProvider(type=HighGoodsPriceReferSqlProvider.class, method="selectByExample") |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), |
||||
@Result(column="goods_type", property="goodsType", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="goods_id", property="goodsId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="new_sale_price", property="newSalePrice", jdbcType=JdbcType.REAL), |
||||
@Result(column="effective_time", property="effectiveTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="operator_id", property="operatorId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="operator_name", property="operatorName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) |
||||
}) |
||||
List<HighGoodsPriceRefer> selectByExample(HighGoodsPriceReferExample example); |
||||
|
||||
@Select({ |
||||
"select", |
||||
"id, goods_type, goods_id, new_sale_price, effective_time, create_time, update_time, ", |
||||
"operator_id, operator_name, `status`, ext_1, ext_2, ext_3", |
||||
"from high_goods_price_refer", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), |
||||
@Result(column="goods_type", property="goodsType", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="goods_id", property="goodsId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="new_sale_price", property="newSalePrice", jdbcType=JdbcType.REAL), |
||||
@Result(column="effective_time", property="effectiveTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="operator_id", property="operatorId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="operator_name", property="operatorName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) |
||||
}) |
||||
HighGoodsPriceRefer selectByPrimaryKey(Long id); |
||||
|
||||
@UpdateProvider(type=HighGoodsPriceReferSqlProvider.class, method="updateByExampleSelective") |
||||
int updateByExampleSelective(@Param("record") HighGoodsPriceRefer record, @Param("example") HighGoodsPriceReferExample example); |
||||
|
||||
@UpdateProvider(type=HighGoodsPriceReferSqlProvider.class, method="updateByExample") |
||||
int updateByExample(@Param("record") HighGoodsPriceRefer record, @Param("example") HighGoodsPriceReferExample example); |
||||
|
||||
@UpdateProvider(type=HighGoodsPriceReferSqlProvider.class, method="updateByPrimaryKeySelective") |
||||
int updateByPrimaryKeySelective(HighGoodsPriceRefer record); |
||||
|
||||
@Update({ |
||||
"update high_goods_price_refer", |
||||
"set goods_type = #{goodsType,jdbcType=INTEGER},", |
||||
"goods_id = #{goodsId,jdbcType=BIGINT},", |
||||
"new_sale_price = #{newSalePrice,jdbcType=REAL},", |
||||
"effective_time = #{effectiveTime,jdbcType=TIMESTAMP},", |
||||
"create_time = #{createTime,jdbcType=TIMESTAMP},", |
||||
"update_time = #{updateTime,jdbcType=TIMESTAMP},", |
||||
"operator_id = #{operatorId,jdbcType=BIGINT},", |
||||
"operator_name = #{operatorName,jdbcType=VARCHAR},", |
||||
"`status` = #{status,jdbcType=INTEGER},", |
||||
"ext_1 = #{ext1,jdbcType=VARCHAR},", |
||||
"ext_2 = #{ext2,jdbcType=VARCHAR},", |
||||
"ext_3 = #{ext3,jdbcType=VARCHAR}", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
int updateByPrimaryKey(HighGoodsPriceRefer record); |
||||
} |
@ -0,0 +1,7 @@ |
||||
package com.hai.dao; |
||||
|
||||
/** |
||||
* mapper扩展类 |
||||
*/ |
||||
public interface HighGoodsPriceReferMapperExt { |
||||
} |
@ -0,0 +1,346 @@ |
||||
package com.hai.dao; |
||||
|
||||
import com.hai.entity.HighGoodsPriceRefer; |
||||
import com.hai.entity.HighGoodsPriceReferExample.Criteria; |
||||
import com.hai.entity.HighGoodsPriceReferExample.Criterion; |
||||
import com.hai.entity.HighGoodsPriceReferExample; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import org.apache.ibatis.jdbc.SQL; |
||||
|
||||
public class HighGoodsPriceReferSqlProvider { |
||||
|
||||
public String countByExample(HighGoodsPriceReferExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.SELECT("count(*)").FROM("high_goods_price_refer"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String deleteByExample(HighGoodsPriceReferExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.DELETE_FROM("high_goods_price_refer"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String insertSelective(HighGoodsPriceRefer record) { |
||||
SQL sql = new SQL(); |
||||
sql.INSERT_INTO("high_goods_price_refer"); |
||||
|
||||
if (record.getGoodsType() != null) { |
||||
sql.VALUES("goods_type", "#{goodsType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getGoodsId() != null) { |
||||
sql.VALUES("goods_id", "#{goodsId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getNewSalePrice() != null) { |
||||
sql.VALUES("new_sale_price", "#{newSalePrice,jdbcType=REAL}"); |
||||
} |
||||
|
||||
if (record.getEffectiveTime() != null) { |
||||
sql.VALUES("effective_time", "#{effectiveTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getUpdateTime() != null) { |
||||
sql.VALUES("update_time", "#{updateTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getOperatorId() != null) { |
||||
sql.VALUES("operator_id", "#{operatorId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getOperatorName() != null) { |
||||
sql.VALUES("operator_name", "#{operatorName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.VALUES("ext_1", "#{ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.VALUES("ext_2", "#{ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.VALUES("ext_3", "#{ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String selectByExample(HighGoodsPriceReferExample example) { |
||||
SQL sql = new SQL(); |
||||
if (example != null && example.isDistinct()) { |
||||
sql.SELECT_DISTINCT("id"); |
||||
} else { |
||||
sql.SELECT("id"); |
||||
} |
||||
sql.SELECT("goods_type"); |
||||
sql.SELECT("goods_id"); |
||||
sql.SELECT("new_sale_price"); |
||||
sql.SELECT("effective_time"); |
||||
sql.SELECT("create_time"); |
||||
sql.SELECT("update_time"); |
||||
sql.SELECT("operator_id"); |
||||
sql.SELECT("operator_name"); |
||||
sql.SELECT("`status`"); |
||||
sql.SELECT("ext_1"); |
||||
sql.SELECT("ext_2"); |
||||
sql.SELECT("ext_3"); |
||||
sql.FROM("high_goods_price_refer"); |
||||
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) { |
||||
HighGoodsPriceRefer record = (HighGoodsPriceRefer) parameter.get("record"); |
||||
HighGoodsPriceReferExample example = (HighGoodsPriceReferExample) parameter.get("example"); |
||||
|
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("high_goods_price_refer"); |
||||
|
||||
if (record.getId() != null) { |
||||
sql.SET("id = #{record.id,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getGoodsType() != null) { |
||||
sql.SET("goods_type = #{record.goodsType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getGoodsId() != null) { |
||||
sql.SET("goods_id = #{record.goodsId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getNewSalePrice() != null) { |
||||
sql.SET("new_sale_price = #{record.newSalePrice,jdbcType=REAL}"); |
||||
} |
||||
|
||||
if (record.getEffectiveTime() != null) { |
||||
sql.SET("effective_time = #{record.effectiveTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getUpdateTime() != null) { |
||||
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getOperatorId() != null) { |
||||
sql.SET("operator_id = #{record.operatorId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getOperatorName() != null) { |
||||
sql.SET("operator_name = #{record.operatorName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
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.getExt2() != null) { |
||||
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
applyWhere(sql, example, true); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByExample(Map<String, Object> parameter) { |
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("high_goods_price_refer"); |
||||
|
||||
sql.SET("id = #{record.id,jdbcType=BIGINT}"); |
||||
sql.SET("goods_type = #{record.goodsType,jdbcType=INTEGER}"); |
||||
sql.SET("goods_id = #{record.goodsId,jdbcType=BIGINT}"); |
||||
sql.SET("new_sale_price = #{record.newSalePrice,jdbcType=REAL}"); |
||||
sql.SET("effective_time = #{record.effectiveTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("operator_id = #{record.operatorId,jdbcType=BIGINT}"); |
||||
sql.SET("operator_name = #{record.operatorName,jdbcType=VARCHAR}"); |
||||
sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); |
||||
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); |
||||
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); |
||||
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); |
||||
|
||||
HighGoodsPriceReferExample example = (HighGoodsPriceReferExample) parameter.get("example"); |
||||
applyWhere(sql, example, true); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByPrimaryKeySelective(HighGoodsPriceRefer record) { |
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("high_goods_price_refer"); |
||||
|
||||
if (record.getGoodsType() != null) { |
||||
sql.SET("goods_type = #{goodsType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getGoodsId() != null) { |
||||
sql.SET("goods_id = #{goodsId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getNewSalePrice() != null) { |
||||
sql.SET("new_sale_price = #{newSalePrice,jdbcType=REAL}"); |
||||
} |
||||
|
||||
if (record.getEffectiveTime() != null) { |
||||
sql.SET("effective_time = #{effectiveTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getUpdateTime() != null) { |
||||
sql.SET("update_time = #{updateTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getOperatorId() != null) { |
||||
sql.SET("operator_id = #{operatorId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getOperatorName() != null) { |
||||
sql.SET("operator_name = #{operatorName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.SET("`status` = #{status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.SET("ext_1 = #{ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.SET("ext_2 = #{ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.SET("ext_3 = #{ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
sql.WHERE("id = #{id,jdbcType=BIGINT}"); |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
protected void applyWhere(SQL sql, HighGoodsPriceReferExample 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,314 @@ |
||||
package com.hai.entity; |
||||
|
||||
import com.hai.model.HighCouponModel; |
||||
|
||||
import java.io.Serializable; |
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* high_coupon |
||||
* @author |
||||
*/ |
||||
/** |
||||
* |
||||
* 代码由工具生成 |
||||
* |
||||
**/ |
||||
public class HighCoupon implements Serializable { |
||||
/** |
||||
* 主键 |
||||
*/ |
||||
private Long id; |
||||
|
||||
/** |
||||
* 单位id |
||||
*/ |
||||
private Long companyId; |
||||
|
||||
/** |
||||
* 商户id |
||||
*/ |
||||
private Long merchantId; |
||||
|
||||
/** |
||||
* 卡券编号 |
||||
*/ |
||||
private String couponKey; |
||||
|
||||
/** |
||||
* 卡券名称 |
||||
*/ |
||||
private String couponName; |
||||
|
||||
/** |
||||
* 卡券面值 |
||||
*/ |
||||
private String couponValue; |
||||
|
||||
/** |
||||
* 卡券图片 |
||||
*/ |
||||
private String couponImg; |
||||
|
||||
/** |
||||
* 销售价格 |
||||
*/ |
||||
private Long couponPrice; |
||||
|
||||
/** |
||||
* 是否可赠送卡券 |
||||
*/ |
||||
private Boolean isPresent; |
||||
|
||||
/** |
||||
* 创建时间 |
||||
*/ |
||||
private Date createTime; |
||||
|
||||
/** |
||||
* 更新时间 |
||||
*/ |
||||
private Date updateTime; |
||||
|
||||
/** |
||||
* 操作人id |
||||
*/ |
||||
private Long operatorId; |
||||
|
||||
/** |
||||
* 操作人名称 |
||||
*/ |
||||
private String operatorName; |
||||
|
||||
/** |
||||
* 状态:0.删除 1.编辑中 2.已上架 3.已下架 101.上架审批中 102.上架审批驳回 |
||||
*/ |
||||
private Integer status; |
||||
|
||||
private String ext1; |
||||
|
||||
private String ext2; |
||||
|
||||
private String ext3; |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
public Long getId() { |
||||
return id; |
||||
} |
||||
|
||||
public void setId(Long id) { |
||||
this.id = id; |
||||
} |
||||
|
||||
public Long getCompanyId() { |
||||
return companyId; |
||||
} |
||||
|
||||
public void setCompanyId(Long companyId) { |
||||
this.companyId = companyId; |
||||
} |
||||
|
||||
public Long getMerchantId() { |
||||
return merchantId; |
||||
} |
||||
|
||||
public void setMerchantId(Long merchantId) { |
||||
this.merchantId = merchantId; |
||||
} |
||||
|
||||
public String getCouponKey() { |
||||
return couponKey; |
||||
} |
||||
|
||||
public void setCouponKey(String couponKey) { |
||||
this.couponKey = couponKey; |
||||
} |
||||
|
||||
public String getCouponName() { |
||||
return couponName; |
||||
} |
||||
|
||||
public void setCouponName(String couponName) { |
||||
this.couponName = couponName; |
||||
} |
||||
|
||||
public String getCouponValue() { |
||||
return couponValue; |
||||
} |
||||
|
||||
public void setCouponValue(String couponValue) { |
||||
this.couponValue = couponValue; |
||||
} |
||||
|
||||
public String getCouponImg() { |
||||
return couponImg; |
||||
} |
||||
|
||||
public void setCouponImg(String couponImg) { |
||||
this.couponImg = couponImg; |
||||
} |
||||
|
||||
public Long getCouponPrice() { |
||||
return couponPrice; |
||||
} |
||||
|
||||
public void setCouponPrice(Long couponPrice) { |
||||
this.couponPrice = couponPrice; |
||||
} |
||||
|
||||
public Boolean getIsPresent() { |
||||
return isPresent; |
||||
} |
||||
|
||||
public void setIsPresent(Boolean isPresent) { |
||||
this.isPresent = isPresent; |
||||
} |
||||
|
||||
public Date getCreateTime() { |
||||
return createTime; |
||||
} |
||||
|
||||
public void setCreateTime(Date createTime) { |
||||
this.createTime = createTime; |
||||
} |
||||
|
||||
public Date getUpdateTime() { |
||||
return updateTime; |
||||
} |
||||
|
||||
public void setUpdateTime(Date updateTime) { |
||||
this.updateTime = updateTime; |
||||
} |
||||
|
||||
public Long getOperatorId() { |
||||
return operatorId; |
||||
} |
||||
|
||||
public void setOperatorId(Long operatorId) { |
||||
this.operatorId = operatorId; |
||||
} |
||||
|
||||
public String getOperatorName() { |
||||
return operatorName; |
||||
} |
||||
|
||||
public void setOperatorName(String operatorName) { |
||||
this.operatorName = operatorName; |
||||
} |
||||
|
||||
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 getExt2() { |
||||
return ext2; |
||||
} |
||||
|
||||
public void setExt2(String ext2) { |
||||
this.ext2 = ext2; |
||||
} |
||||
|
||||
public String getExt3() { |
||||
return ext3; |
||||
} |
||||
|
||||
public void setExt3(String ext3) { |
||||
this.ext3 = ext3; |
||||
} |
||||
|
||||
@Override |
||||
public boolean equals(Object that) { |
||||
if (this == that) { |
||||
return true; |
||||
} |
||||
if (that == null) { |
||||
return false; |
||||
} |
||||
if (getClass() != that.getClass()) { |
||||
return false; |
||||
} |
||||
HighCoupon other = (HighCoupon) that; |
||||
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) |
||||
&& (this.getCompanyId() == null ? other.getCompanyId() == null : this.getCompanyId().equals(other.getCompanyId())) |
||||
&& (this.getMerchantId() == null ? other.getMerchantId() == null : this.getMerchantId().equals(other.getMerchantId())) |
||||
&& (this.getCouponKey() == null ? other.getCouponKey() == null : this.getCouponKey().equals(other.getCouponKey())) |
||||
&& (this.getCouponName() == null ? other.getCouponName() == null : this.getCouponName().equals(other.getCouponName())) |
||||
&& (this.getCouponValue() == null ? other.getCouponValue() == null : this.getCouponValue().equals(other.getCouponValue())) |
||||
&& (this.getCouponImg() == null ? other.getCouponImg() == null : this.getCouponImg().equals(other.getCouponImg())) |
||||
&& (this.getCouponPrice() == null ? other.getCouponPrice() == null : this.getCouponPrice().equals(other.getCouponPrice())) |
||||
&& (this.getIsPresent() == null ? other.getIsPresent() == null : this.getIsPresent().equals(other.getIsPresent())) |
||||
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) |
||||
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime())) |
||||
&& (this.getOperatorId() == null ? other.getOperatorId() == null : this.getOperatorId().equals(other.getOperatorId())) |
||||
&& (this.getOperatorName() == null ? other.getOperatorName() == null : this.getOperatorName().equals(other.getOperatorName())) |
||||
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) |
||||
&& (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1())) |
||||
&& (this.getExt2() == null ? other.getExt2() == null : this.getExt2().equals(other.getExt2())) |
||||
&& (this.getExt3() == null ? other.getExt3() == null : this.getExt3().equals(other.getExt3())); |
||||
} |
||||
|
||||
@Override |
||||
public int hashCode() { |
||||
final int prime = 31; |
||||
int result = 1; |
||||
result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); |
||||
result = prime * result + ((getCompanyId() == null) ? 0 : getCompanyId().hashCode()); |
||||
result = prime * result + ((getMerchantId() == null) ? 0 : getMerchantId().hashCode()); |
||||
result = prime * result + ((getCouponKey() == null) ? 0 : getCouponKey().hashCode()); |
||||
result = prime * result + ((getCouponName() == null) ? 0 : getCouponName().hashCode()); |
||||
result = prime * result + ((getCouponValue() == null) ? 0 : getCouponValue().hashCode()); |
||||
result = prime * result + ((getCouponImg() == null) ? 0 : getCouponImg().hashCode()); |
||||
result = prime * result + ((getCouponPrice() == null) ? 0 : getCouponPrice().hashCode()); |
||||
result = prime * result + ((getIsPresent() == null) ? 0 : getIsPresent().hashCode()); |
||||
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); |
||||
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode()); |
||||
result = prime * result + ((getOperatorId() == null) ? 0 : getOperatorId().hashCode()); |
||||
result = prime * result + ((getOperatorName() == null) ? 0 : getOperatorName().hashCode()); |
||||
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); |
||||
result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode()); |
||||
result = prime * result + ((getExt2() == null) ? 0 : getExt2().hashCode()); |
||||
result = prime * result + ((getExt3() == null) ? 0 : getExt3().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(", companyId=").append(companyId); |
||||
sb.append(", merchantId=").append(merchantId); |
||||
sb.append(", couponKey=").append(couponKey); |
||||
sb.append(", couponName=").append(couponName); |
||||
sb.append(", couponValue=").append(couponValue); |
||||
sb.append(", couponImg=").append(couponImg); |
||||
sb.append(", couponPrice=").append(couponPrice); |
||||
sb.append(", isPresent=").append(isPresent); |
||||
sb.append(", createTime=").append(createTime); |
||||
sb.append(", updateTime=").append(updateTime); |
||||
sb.append(", operatorId=").append(operatorId); |
||||
sb.append(", operatorName=").append(operatorName); |
||||
sb.append(", status=").append(status); |
||||
sb.append(", ext1=").append(ext1); |
||||
sb.append(", ext2=").append(ext2); |
||||
sb.append(", ext3=").append(ext3); |
||||
sb.append(", serialVersionUID=").append(serialVersionUID); |
||||
sb.append("]"); |
||||
return sb.toString(); |
||||
} |
||||
} |
@ -0,0 +1,296 @@ |
||||
package com.hai.entity; |
||||
|
||||
import java.io.Serializable; |
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* high_coupon_code |
||||
* @author |
||||
*/ |
||||
/** |
||||
* |
||||
* 代码由工具生成 |
||||
* |
||||
**/ |
||||
public class HighCouponCode implements Serializable { |
||||
/** |
||||
* 主键 |
||||
*/ |
||||
private Long id; |
||||
|
||||
/** |
||||
* 卡卷 |
||||
*/ |
||||
private Long couponId; |
||||
|
||||
/** |
||||
* 商户 |
||||
*/ |
||||
private Long merchantId; |
||||
|
||||
/** |
||||
* 订单id |
||||
*/ |
||||
private Long orderId; |
||||
|
||||
/** |
||||
* 销售码 |
||||
*/ |
||||
private String salesCode; |
||||
|
||||
/** |
||||
* 销售有效期 |
||||
*/ |
||||
private Date salesEndTime; |
||||
|
||||
/** |
||||
* 使用有效期 |
||||
*/ |
||||
private Date useEndTime; |
||||
|
||||
/** |
||||
* 创建时间 |
||||
*/ |
||||
private Date createTime; |
||||
|
||||
/** |
||||
* 领取时间 |
||||
*/ |
||||
private Date receiveTime; |
||||
|
||||
/** |
||||
* 消费时间 |
||||
*/ |
||||
private Date consumeTime; |
||||
|
||||
/** |
||||
* 状态:1.待销售 2.未使用 3.已使用 4.已过期 |
||||
*/ |
||||
private Integer status; |
||||
|
||||
/** |
||||
* 操作人 |
||||
*/ |
||||
private Long operatorId; |
||||
|
||||
/** |
||||
* 操作人名称 |
||||
*/ |
||||
private String operatorName; |
||||
|
||||
private String ext1; |
||||
|
||||
private String ext2; |
||||
|
||||
private String ext3; |
||||
|
||||
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 Long getMerchantId() { |
||||
return merchantId; |
||||
} |
||||
|
||||
public void setMerchantId(Long merchantId) { |
||||
this.merchantId = merchantId; |
||||
} |
||||
|
||||
public Long getOrderId() { |
||||
return orderId; |
||||
} |
||||
|
||||
public void setOrderId(Long orderId) { |
||||
this.orderId = orderId; |
||||
} |
||||
|
||||
public String getSalesCode() { |
||||
return salesCode; |
||||
} |
||||
|
||||
public void setSalesCode(String salesCode) { |
||||
this.salesCode = salesCode; |
||||
} |
||||
|
||||
public Date getSalesEndTime() { |
||||
return salesEndTime; |
||||
} |
||||
|
||||
public void setSalesEndTime(Date salesEndTime) { |
||||
this.salesEndTime = salesEndTime; |
||||
} |
||||
|
||||
public Date getUseEndTime() { |
||||
return useEndTime; |
||||
} |
||||
|
||||
public void setUseEndTime(Date useEndTime) { |
||||
this.useEndTime = useEndTime; |
||||
} |
||||
|
||||
public Date getCreateTime() { |
||||
return createTime; |
||||
} |
||||
|
||||
public void setCreateTime(Date createTime) { |
||||
this.createTime = createTime; |
||||
} |
||||
|
||||
public Date getReceiveTime() { |
||||
return receiveTime; |
||||
} |
||||
|
||||
public void setReceiveTime(Date receiveTime) { |
||||
this.receiveTime = receiveTime; |
||||
} |
||||
|
||||
public Date getConsumeTime() { |
||||
return consumeTime; |
||||
} |
||||
|
||||
public void setConsumeTime(Date consumeTime) { |
||||
this.consumeTime = consumeTime; |
||||
} |
||||
|
||||
public Integer getStatus() { |
||||
return status; |
||||
} |
||||
|
||||
public void setStatus(Integer status) { |
||||
this.status = status; |
||||
} |
||||
|
||||
public Long getOperatorId() { |
||||
return operatorId; |
||||
} |
||||
|
||||
public void setOperatorId(Long operatorId) { |
||||
this.operatorId = operatorId; |
||||
} |
||||
|
||||
public String getOperatorName() { |
||||
return operatorName; |
||||
} |
||||
|
||||
public void setOperatorName(String operatorName) { |
||||
this.operatorName = operatorName; |
||||
} |
||||
|
||||
public String getExt1() { |
||||
return ext1; |
||||
} |
||||
|
||||
public void setExt1(String ext1) { |
||||
this.ext1 = ext1; |
||||
} |
||||
|
||||
public String getExt2() { |
||||
return ext2; |
||||
} |
||||
|
||||
public void setExt2(String ext2) { |
||||
this.ext2 = ext2; |
||||
} |
||||
|
||||
public String getExt3() { |
||||
return ext3; |
||||
} |
||||
|
||||
public void setExt3(String ext3) { |
||||
this.ext3 = ext3; |
||||
} |
||||
|
||||
@Override |
||||
public boolean equals(Object that) { |
||||
if (this == that) { |
||||
return true; |
||||
} |
||||
if (that == null) { |
||||
return false; |
||||
} |
||||
if (getClass() != that.getClass()) { |
||||
return false; |
||||
} |
||||
HighCouponCode other = (HighCouponCode) 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.getMerchantId() == null ? other.getMerchantId() == null : this.getMerchantId().equals(other.getMerchantId())) |
||||
&& (this.getOrderId() == null ? other.getOrderId() == null : this.getOrderId().equals(other.getOrderId())) |
||||
&& (this.getSalesCode() == null ? other.getSalesCode() == null : this.getSalesCode().equals(other.getSalesCode())) |
||||
&& (this.getSalesEndTime() == null ? other.getSalesEndTime() == null : this.getSalesEndTime().equals(other.getSalesEndTime())) |
||||
&& (this.getUseEndTime() == null ? other.getUseEndTime() == null : this.getUseEndTime().equals(other.getUseEndTime())) |
||||
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) |
||||
&& (this.getReceiveTime() == null ? other.getReceiveTime() == null : this.getReceiveTime().equals(other.getReceiveTime())) |
||||
&& (this.getConsumeTime() == null ? other.getConsumeTime() == null : this.getConsumeTime().equals(other.getConsumeTime())) |
||||
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) |
||||
&& (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())) |
||||
&& (this.getExt2() == null ? other.getExt2() == null : this.getExt2().equals(other.getExt2())) |
||||
&& (this.getExt3() == null ? other.getExt3() == null : this.getExt3().equals(other.getExt3())); |
||||
} |
||||
|
||||
@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 + ((getMerchantId() == null) ? 0 : getMerchantId().hashCode()); |
||||
result = prime * result + ((getOrderId() == null) ? 0 : getOrderId().hashCode()); |
||||
result = prime * result + ((getSalesCode() == null) ? 0 : getSalesCode().hashCode()); |
||||
result = prime * result + ((getSalesEndTime() == null) ? 0 : getSalesEndTime().hashCode()); |
||||
result = prime * result + ((getUseEndTime() == null) ? 0 : getUseEndTime().hashCode()); |
||||
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); |
||||
result = prime * result + ((getReceiveTime() == null) ? 0 : getReceiveTime().hashCode()); |
||||
result = prime * result + ((getConsumeTime() == null) ? 0 : getConsumeTime().hashCode()); |
||||
result = prime * result + ((getStatus() == null) ? 0 : getStatus().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()); |
||||
result = prime * result + ((getExt2() == null) ? 0 : getExt2().hashCode()); |
||||
result = prime * result + ((getExt3() == null) ? 0 : getExt3().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(", merchantId=").append(merchantId); |
||||
sb.append(", orderId=").append(orderId); |
||||
sb.append(", salesCode=").append(salesCode); |
||||
sb.append(", salesEndTime=").append(salesEndTime); |
||||
sb.append(", useEndTime=").append(useEndTime); |
||||
sb.append(", createTime=").append(createTime); |
||||
sb.append(", receiveTime=").append(receiveTime); |
||||
sb.append(", consumeTime=").append(consumeTime); |
||||
sb.append(", status=").append(status); |
||||
sb.append(", operatorId=").append(operatorId); |
||||
sb.append(", operatorName=").append(operatorName); |
||||
sb.append(", ext1=").append(ext1); |
||||
sb.append(", ext2=").append(ext2); |
||||
sb.append(", ext3=").append(ext3); |
||||
sb.append(", serialVersionUID=").append(serialVersionUID); |
||||
sb.append("]"); |
||||
return sb.toString(); |
||||
} |
||||
} |
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,200 @@ |
||||
package com.hai.entity; |
||||
|
||||
import java.io.Serializable; |
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* high_coupon_handsel |
||||
* @author |
||||
*/ |
||||
/** |
||||
* |
||||
* 代码由工具生成 |
||||
* |
||||
**/ |
||||
public class HighCouponHandsel implements Serializable { |
||||
/** |
||||
* 主键 |
||||
*/ |
||||
private Long id; |
||||
|
||||
/** |
||||
* 卡卷id |
||||
*/ |
||||
private Long couponId; |
||||
|
||||
/** |
||||
* 赠送卡卷id |
||||
*/ |
||||
private Long handselCouponId; |
||||
|
||||
/** |
||||
* 创建时间 |
||||
*/ |
||||
private Date createTime; |
||||
|
||||
/** |
||||
* 状态 0:删除 1:正常 |
||||
*/ |
||||
private Integer status; |
||||
|
||||
/** |
||||
* 操作人id |
||||
*/ |
||||
private Long operatorId; |
||||
|
||||
/** |
||||
* 操作人名称 |
||||
*/ |
||||
private String operatorName; |
||||
|
||||
private String ext1; |
||||
|
||||
private String ext2; |
||||
|
||||
private String ext3; |
||||
|
||||
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 Long getHandselCouponId() { |
||||
return handselCouponId; |
||||
} |
||||
|
||||
public void setHandselCouponId(Long handselCouponId) { |
||||
this.handselCouponId = handselCouponId; |
||||
} |
||||
|
||||
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 Long getOperatorId() { |
||||
return operatorId; |
||||
} |
||||
|
||||
public void setOperatorId(Long operatorId) { |
||||
this.operatorId = operatorId; |
||||
} |
||||
|
||||
public String getOperatorName() { |
||||
return operatorName; |
||||
} |
||||
|
||||
public void setOperatorName(String operatorName) { |
||||
this.operatorName = operatorName; |
||||
} |
||||
|
||||
public String getExt1() { |
||||
return ext1; |
||||
} |
||||
|
||||
public void setExt1(String ext1) { |
||||
this.ext1 = ext1; |
||||
} |
||||
|
||||
public String getExt2() { |
||||
return ext2; |
||||
} |
||||
|
||||
public void setExt2(String ext2) { |
||||
this.ext2 = ext2; |
||||
} |
||||
|
||||
public String getExt3() { |
||||
return ext3; |
||||
} |
||||
|
||||
public void setExt3(String ext3) { |
||||
this.ext3 = ext3; |
||||
} |
||||
|
||||
@Override |
||||
public boolean equals(Object that) { |
||||
if (this == that) { |
||||
return true; |
||||
} |
||||
if (that == null) { |
||||
return false; |
||||
} |
||||
if (getClass() != that.getClass()) { |
||||
return false; |
||||
} |
||||
HighCouponHandsel other = (HighCouponHandsel) 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.getHandselCouponId() == null ? other.getHandselCouponId() == null : this.getHandselCouponId().equals(other.getHandselCouponId())) |
||||
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) |
||||
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) |
||||
&& (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())) |
||||
&& (this.getExt2() == null ? other.getExt2() == null : this.getExt2().equals(other.getExt2())) |
||||
&& (this.getExt3() == null ? other.getExt3() == null : this.getExt3().equals(other.getExt3())); |
||||
} |
||||
|
||||
@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 + ((getHandselCouponId() == null) ? 0 : getHandselCouponId().hashCode()); |
||||
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); |
||||
result = prime * result + ((getStatus() == null) ? 0 : getStatus().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()); |
||||
result = prime * result + ((getExt2() == null) ? 0 : getExt2().hashCode()); |
||||
result = prime * result + ((getExt3() == null) ? 0 : getExt3().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(", handselCouponId=").append(handselCouponId); |
||||
sb.append(", createTime=").append(createTime); |
||||
sb.append(", status=").append(status); |
||||
sb.append(", operatorId=").append(operatorId); |
||||
sb.append(", operatorName=").append(operatorName); |
||||
sb.append(", ext1=").append(ext1); |
||||
sb.append(", ext2=").append(ext2); |
||||
sb.append(", ext3=").append(ext3); |
||||
sb.append(", serialVersionUID=").append(serialVersionUID); |
||||
sb.append("]"); |
||||
return sb.toString(); |
||||
} |
||||
} |
@ -0,0 +1,863 @@ |
||||
package com.hai.entity; |
||||
|
||||
import java.util.ArrayList; |
||||
import java.util.Date; |
||||
import java.util.List; |
||||
|
||||
public class HighCouponHandselExample { |
||||
protected String orderByClause; |
||||
|
||||
protected boolean distinct; |
||||
|
||||
protected List<Criteria> oredCriteria; |
||||
|
||||
private Integer limit; |
||||
|
||||
private Long offset; |
||||
|
||||
public HighCouponHandselExample() { |
||||
oredCriteria = new ArrayList<Criteria>(); |
||||
} |
||||
|
||||
public void setOrderByClause(String orderByClause) { |
||||
this.orderByClause = orderByClause; |
||||
} |
||||
|
||||
public String getOrderByClause() { |
||||
return orderByClause; |
||||
} |
||||
|
||||
public void setDistinct(boolean distinct) { |
||||
this.distinct = distinct; |
||||
} |
||||
|
||||
public boolean isDistinct() { |
||||
return distinct; |
||||
} |
||||
|
||||
public List<Criteria> getOredCriteria() { |
||||
return oredCriteria; |
||||
} |
||||
|
||||
public void or(Criteria criteria) { |
||||
oredCriteria.add(criteria); |
||||
} |
||||
|
||||
public Criteria or() { |
||||
Criteria criteria = createCriteriaInternal(); |
||||
oredCriteria.add(criteria); |
||||
return criteria; |
||||
} |
||||
|
||||
public Criteria createCriteria() { |
||||
Criteria criteria = createCriteriaInternal(); |
||||
if (oredCriteria.size() == 0) { |
||||
oredCriteria.add(criteria); |
||||
} |
||||
return criteria; |
||||
} |
||||
|
||||
protected Criteria createCriteriaInternal() { |
||||
Criteria criteria = new Criteria(); |
||||
return criteria; |
||||
} |
||||
|
||||
public void clear() { |
||||
oredCriteria.clear(); |
||||
orderByClause = null; |
||||
distinct = false; |
||||
} |
||||
|
||||
public void setLimit(Integer limit) { |
||||
this.limit = limit; |
||||
} |
||||
|
||||
public Integer getLimit() { |
||||
return limit; |
||||
} |
||||
|
||||
public void setOffset(Long offset) { |
||||
this.offset = offset; |
||||
} |
||||
|
||||
public Long getOffset() { |
||||
return offset; |
||||
} |
||||
|
||||
protected abstract static class GeneratedCriteria { |
||||
protected List<Criterion> criteria; |
||||
|
||||
protected GeneratedCriteria() { |
||||
super(); |
||||
criteria = new ArrayList<Criterion>(); |
||||
} |
||||
|
||||
public boolean isValid() { |
||||
return criteria.size() > 0; |
||||
} |
||||
|
||||
public List<Criterion> getAllCriteria() { |
||||
return criteria; |
||||
} |
||||
|
||||
public List<Criterion> getCriteria() { |
||||
return criteria; |
||||
} |
||||
|
||||
protected void addCriterion(String condition) { |
||||
if (condition == null) { |
||||
throw new RuntimeException("Value for condition cannot be null"); |
||||
} |
||||
criteria.add(new Criterion(condition)); |
||||
} |
||||
|
||||
protected void addCriterion(String condition, Object value, String property) { |
||||
if (value == null) { |
||||
throw new RuntimeException("Value for " + property + " cannot be null"); |
||||
} |
||||
criteria.add(new Criterion(condition, value)); |
||||
} |
||||
|
||||
protected void addCriterion(String condition, Object value1, Object value2, String property) { |
||||
if (value1 == null || value2 == null) { |
||||
throw new RuntimeException("Between values for " + property + " cannot be null"); |
||||
} |
||||
criteria.add(new Criterion(condition, value1, value2)); |
||||
} |
||||
|
||||
public Criteria andIdIsNull() { |
||||
addCriterion("id is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdIsNotNull() { |
||||
addCriterion("id is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdEqualTo(Long value) { |
||||
addCriterion("id =", value, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdNotEqualTo(Long value) { |
||||
addCriterion("id <>", value, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdGreaterThan(Long value) { |
||||
addCriterion("id >", value, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdGreaterThanOrEqualTo(Long value) { |
||||
addCriterion("id >=", value, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdLessThan(Long value) { |
||||
addCriterion("id <", value, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdLessThanOrEqualTo(Long value) { |
||||
addCriterion("id <=", value, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdIn(List<Long> values) { |
||||
addCriterion("id in", values, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdNotIn(List<Long> values) { |
||||
addCriterion("id not in", values, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdBetween(Long value1, Long value2) { |
||||
addCriterion("id between", value1, value2, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdNotBetween(Long value1, Long value2) { |
||||
addCriterion("id not between", value1, value2, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCouponIdIsNull() { |
||||
addCriterion("coupon_id is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCouponIdIsNotNull() { |
||||
addCriterion("coupon_id is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCouponIdEqualTo(Long value) { |
||||
addCriterion("coupon_id =", value, "couponId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCouponIdNotEqualTo(Long value) { |
||||
addCriterion("coupon_id <>", value, "couponId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCouponIdGreaterThan(Long value) { |
||||
addCriterion("coupon_id >", value, "couponId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCouponIdGreaterThanOrEqualTo(Long value) { |
||||
addCriterion("coupon_id >=", value, "couponId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCouponIdLessThan(Long value) { |
||||
addCriterion("coupon_id <", value, "couponId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCouponIdLessThanOrEqualTo(Long value) { |
||||
addCriterion("coupon_id <=", value, "couponId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCouponIdIn(List<Long> values) { |
||||
addCriterion("coupon_id in", values, "couponId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCouponIdNotIn(List<Long> values) { |
||||
addCriterion("coupon_id not in", values, "couponId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCouponIdBetween(Long value1, Long value2) { |
||||
addCriterion("coupon_id between", value1, value2, "couponId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCouponIdNotBetween(Long value1, Long value2) { |
||||
addCriterion("coupon_id not between", value1, value2, "couponId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andHandselCouponIdIsNull() { |
||||
addCriterion("handsel_coupon_id is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andHandselCouponIdIsNotNull() { |
||||
addCriterion("handsel_coupon_id is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andHandselCouponIdEqualTo(Long value) { |
||||
addCriterion("handsel_coupon_id =", value, "handselCouponId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andHandselCouponIdNotEqualTo(Long value) { |
||||
addCriterion("handsel_coupon_id <>", value, "handselCouponId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andHandselCouponIdGreaterThan(Long value) { |
||||
addCriterion("handsel_coupon_id >", value, "handselCouponId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andHandselCouponIdGreaterThanOrEqualTo(Long value) { |
||||
addCriterion("handsel_coupon_id >=", value, "handselCouponId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andHandselCouponIdLessThan(Long value) { |
||||
addCriterion("handsel_coupon_id <", value, "handselCouponId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andHandselCouponIdLessThanOrEqualTo(Long value) { |
||||
addCriterion("handsel_coupon_id <=", value, "handselCouponId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andHandselCouponIdIn(List<Long> values) { |
||||
addCriterion("handsel_coupon_id in", values, "handselCouponId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andHandselCouponIdNotIn(List<Long> values) { |
||||
addCriterion("handsel_coupon_id not in", values, "handselCouponId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andHandselCouponIdBetween(Long value1, Long value2) { |
||||
addCriterion("handsel_coupon_id between", value1, value2, "handselCouponId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andHandselCouponIdNotBetween(Long value1, Long value2) { |
||||
addCriterion("handsel_coupon_id not between", value1, value2, "handselCouponId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeIsNull() { |
||||
addCriterion("create_time is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeIsNotNull() { |
||||
addCriterion("create_time is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeEqualTo(Date value) { |
||||
addCriterion("create_time =", value, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeNotEqualTo(Date value) { |
||||
addCriterion("create_time <>", value, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeGreaterThan(Date value) { |
||||
addCriterion("create_time >", value, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { |
||||
addCriterion("create_time >=", value, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeLessThan(Date value) { |
||||
addCriterion("create_time <", value, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeLessThanOrEqualTo(Date value) { |
||||
addCriterion("create_time <=", value, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeIn(List<Date> values) { |
||||
addCriterion("create_time in", values, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeNotIn(List<Date> values) { |
||||
addCriterion("create_time not in", values, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeBetween(Date value1, Date value2) { |
||||
addCriterion("create_time between", value1, value2, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeNotBetween(Date value1, Date value2) { |
||||
addCriterion("create_time not between", value1, value2, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusIsNull() { |
||||
addCriterion("`status` is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusIsNotNull() { |
||||
addCriterion("`status` is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusEqualTo(Integer value) { |
||||
addCriterion("`status` =", value, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusNotEqualTo(Integer value) { |
||||
addCriterion("`status` <>", value, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusGreaterThan(Integer value) { |
||||
addCriterion("`status` >", value, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusGreaterThanOrEqualTo(Integer value) { |
||||
addCriterion("`status` >=", value, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusLessThan(Integer value) { |
||||
addCriterion("`status` <", value, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusLessThanOrEqualTo(Integer value) { |
||||
addCriterion("`status` <=", value, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusIn(List<Integer> values) { |
||||
addCriterion("`status` in", values, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusNotIn(List<Integer> values) { |
||||
addCriterion("`status` not in", values, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusBetween(Integer value1, Integer value2) { |
||||
addCriterion("`status` between", value1, value2, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusNotBetween(Integer value1, Integer value2) { |
||||
addCriterion("`status` not between", value1, value2, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andOperatorIdIsNull() { |
||||
addCriterion("operator_id is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andOperatorIdIsNotNull() { |
||||
addCriterion("operator_id is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andOperatorIdEqualTo(Long value) { |
||||
addCriterion("operator_id =", value, "operatorId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andOperatorIdNotEqualTo(Long value) { |
||||
addCriterion("operator_id <>", value, "operatorId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andOperatorIdGreaterThan(Long value) { |
||||
addCriterion("operator_id >", value, "operatorId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andOperatorIdGreaterThanOrEqualTo(Long value) { |
||||
addCriterion("operator_id >=", value, "operatorId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andOperatorIdLessThan(Long value) { |
||||
addCriterion("operator_id <", value, "operatorId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andOperatorIdLessThanOrEqualTo(Long value) { |
||||
addCriterion("operator_id <=", value, "operatorId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andOperatorIdIn(List<Long> values) { |
||||
addCriterion("operator_id in", values, "operatorId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andOperatorIdNotIn(List<Long> values) { |
||||
addCriterion("operator_id not in", values, "operatorId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andOperatorIdBetween(Long value1, Long value2) { |
||||
addCriterion("operator_id between", value1, value2, "operatorId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andOperatorIdNotBetween(Long value1, Long value2) { |
||||
addCriterion("operator_id not between", value1, value2, "operatorId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andOperatorNameIsNull() { |
||||
addCriterion("operator_name is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andOperatorNameIsNotNull() { |
||||
addCriterion("operator_name is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andOperatorNameEqualTo(String value) { |
||||
addCriterion("operator_name =", value, "operatorName"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andOperatorNameNotEqualTo(String value) { |
||||
addCriterion("operator_name <>", value, "operatorName"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andOperatorNameGreaterThan(String value) { |
||||
addCriterion("operator_name >", value, "operatorName"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andOperatorNameGreaterThanOrEqualTo(String value) { |
||||
addCriterion("operator_name >=", value, "operatorName"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andOperatorNameLessThan(String value) { |
||||
addCriterion("operator_name <", value, "operatorName"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andOperatorNameLessThanOrEqualTo(String value) { |
||||
addCriterion("operator_name <=", value, "operatorName"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andOperatorNameLike(String value) { |
||||
addCriterion("operator_name like", value, "operatorName"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andOperatorNameNotLike(String value) { |
||||
addCriterion("operator_name not like", value, "operatorName"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andOperatorNameIn(List<String> values) { |
||||
addCriterion("operator_name in", values, "operatorName"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andOperatorNameNotIn(List<String> values) { |
||||
addCriterion("operator_name not in", values, "operatorName"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andOperatorNameBetween(String value1, String value2) { |
||||
addCriterion("operator_name between", value1, value2, "operatorName"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andOperatorNameNotBetween(String value1, String value2) { |
||||
addCriterion("operator_name not between", value1, value2, "operatorName"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1IsNull() { |
||||
addCriterion("ext_1 is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1IsNotNull() { |
||||
addCriterion("ext_1 is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1EqualTo(String value) { |
||||
addCriterion("ext_1 =", value, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1NotEqualTo(String value) { |
||||
addCriterion("ext_1 <>", value, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1GreaterThan(String value) { |
||||
addCriterion("ext_1 >", value, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1GreaterThanOrEqualTo(String value) { |
||||
addCriterion("ext_1 >=", value, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1LessThan(String value) { |
||||
addCriterion("ext_1 <", value, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1LessThanOrEqualTo(String value) { |
||||
addCriterion("ext_1 <=", value, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1Like(String value) { |
||||
addCriterion("ext_1 like", value, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1NotLike(String value) { |
||||
addCriterion("ext_1 not like", value, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1In(List<String> values) { |
||||
addCriterion("ext_1 in", values, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1NotIn(List<String> values) { |
||||
addCriterion("ext_1 not in", values, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1Between(String value1, String value2) { |
||||
addCriterion("ext_1 between", value1, value2, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1NotBetween(String value1, String value2) { |
||||
addCriterion("ext_1 not between", value1, value2, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2IsNull() { |
||||
addCriterion("ext_2 is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2IsNotNull() { |
||||
addCriterion("ext_2 is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2EqualTo(String value) { |
||||
addCriterion("ext_2 =", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2NotEqualTo(String value) { |
||||
addCriterion("ext_2 <>", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2GreaterThan(String value) { |
||||
addCriterion("ext_2 >", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2GreaterThanOrEqualTo(String value) { |
||||
addCriterion("ext_2 >=", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2LessThan(String value) { |
||||
addCriterion("ext_2 <", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2LessThanOrEqualTo(String value) { |
||||
addCriterion("ext_2 <=", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2Like(String value) { |
||||
addCriterion("ext_2 like", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2NotLike(String value) { |
||||
addCriterion("ext_2 not like", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2In(List<String> values) { |
||||
addCriterion("ext_2 in", values, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2NotIn(List<String> values) { |
||||
addCriterion("ext_2 not in", values, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2Between(String value1, String value2) { |
||||
addCriterion("ext_2 between", value1, value2, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2NotBetween(String value1, String value2) { |
||||
addCriterion("ext_2 not between", value1, value2, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3IsNull() { |
||||
addCriterion("ext_3 is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3IsNotNull() { |
||||
addCriterion("ext_3 is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3EqualTo(String value) { |
||||
addCriterion("ext_3 =", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3NotEqualTo(String value) { |
||||
addCriterion("ext_3 <>", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3GreaterThan(String value) { |
||||
addCriterion("ext_3 >", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3GreaterThanOrEqualTo(String value) { |
||||
addCriterion("ext_3 >=", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3LessThan(String value) { |
||||
addCriterion("ext_3 <", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3LessThanOrEqualTo(String value) { |
||||
addCriterion("ext_3 <=", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3Like(String value) { |
||||
addCriterion("ext_3 like", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3NotLike(String value) { |
||||
addCriterion("ext_3 not like", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3In(List<String> values) { |
||||
addCriterion("ext_3 in", values, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3NotIn(List<String> values) { |
||||
addCriterion("ext_3 not in", values, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3Between(String value1, String value2) { |
||||
addCriterion("ext_3 between", value1, value2, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3NotBetween(String value1, String value2) { |
||||
addCriterion("ext_3 not between", value1, value2, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
} |
||||
|
||||
/** |
||||
*/ |
||||
public static class Criteria extends GeneratedCriteria { |
||||
|
||||
protected Criteria() { |
||||
super(); |
||||
} |
||||
} |
||||
|
||||
public static class Criterion { |
||||
private String condition; |
||||
|
||||
private Object value; |
||||
|
||||
private Object secondValue; |
||||
|
||||
private boolean noValue; |
||||
|
||||
private boolean singleValue; |
||||
|
||||
private boolean betweenValue; |
||||
|
||||
private boolean listValue; |
||||
|
||||
private String typeHandler; |
||||
|
||||
public String getCondition() { |
||||
return condition; |
||||
} |
||||
|
||||
public Object getValue() { |
||||
return value; |
||||
} |
||||
|
||||
public Object getSecondValue() { |
||||
return secondValue; |
||||
} |
||||
|
||||
public boolean isNoValue() { |
||||
return noValue; |
||||
} |
||||
|
||||
public boolean isSingleValue() { |
||||
return singleValue; |
||||
} |
||||
|
||||
public boolean isBetweenValue() { |
||||
return betweenValue; |
||||
} |
||||
|
||||
public boolean isListValue() { |
||||
return listValue; |
||||
} |
||||
|
||||
public String getTypeHandler() { |
||||
return typeHandler; |
||||
} |
||||
|
||||
protected Criterion(String condition) { |
||||
super(); |
||||
this.condition = condition; |
||||
this.typeHandler = null; |
||||
this.noValue = true; |
||||
} |
||||
|
||||
protected Criterion(String condition, Object value, String typeHandler) { |
||||
super(); |
||||
this.condition = condition; |
||||
this.value = value; |
||||
this.typeHandler = typeHandler; |
||||
if (value instanceof List<?>) { |
||||
this.listValue = true; |
||||
} else { |
||||
this.singleValue = true; |
||||
} |
||||
} |
||||
|
||||
protected Criterion(String condition, Object value) { |
||||
this(condition, value, null); |
||||
} |
||||
|
||||
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { |
||||
super(); |
||||
this.condition = condition; |
||||
this.value = value; |
||||
this.secondValue = secondValue; |
||||
this.typeHandler = typeHandler; |
||||
this.betweenValue = true; |
||||
} |
||||
|
||||
protected Criterion(String condition, Object value, Object secondValue) { |
||||
this(condition, value, secondValue, null); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,248 @@ |
||||
package com.hai.entity; |
||||
|
||||
import java.io.Serializable; |
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* high_goods_price_refer |
||||
* @author |
||||
*/ |
||||
/** |
||||
* |
||||
* 代码由工具生成 |
||||
* |
||||
**/ |
||||
public class HighGoodsPriceRefer implements Serializable { |
||||
/** |
||||
* 主键 |
||||
*/ |
||||
private Long id; |
||||
|
||||
/** |
||||
* 类型 1.卡卷 |
||||
*/ |
||||
private Integer goodsType; |
||||
|
||||
/** |
||||
* 商品id |
||||
*/ |
||||
private Long goodsId; |
||||
|
||||
/** |
||||
* 新销售价格 |
||||
*/ |
||||
private Float newSalePrice; |
||||
|
||||
/** |
||||
* 新销售价格 生效时间 |
||||
*/ |
||||
private Date effectiveTime; |
||||
|
||||
/** |
||||
* 创建时间 |
||||
*/ |
||||
private Date createTime; |
||||
|
||||
/** |
||||
* 更新时间 |
||||
*/ |
||||
private Date updateTime; |
||||
|
||||
/** |
||||
* 操作人id |
||||
*/ |
||||
private Long operatorId; |
||||
|
||||
/** |
||||
* 操作人名称 |
||||
*/ |
||||
private String operatorName; |
||||
|
||||
/** |
||||
* 状态: 0 不可用 1 可用 |
||||
*/ |
||||
private Integer status; |
||||
|
||||
private String ext1; |
||||
|
||||
private String ext2; |
||||
|
||||
private String ext3; |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
public Long getId() { |
||||
return id; |
||||
} |
||||
|
||||
public void setId(Long id) { |
||||
this.id = id; |
||||
} |
||||
|
||||
public Integer getGoodsType() { |
||||
return goodsType; |
||||
} |
||||
|
||||
public void setGoodsType(Integer goodsType) { |
||||
this.goodsType = goodsType; |
||||
} |
||||
|
||||
public Long getGoodsId() { |
||||
return goodsId; |
||||
} |
||||
|
||||
public void setGoodsId(Long goodsId) { |
||||
this.goodsId = goodsId; |
||||
} |
||||
|
||||
public Float getNewSalePrice() { |
||||
return newSalePrice; |
||||
} |
||||
|
||||
public void setNewSalePrice(Float newSalePrice) { |
||||
this.newSalePrice = newSalePrice; |
||||
} |
||||
|
||||
public Date getEffectiveTime() { |
||||
return effectiveTime; |
||||
} |
||||
|
||||
public void setEffectiveTime(Date effectiveTime) { |
||||
this.effectiveTime = effectiveTime; |
||||
} |
||||
|
||||
public Date getCreateTime() { |
||||
return createTime; |
||||
} |
||||
|
||||
public void setCreateTime(Date createTime) { |
||||
this.createTime = createTime; |
||||
} |
||||
|
||||
public Date getUpdateTime() { |
||||
return updateTime; |
||||
} |
||||
|
||||
public void setUpdateTime(Date updateTime) { |
||||
this.updateTime = updateTime; |
||||
} |
||||
|
||||
public Long getOperatorId() { |
||||
return operatorId; |
||||
} |
||||
|
||||
public void setOperatorId(Long operatorId) { |
||||
this.operatorId = operatorId; |
||||
} |
||||
|
||||
public String getOperatorName() { |
||||
return operatorName; |
||||
} |
||||
|
||||
public void setOperatorName(String operatorName) { |
||||
this.operatorName = operatorName; |
||||
} |
||||
|
||||
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 getExt2() { |
||||
return ext2; |
||||
} |
||||
|
||||
public void setExt2(String ext2) { |
||||
this.ext2 = ext2; |
||||
} |
||||
|
||||
public String getExt3() { |
||||
return ext3; |
||||
} |
||||
|
||||
public void setExt3(String ext3) { |
||||
this.ext3 = ext3; |
||||
} |
||||
|
||||
@Override |
||||
public boolean equals(Object that) { |
||||
if (this == that) { |
||||
return true; |
||||
} |
||||
if (that == null) { |
||||
return false; |
||||
} |
||||
if (getClass() != that.getClass()) { |
||||
return false; |
||||
} |
||||
HighGoodsPriceRefer other = (HighGoodsPriceRefer) that; |
||||
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) |
||||
&& (this.getGoodsType() == null ? other.getGoodsType() == null : this.getGoodsType().equals(other.getGoodsType())) |
||||
&& (this.getGoodsId() == null ? other.getGoodsId() == null : this.getGoodsId().equals(other.getGoodsId())) |
||||
&& (this.getNewSalePrice() == null ? other.getNewSalePrice() == null : this.getNewSalePrice().equals(other.getNewSalePrice())) |
||||
&& (this.getEffectiveTime() == null ? other.getEffectiveTime() == null : this.getEffectiveTime().equals(other.getEffectiveTime())) |
||||
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) |
||||
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime())) |
||||
&& (this.getOperatorId() == null ? other.getOperatorId() == null : this.getOperatorId().equals(other.getOperatorId())) |
||||
&& (this.getOperatorName() == null ? other.getOperatorName() == null : this.getOperatorName().equals(other.getOperatorName())) |
||||
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) |
||||
&& (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1())) |
||||
&& (this.getExt2() == null ? other.getExt2() == null : this.getExt2().equals(other.getExt2())) |
||||
&& (this.getExt3() == null ? other.getExt3() == null : this.getExt3().equals(other.getExt3())); |
||||
} |
||||
|
||||
@Override |
||||
public int hashCode() { |
||||
final int prime = 31; |
||||
int result = 1; |
||||
result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); |
||||
result = prime * result + ((getGoodsType() == null) ? 0 : getGoodsType().hashCode()); |
||||
result = prime * result + ((getGoodsId() == null) ? 0 : getGoodsId().hashCode()); |
||||
result = prime * result + ((getNewSalePrice() == null) ? 0 : getNewSalePrice().hashCode()); |
||||
result = prime * result + ((getEffectiveTime() == null) ? 0 : getEffectiveTime().hashCode()); |
||||
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); |
||||
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode()); |
||||
result = prime * result + ((getOperatorId() == null) ? 0 : getOperatorId().hashCode()); |
||||
result = prime * result + ((getOperatorName() == null) ? 0 : getOperatorName().hashCode()); |
||||
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); |
||||
result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode()); |
||||
result = prime * result + ((getExt2() == null) ? 0 : getExt2().hashCode()); |
||||
result = prime * result + ((getExt3() == null) ? 0 : getExt3().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(", goodsType=").append(goodsType); |
||||
sb.append(", goodsId=").append(goodsId); |
||||
sb.append(", newSalePrice=").append(newSalePrice); |
||||
sb.append(", effectiveTime=").append(effectiveTime); |
||||
sb.append(", createTime=").append(createTime); |
||||
sb.append(", updateTime=").append(updateTime); |
||||
sb.append(", operatorId=").append(operatorId); |
||||
sb.append(", operatorName=").append(operatorName); |
||||
sb.append(", status=").append(status); |
||||
sb.append(", ext1=").append(ext1); |
||||
sb.append(", ext2=").append(ext2); |
||||
sb.append(", ext3=").append(ext3); |
||||
sb.append(", serialVersionUID=").append(serialVersionUID); |
||||
sb.append("]"); |
||||
return sb.toString(); |
||||
} |
||||
} |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,22 @@ |
||||
package com.hai.model; |
||||
|
||||
import com.hai.entity.HighCoupon; |
||||
import com.hai.entity.HighCouponHandsel; |
||||
|
||||
/** |
||||
* @Auther: 胡锐 |
||||
* @Description: 赠送卡券模型 |
||||
* @Date: 2021/3/11 23:12 |
||||
*/ |
||||
public class HighCouponHandselModel extends HighCouponHandsel { |
||||
|
||||
HighCoupon highCoupon; |
||||
|
||||
public HighCoupon getHighCoupon() { |
||||
return highCoupon; |
||||
} |
||||
|
||||
public void setHighCoupon(HighCoupon highCoupon) { |
||||
this.highCoupon = highCoupon; |
||||
} |
||||
} |
@ -0,0 +1,24 @@ |
||||
package com.hai.model; |
||||
|
||||
import com.hai.entity.HighCoupon; |
||||
import com.hai.entity.HighCouponHandsel; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @Auther: 胡锐 |
||||
* @Description: 卡卷模型 |
||||
* @Date: 2021/3/11 22:27 |
||||
*/ |
||||
public class HighCouponModel extends HighCoupon { |
||||
|
||||
List<HighCouponHandselModel> handselCouponList; |
||||
|
||||
public List<HighCouponHandselModel> getHandselCouponList() { |
||||
return handselCouponList; |
||||
} |
||||
|
||||
public void setHandselCouponList(List<HighCouponHandselModel> handselCouponList) { |
||||
this.handselCouponList = handselCouponList; |
||||
} |
||||
} |
@ -0,0 +1,20 @@ |
||||
package com.hai.service; |
||||
|
||||
import com.hai.entity.HighCoupon; |
||||
import com.hai.model.HighCouponModel; |
||||
|
||||
/** |
||||
* @Auther: 胡锐 |
||||
* @Description: |
||||
* @Date: 2021/3/11 22:04 |
||||
*/ |
||||
public interface HighCouponService { |
||||
|
||||
/** |
||||
* @Author 胡锐 |
||||
* @Description 增加 |
||||
* @Date 2021/3/11 22:05 |
||||
**/ |
||||
void insertCoupon(HighCouponModel highCouponModel); |
||||
|
||||
} |
@ -0,0 +1,44 @@ |
||||
package com.hai.service.impl; |
||||
|
||||
import com.hai.dao.HighCouponHandselMapper; |
||||
import com.hai.dao.HighCouponMapper; |
||||
import com.hai.entity.HighCoupon; |
||||
import com.hai.entity.HighCouponHandsel; |
||||
import com.hai.model.HighCouponHandselModel; |
||||
import com.hai.model.HighCouponModel; |
||||
import com.hai.service.HighCouponService; |
||||
import org.springframework.stereotype.Service; |
||||
import org.springframework.transaction.annotation.Transactional; |
||||
|
||||
import javax.annotation.Resource; |
||||
import java.util.Date; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @Auther: 胡锐 |
||||
* @Description: |
||||
* @Date: 2021/3/11 22:07 |
||||
*/ |
||||
@Service("highCouponService") |
||||
public class HighCouponServiceImpl implements HighCouponService { |
||||
|
||||
@Resource |
||||
private HighCouponMapper highCouponMapper; |
||||
|
||||
@Resource |
||||
private HighCouponHandselMapper highCouponHandselMapper; |
||||
|
||||
@Override |
||||
@Transactional |
||||
public void insertCoupon(HighCouponModel highCouponModel) { |
||||
highCouponMapper.insert(highCouponModel); |
||||
|
||||
// 增加赠送卡卷
|
||||
if (highCouponModel.getHandselCouponList() != null && highCouponModel.getHandselCouponList().size() > 0) { |
||||
for (HighCouponHandselModel handsel : highCouponModel.getHandselCouponList()) { |
||||
handsel.setCouponId(highCouponModel.getId()); |
||||
} |
||||
} |
||||
|
||||
} |
||||
} |
Loading…
Reference in new issue