提交代码

dev-discount
胡锐 3 years ago
parent 53588e3a19
commit 1e501c9d42
  1. 2
      hai-cweb/src/main/resources/dev/application.yml
  2. 60
      hai-schedule/src/main/java/com/hai/schedule/SynchronizeCNPC.java
  3. 138
      hai-service/src/main/java/com/hai/dao/BsResourceMapper.java
  4. 7
      hai-service/src/main/java/com/hai/dao/BsResourceMapperExt.java
  5. 374
      hai-service/src/main/java/com/hai/dao/BsResourceSqlProvider.java
  6. 15
      hai-service/src/main/java/com/hai/dao/HighOrderMapper.java
  7. 4
      hai-service/src/main/java/com/hai/dao/HighOrderSqlProvider.java
  8. 283
      hai-service/src/main/java/com/hai/entity/BsResource.java
  9. 1183
      hai-service/src/main/java/com/hai/entity/BsResourceExample.java
  10. 8
      hai-service/src/main/java/com/hai/entity/HighOrder.java

@ -9,7 +9,7 @@ debug: false
#datasource数据源设置
spring:
datasource:
url: jdbc:mysql://122.9.135.148:3306/hsg?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false
url: jdbc:mysql://139.159.177.244:3306/hfkj?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false
username: root
password: HF123456.
type: com.alibaba.druid.pool.DruidDataSource

@ -147,6 +147,66 @@ public class SynchronizeCNPC {
}
}
/*@Scheduled(cron="0 0/1 * * * ?") //每5分钟执行一次
public void certification3(){
List<SecSinopecConfig> sinopecConfig = secSinopecConfigService.getListSinopecConfig(new HashMap<>());
for (SecSinopecConfig config : sinopecConfig) {
Map<String, Object> tokenMap = new HashMap<>();
tokenMap.put("appId", config.getAppId());
tokenMap.put("appSecret", config.getAppSecret());
JSONObject jsonObject = HttpsUtils.doPost("https://app.zshcqsy.com/api-provider/api/open/merchant/token", JSON.toJSONString(tokenMap));
if (jsonObject != null && jsonObject.getBoolean("success") == true) {
JSONObject data = jsonObject.getJSONObject("data");
String token = data.getString("token");
Calendar instance = Calendar.getInstance();
instance.set(Calendar.MONTH, 9);
instance.set(Calendar.DAY_OF_MONTH, 9);
instance.set(Calendar.HOUR_OF_DAY, 00);
instance.set(Calendar.MINUTE, 00);
instance.set(Calendar.SECOND, 00);
//instance.add(Calendar.MINUTE, -15);
Calendar endTime = Calendar.getInstance();
endTime.set(Calendar.MONTH, 9);
endTime.set(Calendar.DAY_OF_MONTH, 9);
endTime.set(Calendar.HOUR_OF_DAY, 23);
endTime.set(Calendar.MINUTE, 59);
endTime.set(Calendar.SECOND, 59);
Map<String,Object> bodyMap = new HashMap<>();
bodyMap.put("appId", config.getAppId());
bodyMap.put("pageNo", 1);
bodyMap.put("pageSize", 10000);
bodyMap.put("startTime", instance.getTime());
bodyMap.put("endTime", new Date().getTime());
bodyMap.put("customerCode", config.getCode());
Long date = new Date().getTime();
String sha256 = encodeBySHA256(config.getSignkey() + JSON.toJSONString(bodyMap) + date);
JSONObject object = HttpsUtils.doPost("https://app.zshcqsy.com/api-provider/sapapi/open/coupon/customerRedeemcodeList", JSON.toJSONString(bodyMap), token, sha256, date);
System.out.println(object.toJSONString());
//JSONObject object = JSONObject.parseObject("{\"code\":1000,\"data\":{\"pageNo\":1,\"pageSize\":100,\"rowCount\":\"2\",\"list\":[{\"nodeName\":\"中国石油化工股份有限公司重庆江南石油分公司大学城南二路加油加\",\"totalAmount\":150.00,\"codeId\":\"01DIhbtPzIghPP0mPWaWzO13\",\"nodeNo\":\"50000105\",\"name\":\"重庆惠昕石化有限责任公司11.02日150元券\",\"useTime\":\"2021-04-03 06:11:14\"},{\"nodeName\":\"中国石化销售有限公司重庆三峡分公司忠县经营部三台加油站\",\"totalAmount\":100.00,\"codeId\":\"201126141728001027\",\"nodeNo\":\"50000238\",\"name\":\"重庆惠昕石化有限责任公司11.26日100元券\",\"useTime\":\"2021-04-03 15:16:03\"}]},\"success\":true}");
if(Objects.equals(object.get("success"), true)) {
Object dataJson = JSONObject.parse(JSONObject.toJSONString(object.get("data")));
JSONObject dataObject = JSON.parseObject(JSONObject.toJSONString(dataJson));
JSONArray list = dataObject.getJSONArray("list");
for (Object dataJsonObject : list) {
try {
JSONObject parseObject = JSON.parseObject(JSON.toJSONString(dataJsonObject));
String codeId = parseObject.getString("codeId");
String nodeName = parseObject.getString("nodeName");
Date useTime = DateUtil.format(parseObject.getString("useTime"), "yyyy-MM-dd HH:mm:ss");
highCouponCodeService.cnpcCallbackCouponCode(codeId, useTime, nodeName);
} catch (Exception e) {
}
}
}
}
}
}*/
/* @Scheduled(cron="0 0/1 * * * ?") //每1分钟执行一次
public void certification3() {

@ -0,0 +1,138 @@
package com.hai.dao;
import com.hai.entity.BsResource;
import com.hai.entity.BsResourceExample;
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 BsResourceMapper extends BsResourceMapperExt {
@SelectProvider(type=BsResourceSqlProvider.class, method="countByExample")
long countByExample(BsResourceExample example);
@DeleteProvider(type=BsResourceSqlProvider.class, method="deleteByExample")
int deleteByExample(BsResourceExample example);
@Delete({
"delete from bs_resource",
"where id = #{id,jdbcType=BIGINT}"
})
int deleteByPrimaryKey(Long id);
@Insert({
"insert into bs_resource (folder_id, res_type, ",
"cover_picture, `name`, ",
"res_size, res_duration, ",
"res_url, `status`, ",
"create_time, quote_status, ",
"op_id, ext_1, ext_2, ",
"ext_3)",
"values (#{folderId,jdbcType=BIGINT}, #{resType,jdbcType=INTEGER}, ",
"#{coverPicture,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, ",
"#{resSize,jdbcType=REAL}, #{resDuration,jdbcType=INTEGER}, ",
"#{resUrl,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ",
"#{createTime,jdbcType=TIMESTAMP}, #{quoteStatus,jdbcType=INTEGER}, ",
"#{opId,jdbcType=BIGINT}, #{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, ",
"#{ext3,jdbcType=VARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(BsResource record);
@InsertProvider(type=BsResourceSqlProvider.class, method="insertSelective")
@Options(useGeneratedKeys=true,keyProperty="id")
int insertSelective(BsResource record);
@SelectProvider(type=BsResourceSqlProvider.class, method="selectByExample")
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="folder_id", property="folderId", jdbcType=JdbcType.BIGINT),
@Result(column="res_type", property="resType", jdbcType=JdbcType.INTEGER),
@Result(column="cover_picture", property="coverPicture", jdbcType=JdbcType.VARCHAR),
@Result(column="name", property="name", jdbcType=JdbcType.VARCHAR),
@Result(column="res_size", property="resSize", jdbcType=JdbcType.REAL),
@Result(column="res_duration", property="resDuration", jdbcType=JdbcType.INTEGER),
@Result(column="res_url", property="resUrl", jdbcType=JdbcType.VARCHAR),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="quote_status", property="quoteStatus", jdbcType=JdbcType.INTEGER),
@Result(column="op_id", property="opId", jdbcType=JdbcType.BIGINT),
@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<BsResource> selectByExample(BsResourceExample example);
@Select({
"select",
"id, folder_id, res_type, cover_picture, `name`, res_size, res_duration, res_url, ",
"`status`, create_time, quote_status, op_id, ext_1, ext_2, ext_3",
"from bs_resource",
"where id = #{id,jdbcType=BIGINT}"
})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="folder_id", property="folderId", jdbcType=JdbcType.BIGINT),
@Result(column="res_type", property="resType", jdbcType=JdbcType.INTEGER),
@Result(column="cover_picture", property="coverPicture", jdbcType=JdbcType.VARCHAR),
@Result(column="name", property="name", jdbcType=JdbcType.VARCHAR),
@Result(column="res_size", property="resSize", jdbcType=JdbcType.REAL),
@Result(column="res_duration", property="resDuration", jdbcType=JdbcType.INTEGER),
@Result(column="res_url", property="resUrl", jdbcType=JdbcType.VARCHAR),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="quote_status", property="quoteStatus", jdbcType=JdbcType.INTEGER),
@Result(column="op_id", property="opId", jdbcType=JdbcType.BIGINT),
@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)
})
BsResource selectByPrimaryKey(Long id);
@UpdateProvider(type=BsResourceSqlProvider.class, method="updateByExampleSelective")
int updateByExampleSelective(@Param("record") BsResource record, @Param("example") BsResourceExample example);
@UpdateProvider(type=BsResourceSqlProvider.class, method="updateByExample")
int updateByExample(@Param("record") BsResource record, @Param("example") BsResourceExample example);
@UpdateProvider(type=BsResourceSqlProvider.class, method="updateByPrimaryKeySelective")
int updateByPrimaryKeySelective(BsResource record);
@Update({
"update bs_resource",
"set folder_id = #{folderId,jdbcType=BIGINT},",
"res_type = #{resType,jdbcType=INTEGER},",
"cover_picture = #{coverPicture,jdbcType=VARCHAR},",
"`name` = #{name,jdbcType=VARCHAR},",
"res_size = #{resSize,jdbcType=REAL},",
"res_duration = #{resDuration,jdbcType=INTEGER},",
"res_url = #{resUrl,jdbcType=VARCHAR},",
"`status` = #{status,jdbcType=INTEGER},",
"create_time = #{createTime,jdbcType=TIMESTAMP},",
"quote_status = #{quoteStatus,jdbcType=INTEGER},",
"op_id = #{opId,jdbcType=BIGINT},",
"ext_1 = #{ext1,jdbcType=VARCHAR},",
"ext_2 = #{ext2,jdbcType=VARCHAR},",
"ext_3 = #{ext3,jdbcType=VARCHAR}",
"where id = #{id,jdbcType=BIGINT}"
})
int updateByPrimaryKey(BsResource record);
}

@ -0,0 +1,7 @@
package com.hai.dao;
/**
* mapper扩展类
*/
public interface BsResourceMapperExt {
}

@ -0,0 +1,374 @@
package com.hai.dao;
import com.hai.entity.BsResource;
import com.hai.entity.BsResourceExample.Criteria;
import com.hai.entity.BsResourceExample.Criterion;
import com.hai.entity.BsResourceExample;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.jdbc.SQL;
public class BsResourceSqlProvider {
public String countByExample(BsResourceExample example) {
SQL sql = new SQL();
sql.SELECT("count(*)").FROM("bs_resource");
applyWhere(sql, example, false);
return sql.toString();
}
public String deleteByExample(BsResourceExample example) {
SQL sql = new SQL();
sql.DELETE_FROM("bs_resource");
applyWhere(sql, example, false);
return sql.toString();
}
public String insertSelective(BsResource record) {
SQL sql = new SQL();
sql.INSERT_INTO("bs_resource");
if (record.getFolderId() != null) {
sql.VALUES("folder_id", "#{folderId,jdbcType=BIGINT}");
}
if (record.getResType() != null) {
sql.VALUES("res_type", "#{resType,jdbcType=INTEGER}");
}
if (record.getCoverPicture() != null) {
sql.VALUES("cover_picture", "#{coverPicture,jdbcType=VARCHAR}");
}
if (record.getName() != null) {
sql.VALUES("`name`", "#{name,jdbcType=VARCHAR}");
}
if (record.getResSize() != null) {
sql.VALUES("res_size", "#{resSize,jdbcType=REAL}");
}
if (record.getResDuration() != null) {
sql.VALUES("res_duration", "#{resDuration,jdbcType=INTEGER}");
}
if (record.getResUrl() != null) {
sql.VALUES("res_url", "#{resUrl,jdbcType=VARCHAR}");
}
if (record.getStatus() != null) {
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}");
}
if (record.getCreateTime() != null) {
sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}");
}
if (record.getQuoteStatus() != null) {
sql.VALUES("quote_status", "#{quoteStatus,jdbcType=INTEGER}");
}
if (record.getOpId() != null) {
sql.VALUES("op_id", "#{opId,jdbcType=BIGINT}");
}
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(BsResourceExample example) {
SQL sql = new SQL();
if (example != null && example.isDistinct()) {
sql.SELECT_DISTINCT("id");
} else {
sql.SELECT("id");
}
sql.SELECT("folder_id");
sql.SELECT("res_type");
sql.SELECT("cover_picture");
sql.SELECT("`name`");
sql.SELECT("res_size");
sql.SELECT("res_duration");
sql.SELECT("res_url");
sql.SELECT("`status`");
sql.SELECT("create_time");
sql.SELECT("quote_status");
sql.SELECT("op_id");
sql.SELECT("ext_1");
sql.SELECT("ext_2");
sql.SELECT("ext_3");
sql.FROM("bs_resource");
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) {
BsResource record = (BsResource) parameter.get("record");
BsResourceExample example = (BsResourceExample) parameter.get("example");
SQL sql = new SQL();
sql.UPDATE("bs_resource");
if (record.getId() != null) {
sql.SET("id = #{record.id,jdbcType=BIGINT}");
}
if (record.getFolderId() != null) {
sql.SET("folder_id = #{record.folderId,jdbcType=BIGINT}");
}
if (record.getResType() != null) {
sql.SET("res_type = #{record.resType,jdbcType=INTEGER}");
}
if (record.getCoverPicture() != null) {
sql.SET("cover_picture = #{record.coverPicture,jdbcType=VARCHAR}");
}
if (record.getName() != null) {
sql.SET("`name` = #{record.name,jdbcType=VARCHAR}");
}
if (record.getResSize() != null) {
sql.SET("res_size = #{record.resSize,jdbcType=REAL}");
}
if (record.getResDuration() != null) {
sql.SET("res_duration = #{record.resDuration,jdbcType=INTEGER}");
}
if (record.getResUrl() != null) {
sql.SET("res_url = #{record.resUrl,jdbcType=VARCHAR}");
}
if (record.getStatus() != null) {
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
}
if (record.getCreateTime() != null) {
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
}
if (record.getQuoteStatus() != null) {
sql.SET("quote_status = #{record.quoteStatus,jdbcType=INTEGER}");
}
if (record.getOpId() != null) {
sql.SET("op_id = #{record.opId,jdbcType=BIGINT}");
}
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("bs_resource");
sql.SET("id = #{record.id,jdbcType=BIGINT}");
sql.SET("folder_id = #{record.folderId,jdbcType=BIGINT}");
sql.SET("res_type = #{record.resType,jdbcType=INTEGER}");
sql.SET("cover_picture = #{record.coverPicture,jdbcType=VARCHAR}");
sql.SET("`name` = #{record.name,jdbcType=VARCHAR}");
sql.SET("res_size = #{record.resSize,jdbcType=REAL}");
sql.SET("res_duration = #{record.resDuration,jdbcType=INTEGER}");
sql.SET("res_url = #{record.resUrl,jdbcType=VARCHAR}");
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
sql.SET("quote_status = #{record.quoteStatus,jdbcType=INTEGER}");
sql.SET("op_id = #{record.opId,jdbcType=BIGINT}");
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}");
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}");
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}");
BsResourceExample example = (BsResourceExample) parameter.get("example");
applyWhere(sql, example, true);
return sql.toString();
}
public String updateByPrimaryKeySelective(BsResource record) {
SQL sql = new SQL();
sql.UPDATE("bs_resource");
if (record.getFolderId() != null) {
sql.SET("folder_id = #{folderId,jdbcType=BIGINT}");
}
if (record.getResType() != null) {
sql.SET("res_type = #{resType,jdbcType=INTEGER}");
}
if (record.getCoverPicture() != null) {
sql.SET("cover_picture = #{coverPicture,jdbcType=VARCHAR}");
}
if (record.getName() != null) {
sql.SET("`name` = #{name,jdbcType=VARCHAR}");
}
if (record.getResSize() != null) {
sql.SET("res_size = #{resSize,jdbcType=REAL}");
}
if (record.getResDuration() != null) {
sql.SET("res_duration = #{resDuration,jdbcType=INTEGER}");
}
if (record.getResUrl() != null) {
sql.SET("res_url = #{resUrl,jdbcType=VARCHAR}");
}
if (record.getStatus() != null) {
sql.SET("`status` = #{status,jdbcType=INTEGER}");
}
if (record.getCreateTime() != null) {
sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}");
}
if (record.getQuoteStatus() != null) {
sql.SET("quote_status = #{quoteStatus,jdbcType=INTEGER}");
}
if (record.getOpId() != null) {
sql.SET("op_id = #{opId,jdbcType=BIGINT}");
}
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, BsResourceExample 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());
}
}
}

@ -7,6 +7,7 @@ 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;
@ -38,9 +39,9 @@ public interface HighOrderMapper extends HighOrderMapperExt {
int deleteByPrimaryKey(Long id);
@Insert({
"insert into high_order (id, order_no, ",
"mem_discount_id, mem_discount_name, ",
"mem_id, mem_name, mem_phone, ",
"insert into high_order (order_no, mem_discount_id, ",
"mem_discount_name, mem_id, ",
"mem_name, mem_phone, ",
"mem_card_id, mem_card_type, ",
"mem_card_no, pay_model, ",
"pay_type, pay_gold, ",
@ -54,9 +55,9 @@ public interface HighOrderMapper extends HighOrderMapperExt {
"refund_content, refusal_refund_content, ",
"Identification_code, ext_1, ",
"ext_2, ext_3)",
"values (#{id,jdbcType=BIGINT}, #{orderNo,jdbcType=VARCHAR}, ",
"#{memDiscountId,jdbcType=BIGINT}, #{memDiscountName,jdbcType=VARCHAR}, ",
"#{memId,jdbcType=BIGINT}, #{memName,jdbcType=VARCHAR}, #{memPhone,jdbcType=VARCHAR}, ",
"values (#{orderNo,jdbcType=VARCHAR}, #{memDiscountId,jdbcType=BIGINT}, ",
"#{memDiscountName,jdbcType=VARCHAR}, #{memId,jdbcType=BIGINT}, ",
"#{memName,jdbcType=VARCHAR}, #{memPhone,jdbcType=VARCHAR}, ",
"#{memCardId,jdbcType=BIGINT}, #{memCardType,jdbcType=INTEGER}, ",
"#{memCardNo,jdbcType=VARCHAR}, #{payModel,jdbcType=INTEGER}, ",
"#{payType,jdbcType=INTEGER}, #{payGold,jdbcType=INTEGER}, ",
@ -71,9 +72,11 @@ public interface HighOrderMapper extends HighOrderMapperExt {
"#{identificationCode,jdbcType=BIGINT}, #{ext1,jdbcType=VARCHAR}, ",
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(HighOrder record);
@InsertProvider(type=HighOrderSqlProvider.class, method="insertSelective")
@Options(useGeneratedKeys=true,keyProperty="id")
int insertSelective(HighOrder record);
@SelectProvider(type=HighOrderSqlProvider.class, method="selectByExample")

@ -28,10 +28,6 @@ public class HighOrderSqlProvider {
SQL sql = new SQL();
sql.INSERT_INTO("high_order");
if (record.getId() != null) {
sql.VALUES("id", "#{id,jdbcType=BIGINT}");
}
if (record.getOrderNo() != null) {
sql.VALUES("order_no", "#{orderNo,jdbcType=VARCHAR}");
}

@ -0,0 +1,283 @@
package com.hai.entity;
import java.io.Serializable;
import java.util.Date;
/**
* bs_resource
* @author
*/
/**
*
* 代码由工具生成
*
**/
public class BsResource implements Serializable {
/**
* 主键ID
*/
private Long id;
/**
* 分组id
*/
private Long folderId;
/**
* 素材类型 1图片 2视频 3电子书 4音频
*/
private Integer resType;
/**
* 封面图
*/
private String coverPicture;
/**
* 素材名称
*/
private String name;
/**
* 素材大小
*/
private Float resSize;
/**
* 视频时长
*/
private Integer resDuration;
/**
* 素材地址
*/
private String resUrl;
/**
* 状态 0删除 1可用
*/
private Integer status;
/**
* 上传时间
*/
private Date createTime;
/**
* 是否引用 0未引用 1已引用
*/
private Integer quoteStatus;
/**
* 操作人
*/
private Long opId;
/**
* ext_1
*/
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 getFolderId() {
return folderId;
}
public void setFolderId(Long folderId) {
this.folderId = folderId;
}
public Integer getResType() {
return resType;
}
public void setResType(Integer resType) {
this.resType = resType;
}
public String getCoverPicture() {
return coverPicture;
}
public void setCoverPicture(String coverPicture) {
this.coverPicture = coverPicture;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Float getResSize() {
return resSize;
}
public void setResSize(Float resSize) {
this.resSize = resSize;
}
public Integer getResDuration() {
return resDuration;
}
public void setResDuration(Integer resDuration) {
this.resDuration = resDuration;
}
public String getResUrl() {
return resUrl;
}
public void setResUrl(String resUrl) {
this.resUrl = resUrl;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Integer getQuoteStatus() {
return quoteStatus;
}
public void setQuoteStatus(Integer quoteStatus) {
this.quoteStatus = quoteStatus;
}
public Long getOpId() {
return opId;
}
public void setOpId(Long opId) {
this.opId = opId;
}
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;
}
BsResource other = (BsResource) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getFolderId() == null ? other.getFolderId() == null : this.getFolderId().equals(other.getFolderId()))
&& (this.getResType() == null ? other.getResType() == null : this.getResType().equals(other.getResType()))
&& (this.getCoverPicture() == null ? other.getCoverPicture() == null : this.getCoverPicture().equals(other.getCoverPicture()))
&& (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
&& (this.getResSize() == null ? other.getResSize() == null : this.getResSize().equals(other.getResSize()))
&& (this.getResDuration() == null ? other.getResDuration() == null : this.getResDuration().equals(other.getResDuration()))
&& (this.getResUrl() == null ? other.getResUrl() == null : this.getResUrl().equals(other.getResUrl()))
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getQuoteStatus() == null ? other.getQuoteStatus() == null : this.getQuoteStatus().equals(other.getQuoteStatus()))
&& (this.getOpId() == null ? other.getOpId() == null : this.getOpId().equals(other.getOpId()))
&& (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 + ((getFolderId() == null) ? 0 : getFolderId().hashCode());
result = prime * result + ((getResType() == null) ? 0 : getResType().hashCode());
result = prime * result + ((getCoverPicture() == null) ? 0 : getCoverPicture().hashCode());
result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
result = prime * result + ((getResSize() == null) ? 0 : getResSize().hashCode());
result = prime * result + ((getResDuration() == null) ? 0 : getResDuration().hashCode());
result = prime * result + ((getResUrl() == null) ? 0 : getResUrl().hashCode());
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getQuoteStatus() == null) ? 0 : getQuoteStatus().hashCode());
result = prime * result + ((getOpId() == null) ? 0 : getOpId().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(", folderId=").append(folderId);
sb.append(", resType=").append(resType);
sb.append(", coverPicture=").append(coverPicture);
sb.append(", name=").append(name);
sb.append(", resSize=").append(resSize);
sb.append(", resDuration=").append(resDuration);
sb.append(", resUrl=").append(resUrl);
sb.append(", status=").append(status);
sb.append(", createTime=").append(createTime);
sb.append(", quoteStatus=").append(quoteStatus);
sb.append(", opId=").append(opId);
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();
}
}

@ -175,8 +175,6 @@ public class HighOrder implements Serializable {
private HighDiscount highDiscount;
private static final long serialVersionUID = 1L;
public List<HighChildOrder> getHighChildOrderList() {
return highChildOrderList;
}
@ -193,9 +191,7 @@ public class HighOrder implements Serializable {
this.highDiscount = highDiscount;
}
public static long getSerialVersionUID() {
return serialVersionUID;
}
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
@ -591,4 +587,4 @@ public class HighOrder implements Serializable {
sb.append("]");
return sb.toString();
}
}
}

Loading…
Cancel
Save