From e5c17730ca75d836a5bcf692515f6698c6099e5c Mon Sep 17 00:00:00 2001 From: Sum1Dream <418471657@qq.com> Date: Tue, 10 Jan 2023 17:30:08 +0800 Subject: [PATCH] Merge branch 'dev_yy' into 2.0-dev MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * dev_yy: (25 commits) 提交代理商 1 1 提交实物 提交代码 提交代码 提交代码 提交抽奖代码 1 提交代码 提交代码 提交代码 提交代码 提交代码 提交 1 1 修改首页没有积分专区 提交代码 修改小程序注册用券 ... # Conflicts: # hai-cweb/src/main/java/com/cweb/controller/HighTestController.java # hai-service/src/main/java/com/hai/common/utils/DateUtil.java # hai-service/src/main/java/com/hai/common/utils/RequestUtils.java # hai-service/src/main/java/com/hai/dao/HighChildOrderMapper.java # hai-service/src/main/java/com/hai/dao/HighChildOrderSqlProvider.java # hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java # hai-service/src/main/java/com/hai/entity/HighChildOrder.java # hai-service/src/main/java/com/hai/entity/HighChildOrderExample.java # hai-service/src/main/java/com/hai/entity/HighOrder.java # hai-service/src/main/java/com/hai/entity/OutRechargeOrder.java # hai-service/src/main/java/com/hai/service/HighUserService.java # hai-service/src/main/java/com/hai/service/OutRechargeOrderService.java # hai-service/src/main/java/com/hai/service/impl/BsDistributionUserRelServiceImpl.java # hai-service/src/main/java/com/hai/service/impl/HighUserServiceImpl.java # hai-service/src/main/java/com/hai/service/impl/OutRechargeOrderServiceImpl.java --- .../java/com/hai/dao/ApiIpAddressMapper.java | 108 +++++++ .../com/hai/dao/ApiIpAddressMapperExt.java | 4 + .../com/hai/dao/ApiIpAddressSqlProvider.java | 276 ++++++++++++++++++ 3 files changed, 388 insertions(+) create mode 100644 hai-service/src/main/java/com/hai/dao/ApiIpAddressMapper.java create mode 100644 hai-service/src/main/java/com/hai/dao/ApiIpAddressMapperExt.java create mode 100644 hai-service/src/main/java/com/hai/dao/ApiIpAddressSqlProvider.java diff --git a/hai-service/src/main/java/com/hai/dao/ApiIpAddressMapper.java b/hai-service/src/main/java/com/hai/dao/ApiIpAddressMapper.java new file mode 100644 index 00000000..65e45a13 --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/ApiIpAddressMapper.java @@ -0,0 +1,108 @@ +package com.hai.dao; + +import com.hai.entity.ApiIpAddress; +import com.hai.entity.ApiIpAddressExample; +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 ApiIpAddressMapper extends ApiIpAddressMapperExt { + @SelectProvider(type=ApiIpAddressSqlProvider.class, method="countByExample") + long countByExample(ApiIpAddressExample example); + + @DeleteProvider(type=ApiIpAddressSqlProvider.class, method="deleteByExample") + int deleteByExample(ApiIpAddressExample example); + + @Delete({ + "delete from api_ip_address", + "where id = #{id,jdbcType=BIGINT}" + }) + int deleteByPrimaryKey(Long id); + + @Insert({ + "insert into api_ip_address (ip_address, mch_id, ", + "create_time, update_time, ", + "ext_1, ext_2, ext_3)", + "values (#{ipAddress,jdbcType=VARCHAR}, #{mchId,jdbcType=VARCHAR}, ", + "#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ", + "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" + }) + @Options(useGeneratedKeys=true,keyProperty="id") + int insert(ApiIpAddress record); + + @InsertProvider(type=ApiIpAddressSqlProvider.class, method="insertSelective") + @Options(useGeneratedKeys=true,keyProperty="id") + int insertSelective(ApiIpAddress record); + + @SelectProvider(type=ApiIpAddressSqlProvider.class, method="selectByExample") + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="ip_address", property="ipAddress", jdbcType=JdbcType.VARCHAR), + @Result(column="mch_id", property="mchId", jdbcType=JdbcType.VARCHAR), + @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), + @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 selectByExample(ApiIpAddressExample example); + + @Select({ + "select", + "id, ip_address, mch_id, create_time, update_time, ext_1, ext_2, ext_3", + "from api_ip_address", + "where id = #{id,jdbcType=BIGINT}" + }) + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="ip_address", property="ipAddress", jdbcType=JdbcType.VARCHAR), + @Result(column="mch_id", property="mchId", jdbcType=JdbcType.VARCHAR), + @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), + @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) + }) + ApiIpAddress selectByPrimaryKey(Long id); + + @UpdateProvider(type=ApiIpAddressSqlProvider.class, method="updateByExampleSelective") + int updateByExampleSelective(@Param("record") ApiIpAddress record, @Param("example") ApiIpAddressExample example); + + @UpdateProvider(type=ApiIpAddressSqlProvider.class, method="updateByExample") + int updateByExample(@Param("record") ApiIpAddress record, @Param("example") ApiIpAddressExample example); + + @UpdateProvider(type=ApiIpAddressSqlProvider.class, method="updateByPrimaryKeySelective") + int updateByPrimaryKeySelective(ApiIpAddress record); + + @Update({ + "update api_ip_address", + "set ip_address = #{ipAddress,jdbcType=VARCHAR},", + "mch_id = #{mchId,jdbcType=VARCHAR},", + "create_time = #{createTime,jdbcType=TIMESTAMP},", + "update_time = #{updateTime,jdbcType=TIMESTAMP},", + "ext_1 = #{ext1,jdbcType=VARCHAR},", + "ext_2 = #{ext2,jdbcType=VARCHAR},", + "ext_3 = #{ext3,jdbcType=VARCHAR}", + "where id = #{id,jdbcType=BIGINT}" + }) + int updateByPrimaryKey(ApiIpAddress record); +} diff --git a/hai-service/src/main/java/com/hai/dao/ApiIpAddressMapperExt.java b/hai-service/src/main/java/com/hai/dao/ApiIpAddressMapperExt.java new file mode 100644 index 00000000..28cd66fb --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/ApiIpAddressMapperExt.java @@ -0,0 +1,4 @@ +package com.hai.dao; + +public interface ApiIpAddressMapperExt { +} diff --git a/hai-service/src/main/java/com/hai/dao/ApiIpAddressSqlProvider.java b/hai-service/src/main/java/com/hai/dao/ApiIpAddressSqlProvider.java new file mode 100644 index 00000000..98dc4265 --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/ApiIpAddressSqlProvider.java @@ -0,0 +1,276 @@ +package com.hai.dao; + +import com.hai.entity.ApiIpAddress; +import com.hai.entity.ApiIpAddressExample.Criteria; +import com.hai.entity.ApiIpAddressExample.Criterion; +import com.hai.entity.ApiIpAddressExample; +import java.util.List; +import java.util.Map; +import org.apache.ibatis.jdbc.SQL; + +public class ApiIpAddressSqlProvider { + + public String countByExample(ApiIpAddressExample example) { + SQL sql = new SQL(); + sql.SELECT("count(*)").FROM("api_ip_address"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String deleteByExample(ApiIpAddressExample example) { + SQL sql = new SQL(); + sql.DELETE_FROM("api_ip_address"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String insertSelective(ApiIpAddress record) { + SQL sql = new SQL(); + sql.INSERT_INTO("api_ip_address"); + + if (record.getIpAddress() != null) { + sql.VALUES("ip_address", "#{ipAddress,jdbcType=VARCHAR}"); + } + + if (record.getMchId() != null) { + sql.VALUES("mch_id", "#{mchId,jdbcType=VARCHAR}"); + } + + if (record.getCreateTime() != null) { + sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}"); + } + + if (record.getUpdateTime() != null) { + sql.VALUES("update_time", "#{updateTime,jdbcType=TIMESTAMP}"); + } + + 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(ApiIpAddressExample example) { + SQL sql = new SQL(); + if (example != null && example.isDistinct()) { + sql.SELECT_DISTINCT("id"); + } else { + sql.SELECT("id"); + } + sql.SELECT("ip_address"); + sql.SELECT("mch_id"); + sql.SELECT("create_time"); + sql.SELECT("update_time"); + sql.SELECT("ext_1"); + sql.SELECT("ext_2"); + sql.SELECT("ext_3"); + sql.FROM("api_ip_address"); + applyWhere(sql, example, false); + + if (example != null && example.getOrderByClause() != null) { + sql.ORDER_BY(example.getOrderByClause()); + } + + return sql.toString(); + } + + public String updateByExampleSelective(Map parameter) { + ApiIpAddress record = (ApiIpAddress) parameter.get("record"); + ApiIpAddressExample example = (ApiIpAddressExample) parameter.get("example"); + + SQL sql = new SQL(); + sql.UPDATE("api_ip_address"); + + if (record.getId() != null) { + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + } + + if (record.getIpAddress() != null) { + sql.SET("ip_address = #{record.ipAddress,jdbcType=VARCHAR}"); + } + + if (record.getMchId() != null) { + sql.SET("mch_id = #{record.mchId,jdbcType=VARCHAR}"); + } + + 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.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 parameter) { + SQL sql = new SQL(); + sql.UPDATE("api_ip_address"); + + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + sql.SET("ip_address = #{record.ipAddress,jdbcType=VARCHAR}"); + sql.SET("mch_id = #{record.mchId,jdbcType=VARCHAR}"); + sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); + sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); + sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); + sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); + sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); + + ApiIpAddressExample example = (ApiIpAddressExample) parameter.get("example"); + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByPrimaryKeySelective(ApiIpAddress record) { + SQL sql = new SQL(); + sql.UPDATE("api_ip_address"); + + if (record.getIpAddress() != null) { + sql.SET("ip_address = #{ipAddress,jdbcType=VARCHAR}"); + } + + if (record.getMchId() != null) { + sql.SET("mch_id = #{mchId,jdbcType=VARCHAR}"); + } + + if (record.getCreateTime() != null) { + sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}"); + } + + if (record.getUpdateTime() != null) { + sql.SET("update_time = #{updateTime,jdbcType=TIMESTAMP}"); + } + + 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, ApiIpAddressExample 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 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 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()); + } + } +}