diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighMerStoreAmountController.java b/hai-bweb/src/main/java/com/bweb/controller/HighMerStoreAmountController.java new file mode 100644 index 00000000..c08ef7f4 --- /dev/null +++ b/hai-bweb/src/main/java/com/bweb/controller/HighMerStoreAmountController.java @@ -0,0 +1,165 @@ +package com.bweb.controller; + +import com.alibaba.fastjson.JSONObject; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.hai.common.exception.ErrorCode; +import com.hai.common.exception.ErrorHelp; +import com.hai.common.exception.SysCode; +import com.hai.common.security.AESEncodeUtil; +import com.hai.common.security.UserCenter; +import com.hai.common.utils.RedisUtil; +import com.hai.common.utils.ResponseMsgUtil; +import com.hai.entity.HighCompanyAccount; +import com.hai.entity.HighCompanyTwoPwd; +import com.hai.entity.HighMerchantStoreAccount; +import com.hai.enum_type.CompanyAmountSourceTypeEnum; +import com.hai.enum_type.MerStoreAmountSourceTypeEnum; +import com.hai.enum_type.MerStoreAmountTypeEnum; +import com.hai.model.ResponseData; +import com.hai.model.UserInfoModel; +import com.hai.service.*; +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.dao.DeadlockLoserDataAccessException; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.Map; + +@Controller +@RequestMapping(value = "/merStoreAccount") +@Api(value = "商户门店接口") +public class HighMerStoreAmountController { + + private static Logger log = LoggerFactory.getLogger(HighMerStoreAmountController.class); + + @Resource + private HighMerchantStoreAccountService merchantStoreAccountService; + + @Resource + private HighMerchantStoreAccountRecordService merchantStoreAccountRecordService; + + @Resource + private HighCompanyTwoPwdService companyTwoPwdService; + + @Resource + private UserCenter userCenter; + + @RequestMapping(value = "/recharge", method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "余额充值") + public synchronized ResponseData recharge(@RequestBody JSONObject body) { + try { + UserInfoModel userInfoModel = userCenter.getSessionModel(UserInfoModel.class); + if (userInfoModel == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.SEC_USER_EXPIRED, ""); + } + if (userInfoModel.getBsCompany() == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.SEC_USER_EXPIRED, ""); + } + + if (body.getLong("storeId") == null + || body.getBigDecimal("amount") == null + || StringUtils.isBlank(body.getString("twoPwd"))) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + if (body.getBigDecimal("amount").compareTo(new BigDecimal("0")) == -1) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "充值金额不能小于0"); + } + // 查询二级密码 + HighCompanyTwoPwd pwdByOrg = companyTwoPwdService.getTwoPwdByOrg(userInfoModel.getBsOrganization().getId()); + if (pwdByOrg == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_FOUND_TOW_PWD, ""); + } + if (!AESEncodeUtil.aesEncrypt(body.getString("twoPwd")).equals(pwdByOrg.getPassword())) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "支付密码错误"); + } + + Map map = new HashMap<>(); + map.put("sourceType", MerStoreAmountSourceTypeEnum.type1.getType()); + map.put("sourceContent", "充值额度:" + body.getBigDecimal("amount") + " 元"); + merchantStoreAccountService.recharge(body.getLong("storeId"), body.getBigDecimal("amount"), map); + + return ResponseMsgUtil.success("操作成功"); + + } catch (DeadlockLoserDataAccessException deadlockLoserDataAccessException) { + log.error("HighActivityController -> userLottery() error!", "服务器繁忙"); + return ResponseMsgUtil.builderResponse(ErrorCode.SERVER_BUSY_ERROR.getCode(),ErrorCode.SERVER_BUSY_ERROR.getMsg(),null); + + } catch (Exception e) { + log.error("HighCompanyAmountController --> recharge() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/getAccountRecordList", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询账户记录列表") + public ResponseData getAccountRecordList(@RequestParam(name = "type", required = false) Integer type, + @RequestParam(name = "sourceType", required = false) Integer sourceType, + @RequestParam(name = "createTimeS", required = false) Long createTimeS, + @RequestParam(name = "createTimeE", required = false) Long createTimeE, + @RequestParam(name = "pageNum", required = true) Integer pageNum, + @RequestParam(name = "pageSize", required = true) Integer pageSize) { + try { + UserInfoModel userInfoModel = userCenter.getSessionModel(UserInfoModel.class); + if (userInfoModel == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.SEC_USER_EXPIRED, ""); + } + if (userInfoModel.getMerchantStore() == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.SEC_USER_EXPIRED, ""); + } + + Map param = new HashMap<>(); + param.put("storeId", userInfoModel.getMerchantStore().getId()); + param.put("type", type); + param.put("sourceType", sourceType); + param.put("createTimeS", createTimeS); + param.put("createTimeE", createTimeE); + + PageHelper.startPage(pageNum, pageSize); + return ResponseMsgUtil.success(new PageInfo<>(merchantStoreAccountRecordService.getRecordList(param))); + + } catch (Exception e) { + log.error("HighMerStoreAmountController --> getAccountRecordList() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/getAccount", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询账户") + public ResponseData getAccount() { + try { + UserInfoModel userInfoModel = userCenter.getSessionModel(UserInfoModel.class); + if (userInfoModel == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.SEC_USER_EXPIRED, ""); + } + if (userInfoModel.getMerchantStore() == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.SEC_USER_EXPIRED, ""); + } + + Map map = new HashMap<>(); + // 查询公司账户 + HighMerchantStoreAccount account = merchantStoreAccountService.getStoreAccountDetail(userInfoModel.getMerchantStore().getId()); + if (account == null) { + map.put("amounts", 0); + } else { + map.put("amounts", account.getAmounts()); + } + return ResponseMsgUtil.success(map); + + } catch (Exception e) { + log.error("HighMerStoreAmountController --> getAccount() error!", e); + return ResponseMsgUtil.exception(e); + } + } + +} diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighMerchantStoreController.java b/hai-bweb/src/main/java/com/bweb/controller/HighMerchantStoreController.java index cabe8b53..9579ac08 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighMerchantStoreController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighMerchantStoreController.java @@ -83,6 +83,7 @@ public class HighMerchantStoreController { || StringUtils.isBlank(highMerchantStore.getAddress()) || StringUtils.isBlank(highMerchantStore.getLatitude()) || StringUtils.isBlank(highMerchantStore.getLongitude()) + || highMerchantStore.getPrestoreType() == null ) { log.error("HighMerchantStoreController -> insertMerchantStore() error!","参数错误"); throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java b/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java index 469ba1e9..6fb4d9ea 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java @@ -257,9 +257,9 @@ public class HighOrderController { childOrder.setGasPriceVip(priceModel.getPriceVip()); childOrder.setGasPriceOfficial(priceModel.getPriceOfficial()); childOrder.setGasPricePlatform(priceModel.getPricePlatform()); - childOrder.setExt1(priceModel.getPricePlatform().toString()); childOrder.setGasOilLiters(priceModel.getOilLiters()); childOrder.setGasDiscount(priceModel.getDiscount()); + childOrder.setExt1(priceModel.getPricePlatform().toString()); childOrder.setGasOilSubsidy(priceModel.getOilSubsidy()); childOrder.setGasLitersPreferences(priceModel.getLitersPreferences()); childOrder.setGasPricePreferences(priceModel.getPricePreferences()); diff --git a/hai-service/src/main/java/com/hai/dao/HighMerchantStoreAccountMapper.java b/hai-service/src/main/java/com/hai/dao/HighMerchantStoreAccountMapper.java new file mode 100644 index 00000000..d16417fc --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/HighMerchantStoreAccountMapper.java @@ -0,0 +1,117 @@ +package com.hai.dao; + +import com.hai.entity.HighMerchantStoreAccount; +import com.hai.entity.HighMerchantStoreAccountExample; +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 HighMerchantStoreAccountMapper extends HighMerchantStoreAccountMapperExt { + @SelectProvider(type=HighMerchantStoreAccountSqlProvider.class, method="countByExample") + long countByExample(HighMerchantStoreAccountExample example); + + @DeleteProvider(type=HighMerchantStoreAccountSqlProvider.class, method="deleteByExample") + int deleteByExample(HighMerchantStoreAccountExample example); + + @Delete({ + "delete from high_merchant_store_account", + "where id = #{id,jdbcType=BIGINT}" + }) + int deleteByPrimaryKey(Long id); + + @Insert({ + "insert into high_merchant_store_account (store_id, account_no, ", + "amounts, `status`, ", + "create_time, update_time, ", + "ext_1, ext_2, ext_3)", + "values (#{storeId,jdbcType=BIGINT}, #{accountNo,jdbcType=VARCHAR}, ", + "#{amounts,jdbcType=DECIMAL}, #{status,jdbcType=INTEGER}, ", + "#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ", + "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" + }) + @Options(useGeneratedKeys=true,keyProperty="id") + int insert(HighMerchantStoreAccount record); + + @InsertProvider(type=HighMerchantStoreAccountSqlProvider.class, method="insertSelective") + @Options(useGeneratedKeys=true,keyProperty="id") + int insertSelective(HighMerchantStoreAccount record); + + @SelectProvider(type=HighMerchantStoreAccountSqlProvider.class, method="selectByExample") + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="store_id", property="storeId", jdbcType=JdbcType.BIGINT), + @Result(column="account_no", property="accountNo", jdbcType=JdbcType.VARCHAR), + @Result(column="amounts", property="amounts", jdbcType=JdbcType.DECIMAL), + @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), + @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(HighMerchantStoreAccountExample example); + + @Select({ + "select", + "id, store_id, account_no, amounts, `status`, create_time, update_time, ext_1, ", + "ext_2, ext_3", + "from high_merchant_store_account", + "where id = #{id,jdbcType=BIGINT}" + }) + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="store_id", property="storeId", jdbcType=JdbcType.BIGINT), + @Result(column="account_no", property="accountNo", jdbcType=JdbcType.VARCHAR), + @Result(column="amounts", property="amounts", jdbcType=JdbcType.DECIMAL), + @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), + @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) + }) + HighMerchantStoreAccount selectByPrimaryKey(Long id); + + @UpdateProvider(type=HighMerchantStoreAccountSqlProvider.class, method="updateByExampleSelective") + int updateByExampleSelective(@Param("record") HighMerchantStoreAccount record, @Param("example") HighMerchantStoreAccountExample example); + + @UpdateProvider(type=HighMerchantStoreAccountSqlProvider.class, method="updateByExample") + int updateByExample(@Param("record") HighMerchantStoreAccount record, @Param("example") HighMerchantStoreAccountExample example); + + @UpdateProvider(type=HighMerchantStoreAccountSqlProvider.class, method="updateByPrimaryKeySelective") + int updateByPrimaryKeySelective(HighMerchantStoreAccount record); + + @Update({ + "update high_merchant_store_account", + "set store_id = #{storeId,jdbcType=BIGINT},", + "account_no = #{accountNo,jdbcType=VARCHAR},", + "amounts = #{amounts,jdbcType=DECIMAL},", + "`status` = #{status,jdbcType=INTEGER},", + "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(HighMerchantStoreAccount record); +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/dao/HighMerchantStoreAccountMapperExt.java b/hai-service/src/main/java/com/hai/dao/HighMerchantStoreAccountMapperExt.java new file mode 100644 index 00000000..21b18460 --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/HighMerchantStoreAccountMapperExt.java @@ -0,0 +1,7 @@ +package com.hai.dao; + +/** + * mapper扩展类 + */ +public interface HighMerchantStoreAccountMapperExt { +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/dao/HighMerchantStoreAccountRecordMapper.java b/hai-service/src/main/java/com/hai/dao/HighMerchantStoreAccountRecordMapper.java new file mode 100644 index 00000000..6966012f --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/HighMerchantStoreAccountRecordMapper.java @@ -0,0 +1,158 @@ +package com.hai.dao; + +import com.hai.entity.HighMerchantStoreAccountRecord; +import com.hai.entity.HighMerchantStoreAccountRecordExample; +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 HighMerchantStoreAccountRecordMapper extends HighMerchantStoreAccountRecordMapperExt { + @SelectProvider(type=HighMerchantStoreAccountRecordSqlProvider.class, method="countByExample") + long countByExample(HighMerchantStoreAccountRecordExample example); + + @DeleteProvider(type=HighMerchantStoreAccountRecordSqlProvider.class, method="deleteByExample") + int deleteByExample(HighMerchantStoreAccountRecordExample example); + + @Delete({ + "delete from high_merchant_store_account_record", + "where id = #{id,jdbcType=BIGINT}" + }) + int deleteByPrimaryKey(Long id); + + @Insert({ + "insert into high_merchant_store_account_record (store_amount_id, mer_id, ", + "mer_name, store_id, ", + "store_name, `type`, ", + "amount, before_amount, ", + "after_amount, source_type, ", + "source_id, source_content, ", + "`status`, create_time, ", + "op_user_id, op_user_name, ", + "ext_1, ext_2, ext_3)", + "values (#{storeAmountId,jdbcType=BIGINT}, #{merId,jdbcType=BIGINT}, ", + "#{merName,jdbcType=VARCHAR}, #{storeId,jdbcType=BIGINT}, ", + "#{storeName,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER}, ", + "#{amount,jdbcType=DECIMAL}, #{beforeAmount,jdbcType=DECIMAL}, ", + "#{afterAmount,jdbcType=DECIMAL}, #{sourceType,jdbcType=INTEGER}, ", + "#{sourceId,jdbcType=BIGINT}, #{sourceContent,jdbcType=VARCHAR}, ", + "#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ", + "#{opUserId,jdbcType=BIGINT}, #{opUserName,jdbcType=VARCHAR}, ", + "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" + }) + @Options(useGeneratedKeys=true,keyProperty="id") + int insert(HighMerchantStoreAccountRecord record); + + @InsertProvider(type=HighMerchantStoreAccountRecordSqlProvider.class, method="insertSelective") + @Options(useGeneratedKeys=true,keyProperty="id") + int insertSelective(HighMerchantStoreAccountRecord record); + + @SelectProvider(type=HighMerchantStoreAccountRecordSqlProvider.class, method="selectByExample") + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="store_amount_id", property="storeAmountId", jdbcType=JdbcType.BIGINT), + @Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT), + @Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR), + @Result(column="store_id", property="storeId", jdbcType=JdbcType.BIGINT), + @Result(column="store_name", property="storeName", jdbcType=JdbcType.VARCHAR), + @Result(column="type", property="type", jdbcType=JdbcType.INTEGER), + @Result(column="amount", property="amount", jdbcType=JdbcType.DECIMAL), + @Result(column="before_amount", property="beforeAmount", jdbcType=JdbcType.DECIMAL), + @Result(column="after_amount", property="afterAmount", jdbcType=JdbcType.DECIMAL), + @Result(column="source_type", property="sourceType", jdbcType=JdbcType.INTEGER), + @Result(column="source_id", property="sourceId", jdbcType=JdbcType.BIGINT), + @Result(column="source_content", property="sourceContent", jdbcType=JdbcType.VARCHAR), + @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), + @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="op_user_id", property="opUserId", jdbcType=JdbcType.BIGINT), + @Result(column="op_user_name", property="opUserName", 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 selectByExample(HighMerchantStoreAccountRecordExample example); + + @Select({ + "select", + "id, store_amount_id, mer_id, mer_name, store_id, store_name, `type`, amount, ", + "before_amount, after_amount, source_type, source_id, source_content, `status`, ", + "create_time, op_user_id, op_user_name, ext_1, ext_2, ext_3", + "from high_merchant_store_account_record", + "where id = #{id,jdbcType=BIGINT}" + }) + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="store_amount_id", property="storeAmountId", jdbcType=JdbcType.BIGINT), + @Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT), + @Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR), + @Result(column="store_id", property="storeId", jdbcType=JdbcType.BIGINT), + @Result(column="store_name", property="storeName", jdbcType=JdbcType.VARCHAR), + @Result(column="type", property="type", jdbcType=JdbcType.INTEGER), + @Result(column="amount", property="amount", jdbcType=JdbcType.DECIMAL), + @Result(column="before_amount", property="beforeAmount", jdbcType=JdbcType.DECIMAL), + @Result(column="after_amount", property="afterAmount", jdbcType=JdbcType.DECIMAL), + @Result(column="source_type", property="sourceType", jdbcType=JdbcType.INTEGER), + @Result(column="source_id", property="sourceId", jdbcType=JdbcType.BIGINT), + @Result(column="source_content", property="sourceContent", jdbcType=JdbcType.VARCHAR), + @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), + @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="op_user_id", property="opUserId", jdbcType=JdbcType.BIGINT), + @Result(column="op_user_name", property="opUserName", 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) + }) + HighMerchantStoreAccountRecord selectByPrimaryKey(Long id); + + @UpdateProvider(type=HighMerchantStoreAccountRecordSqlProvider.class, method="updateByExampleSelective") + int updateByExampleSelective(@Param("record") HighMerchantStoreAccountRecord record, @Param("example") HighMerchantStoreAccountRecordExample example); + + @UpdateProvider(type=HighMerchantStoreAccountRecordSqlProvider.class, method="updateByExample") + int updateByExample(@Param("record") HighMerchantStoreAccountRecord record, @Param("example") HighMerchantStoreAccountRecordExample example); + + @UpdateProvider(type=HighMerchantStoreAccountRecordSqlProvider.class, method="updateByPrimaryKeySelective") + int updateByPrimaryKeySelective(HighMerchantStoreAccountRecord record); + + @Update({ + "update high_merchant_store_account_record", + "set store_amount_id = #{storeAmountId,jdbcType=BIGINT},", + "mer_id = #{merId,jdbcType=BIGINT},", + "mer_name = #{merName,jdbcType=VARCHAR},", + "store_id = #{storeId,jdbcType=BIGINT},", + "store_name = #{storeName,jdbcType=VARCHAR},", + "`type` = #{type,jdbcType=INTEGER},", + "amount = #{amount,jdbcType=DECIMAL},", + "before_amount = #{beforeAmount,jdbcType=DECIMAL},", + "after_amount = #{afterAmount,jdbcType=DECIMAL},", + "source_type = #{sourceType,jdbcType=INTEGER},", + "source_id = #{sourceId,jdbcType=BIGINT},", + "source_content = #{sourceContent,jdbcType=VARCHAR},", + "`status` = #{status,jdbcType=INTEGER},", + "create_time = #{createTime,jdbcType=TIMESTAMP},", + "op_user_id = #{opUserId,jdbcType=BIGINT},", + "op_user_name = #{opUserName,jdbcType=VARCHAR},", + "ext_1 = #{ext1,jdbcType=VARCHAR},", + "ext_2 = #{ext2,jdbcType=VARCHAR},", + "ext_3 = #{ext3,jdbcType=VARCHAR}", + "where id = #{id,jdbcType=BIGINT}" + }) + int updateByPrimaryKey(HighMerchantStoreAccountRecord record); +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/dao/HighMerchantStoreAccountRecordMapperExt.java b/hai-service/src/main/java/com/hai/dao/HighMerchantStoreAccountRecordMapperExt.java new file mode 100644 index 00000000..a7286ab5 --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/HighMerchantStoreAccountRecordMapperExt.java @@ -0,0 +1,7 @@ +package com.hai.dao; + +/** + * mapper扩展类 + */ +public interface HighMerchantStoreAccountRecordMapperExt { +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/dao/HighMerchantStoreAccountRecordSqlProvider.java b/hai-service/src/main/java/com/hai/dao/HighMerchantStoreAccountRecordSqlProvider.java new file mode 100644 index 00000000..120c822b --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/HighMerchantStoreAccountRecordSqlProvider.java @@ -0,0 +1,444 @@ +package com.hai.dao; + +import com.hai.entity.HighMerchantStoreAccountRecord; +import com.hai.entity.HighMerchantStoreAccountRecordExample.Criteria; +import com.hai.entity.HighMerchantStoreAccountRecordExample.Criterion; +import com.hai.entity.HighMerchantStoreAccountRecordExample; +import java.util.List; +import java.util.Map; +import org.apache.ibatis.jdbc.SQL; + +public class HighMerchantStoreAccountRecordSqlProvider { + + public String countByExample(HighMerchantStoreAccountRecordExample example) { + SQL sql = new SQL(); + sql.SELECT("count(*)").FROM("high_merchant_store_account_record"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String deleteByExample(HighMerchantStoreAccountRecordExample example) { + SQL sql = new SQL(); + sql.DELETE_FROM("high_merchant_store_account_record"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String insertSelective(HighMerchantStoreAccountRecord record) { + SQL sql = new SQL(); + sql.INSERT_INTO("high_merchant_store_account_record"); + + if (record.getStoreAmountId() != null) { + sql.VALUES("store_amount_id", "#{storeAmountId,jdbcType=BIGINT}"); + } + + if (record.getMerId() != null) { + sql.VALUES("mer_id", "#{merId,jdbcType=BIGINT}"); + } + + if (record.getMerName() != null) { + sql.VALUES("mer_name", "#{merName,jdbcType=VARCHAR}"); + } + + if (record.getStoreId() != null) { + sql.VALUES("store_id", "#{storeId,jdbcType=BIGINT}"); + } + + if (record.getStoreName() != null) { + sql.VALUES("store_name", "#{storeName,jdbcType=VARCHAR}"); + } + + if (record.getType() != null) { + sql.VALUES("`type`", "#{type,jdbcType=INTEGER}"); + } + + if (record.getAmount() != null) { + sql.VALUES("amount", "#{amount,jdbcType=DECIMAL}"); + } + + if (record.getBeforeAmount() != null) { + sql.VALUES("before_amount", "#{beforeAmount,jdbcType=DECIMAL}"); + } + + if (record.getAfterAmount() != null) { + sql.VALUES("after_amount", "#{afterAmount,jdbcType=DECIMAL}"); + } + + if (record.getSourceType() != null) { + sql.VALUES("source_type", "#{sourceType,jdbcType=INTEGER}"); + } + + if (record.getSourceId() != null) { + sql.VALUES("source_id", "#{sourceId,jdbcType=BIGINT}"); + } + + if (record.getSourceContent() != null) { + sql.VALUES("source_content", "#{sourceContent,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.getOpUserId() != null) { + sql.VALUES("op_user_id", "#{opUserId,jdbcType=BIGINT}"); + } + + if (record.getOpUserName() != null) { + sql.VALUES("op_user_name", "#{opUserName,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(HighMerchantStoreAccountRecordExample example) { + SQL sql = new SQL(); + if (example != null && example.isDistinct()) { + sql.SELECT_DISTINCT("id"); + } else { + sql.SELECT("id"); + } + sql.SELECT("store_amount_id"); + sql.SELECT("mer_id"); + sql.SELECT("mer_name"); + sql.SELECT("store_id"); + sql.SELECT("store_name"); + sql.SELECT("`type`"); + sql.SELECT("amount"); + sql.SELECT("before_amount"); + sql.SELECT("after_amount"); + sql.SELECT("source_type"); + sql.SELECT("source_id"); + sql.SELECT("source_content"); + sql.SELECT("`status`"); + sql.SELECT("create_time"); + sql.SELECT("op_user_id"); + sql.SELECT("op_user_name"); + sql.SELECT("ext_1"); + sql.SELECT("ext_2"); + sql.SELECT("ext_3"); + sql.FROM("high_merchant_store_account_record"); + applyWhere(sql, example, false); + + if (example != null && example.getOrderByClause() != null) { + sql.ORDER_BY(example.getOrderByClause()); + } + + return sql.toString(); + } + + public String updateByExampleSelective(Map parameter) { + HighMerchantStoreAccountRecord record = (HighMerchantStoreAccountRecord) parameter.get("record"); + HighMerchantStoreAccountRecordExample example = (HighMerchantStoreAccountRecordExample) parameter.get("example"); + + SQL sql = new SQL(); + sql.UPDATE("high_merchant_store_account_record"); + + if (record.getId() != null) { + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + } + + if (record.getStoreAmountId() != null) { + sql.SET("store_amount_id = #{record.storeAmountId,jdbcType=BIGINT}"); + } + + if (record.getMerId() != null) { + sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}"); + } + + if (record.getMerName() != null) { + sql.SET("mer_name = #{record.merName,jdbcType=VARCHAR}"); + } + + if (record.getStoreId() != null) { + sql.SET("store_id = #{record.storeId,jdbcType=BIGINT}"); + } + + if (record.getStoreName() != null) { + sql.SET("store_name = #{record.storeName,jdbcType=VARCHAR}"); + } + + if (record.getType() != null) { + sql.SET("`type` = #{record.type,jdbcType=INTEGER}"); + } + + if (record.getAmount() != null) { + sql.SET("amount = #{record.amount,jdbcType=DECIMAL}"); + } + + if (record.getBeforeAmount() != null) { + sql.SET("before_amount = #{record.beforeAmount,jdbcType=DECIMAL}"); + } + + if (record.getAfterAmount() != null) { + sql.SET("after_amount = #{record.afterAmount,jdbcType=DECIMAL}"); + } + + if (record.getSourceType() != null) { + sql.SET("source_type = #{record.sourceType,jdbcType=INTEGER}"); + } + + if (record.getSourceId() != null) { + sql.SET("source_id = #{record.sourceId,jdbcType=BIGINT}"); + } + + if (record.getSourceContent() != null) { + sql.SET("source_content = #{record.sourceContent,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.getOpUserId() != null) { + sql.SET("op_user_id = #{record.opUserId,jdbcType=BIGINT}"); + } + + if (record.getOpUserName() != null) { + sql.SET("op_user_name = #{record.opUserName,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 parameter) { + SQL sql = new SQL(); + sql.UPDATE("high_merchant_store_account_record"); + + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + sql.SET("store_amount_id = #{record.storeAmountId,jdbcType=BIGINT}"); + sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}"); + sql.SET("mer_name = #{record.merName,jdbcType=VARCHAR}"); + sql.SET("store_id = #{record.storeId,jdbcType=BIGINT}"); + sql.SET("store_name = #{record.storeName,jdbcType=VARCHAR}"); + sql.SET("`type` = #{record.type,jdbcType=INTEGER}"); + sql.SET("amount = #{record.amount,jdbcType=DECIMAL}"); + sql.SET("before_amount = #{record.beforeAmount,jdbcType=DECIMAL}"); + sql.SET("after_amount = #{record.afterAmount,jdbcType=DECIMAL}"); + sql.SET("source_type = #{record.sourceType,jdbcType=INTEGER}"); + sql.SET("source_id = #{record.sourceId,jdbcType=BIGINT}"); + sql.SET("source_content = #{record.sourceContent,jdbcType=VARCHAR}"); + sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); + sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); + sql.SET("op_user_id = #{record.opUserId,jdbcType=BIGINT}"); + sql.SET("op_user_name = #{record.opUserName,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}"); + + HighMerchantStoreAccountRecordExample example = (HighMerchantStoreAccountRecordExample) parameter.get("example"); + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByPrimaryKeySelective(HighMerchantStoreAccountRecord record) { + SQL sql = new SQL(); + sql.UPDATE("high_merchant_store_account_record"); + + if (record.getStoreAmountId() != null) { + sql.SET("store_amount_id = #{storeAmountId,jdbcType=BIGINT}"); + } + + if (record.getMerId() != null) { + sql.SET("mer_id = #{merId,jdbcType=BIGINT}"); + } + + if (record.getMerName() != null) { + sql.SET("mer_name = #{merName,jdbcType=VARCHAR}"); + } + + if (record.getStoreId() != null) { + sql.SET("store_id = #{storeId,jdbcType=BIGINT}"); + } + + if (record.getStoreName() != null) { + sql.SET("store_name = #{storeName,jdbcType=VARCHAR}"); + } + + if (record.getType() != null) { + sql.SET("`type` = #{type,jdbcType=INTEGER}"); + } + + if (record.getAmount() != null) { + sql.SET("amount = #{amount,jdbcType=DECIMAL}"); + } + + if (record.getBeforeAmount() != null) { + sql.SET("before_amount = #{beforeAmount,jdbcType=DECIMAL}"); + } + + if (record.getAfterAmount() != null) { + sql.SET("after_amount = #{afterAmount,jdbcType=DECIMAL}"); + } + + if (record.getSourceType() != null) { + sql.SET("source_type = #{sourceType,jdbcType=INTEGER}"); + } + + if (record.getSourceId() != null) { + sql.SET("source_id = #{sourceId,jdbcType=BIGINT}"); + } + + if (record.getSourceContent() != null) { + sql.SET("source_content = #{sourceContent,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.getOpUserId() != null) { + sql.SET("op_user_id = #{opUserId,jdbcType=BIGINT}"); + } + + if (record.getOpUserName() != null) { + sql.SET("op_user_name = #{opUserName,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, HighMerchantStoreAccountRecordExample 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()); + } + } +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/dao/HighMerchantStoreAccountSqlProvider.java b/hai-service/src/main/java/com/hai/dao/HighMerchantStoreAccountSqlProvider.java new file mode 100644 index 00000000..d7aa214b --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/HighMerchantStoreAccountSqlProvider.java @@ -0,0 +1,304 @@ +package com.hai.dao; + +import com.hai.entity.HighMerchantStoreAccount; +import com.hai.entity.HighMerchantStoreAccountExample.Criteria; +import com.hai.entity.HighMerchantStoreAccountExample.Criterion; +import com.hai.entity.HighMerchantStoreAccountExample; +import java.util.List; +import java.util.Map; +import org.apache.ibatis.jdbc.SQL; + +public class HighMerchantStoreAccountSqlProvider { + + public String countByExample(HighMerchantStoreAccountExample example) { + SQL sql = new SQL(); + sql.SELECT("count(*)").FROM("high_merchant_store_account"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String deleteByExample(HighMerchantStoreAccountExample example) { + SQL sql = new SQL(); + sql.DELETE_FROM("high_merchant_store_account"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String insertSelective(HighMerchantStoreAccount record) { + SQL sql = new SQL(); + sql.INSERT_INTO("high_merchant_store_account"); + + if (record.getStoreId() != null) { + sql.VALUES("store_id", "#{storeId,jdbcType=BIGINT}"); + } + + if (record.getAccountNo() != null) { + sql.VALUES("account_no", "#{accountNo,jdbcType=VARCHAR}"); + } + + if (record.getAmounts() != null) { + sql.VALUES("amounts", "#{amounts,jdbcType=DECIMAL}"); + } + + if (record.getStatus() != null) { + sql.VALUES("`status`", "#{status,jdbcType=INTEGER}"); + } + + 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(HighMerchantStoreAccountExample example) { + SQL sql = new SQL(); + if (example != null && example.isDistinct()) { + sql.SELECT_DISTINCT("id"); + } else { + sql.SELECT("id"); + } + sql.SELECT("store_id"); + sql.SELECT("account_no"); + sql.SELECT("amounts"); + sql.SELECT("`status`"); + sql.SELECT("create_time"); + sql.SELECT("update_time"); + sql.SELECT("ext_1"); + sql.SELECT("ext_2"); + sql.SELECT("ext_3"); + sql.FROM("high_merchant_store_account"); + applyWhere(sql, example, false); + + if (example != null && example.getOrderByClause() != null) { + sql.ORDER_BY(example.getOrderByClause()); + } + + return sql.toString(); + } + + public String updateByExampleSelective(Map parameter) { + HighMerchantStoreAccount record = (HighMerchantStoreAccount) parameter.get("record"); + HighMerchantStoreAccountExample example = (HighMerchantStoreAccountExample) parameter.get("example"); + + SQL sql = new SQL(); + sql.UPDATE("high_merchant_store_account"); + + if (record.getId() != null) { + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + } + + if (record.getStoreId() != null) { + sql.SET("store_id = #{record.storeId,jdbcType=BIGINT}"); + } + + if (record.getAccountNo() != null) { + sql.SET("account_no = #{record.accountNo,jdbcType=VARCHAR}"); + } + + if (record.getAmounts() != null) { + sql.SET("amounts = #{record.amounts,jdbcType=DECIMAL}"); + } + + 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.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("high_merchant_store_account"); + + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + sql.SET("store_id = #{record.storeId,jdbcType=BIGINT}"); + sql.SET("account_no = #{record.accountNo,jdbcType=VARCHAR}"); + sql.SET("amounts = #{record.amounts,jdbcType=DECIMAL}"); + sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); + 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}"); + + HighMerchantStoreAccountExample example = (HighMerchantStoreAccountExample) parameter.get("example"); + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByPrimaryKeySelective(HighMerchantStoreAccount record) { + SQL sql = new SQL(); + sql.UPDATE("high_merchant_store_account"); + + if (record.getStoreId() != null) { + sql.SET("store_id = #{storeId,jdbcType=BIGINT}"); + } + + if (record.getAccountNo() != null) { + sql.SET("account_no = #{accountNo,jdbcType=VARCHAR}"); + } + + if (record.getAmounts() != null) { + sql.SET("amounts = #{amounts,jdbcType=DECIMAL}"); + } + + if (record.getStatus() != null) { + sql.SET("`status` = #{status,jdbcType=INTEGER}"); + } + + 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, HighMerchantStoreAccountExample 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()); + } + } +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/dao/HighMerchantStoreMapper.java b/hai-service/src/main/java/com/hai/dao/HighMerchantStoreMapper.java index d7643d43..26acfdc5 100644 --- a/hai-service/src/main/java/com/hai/dao/HighMerchantStoreMapper.java +++ b/hai-service/src/main/java/com/hai/dao/HighMerchantStoreMapper.java @@ -49,10 +49,10 @@ public interface HighMerchantStoreMapper extends HighMerchantStoreMapperExt { "address, `status`, ", "longitude, latitude, ", "device_sn, device_key, ", - "device_name, operator_id, ", - "operator_name, update_time, ", - "create_time, ext_1, ", - "ext_2, ext_3)", + "device_name, prestore_type, ", + "operator_id, operator_name, ", + "update_time, create_time, ", + "ext_1, ext_2, ext_3)", "values (#{type,jdbcType=INTEGER}, #{sourceType,jdbcType=INTEGER}, ", "#{brandId,jdbcType=BIGINT}, #{brandName,jdbcType=VARCHAR}, ", "#{regionId,jdbcType=BIGINT}, #{regionName,jdbcType=VARCHAR}, ", @@ -63,10 +63,10 @@ public interface HighMerchantStoreMapper extends HighMerchantStoreMapperExt { "#{address,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ", "#{longitude,jdbcType=VARCHAR}, #{latitude,jdbcType=VARCHAR}, ", "#{deviceSn,jdbcType=VARCHAR}, #{deviceKey,jdbcType=VARCHAR}, ", - "#{deviceName,jdbcType=VARCHAR}, #{operatorId,jdbcType=BIGINT}, ", - "#{operatorName,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, ", - "#{createTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ", - "#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" + "#{deviceName,jdbcType=VARCHAR}, #{prestoreType,jdbcType=INTEGER}, ", + "#{operatorId,jdbcType=BIGINT}, #{operatorName,jdbcType=VARCHAR}, ", + "#{updateTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP}, ", + "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" }) @Options(useGeneratedKeys=true,keyProperty="id") int insert(HighMerchantStore record); @@ -99,6 +99,7 @@ public interface HighMerchantStoreMapper extends HighMerchantStoreMapperExt { @Result(column="device_sn", property="deviceSn", jdbcType=JdbcType.VARCHAR), @Result(column="device_key", property="deviceKey", jdbcType=JdbcType.VARCHAR), @Result(column="device_name", property="deviceName", jdbcType=JdbcType.VARCHAR), + @Result(column="prestore_type", property="prestoreType", jdbcType=JdbcType.INTEGER), @Result(column="operator_id", property="operatorId", jdbcType=JdbcType.BIGINT), @Result(column="operator_name", property="operatorName", jdbcType=JdbcType.VARCHAR), @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), @@ -114,7 +115,8 @@ public interface HighMerchantStoreMapper extends HighMerchantStoreMapperExt { "id, `type`, source_type, brand_id, brand_name, region_id, region_name, company_id, ", "merchant_id, store_logo, store_key, store_name, store_desc, telephone, contact_name, ", "address, `status`, longitude, latitude, device_sn, device_key, device_name, ", - "operator_id, operator_name, update_time, create_time, ext_1, ext_2, ext_3", + "prestore_type, operator_id, operator_name, update_time, create_time, ext_1, ", + "ext_2, ext_3", "from high_merchant_store", "where id = #{id,jdbcType=BIGINT}" }) @@ -141,6 +143,7 @@ public interface HighMerchantStoreMapper extends HighMerchantStoreMapperExt { @Result(column="device_sn", property="deviceSn", jdbcType=JdbcType.VARCHAR), @Result(column="device_key", property="deviceKey", jdbcType=JdbcType.VARCHAR), @Result(column="device_name", property="deviceName", jdbcType=JdbcType.VARCHAR), + @Result(column="prestore_type", property="prestoreType", jdbcType=JdbcType.INTEGER), @Result(column="operator_id", property="operatorId", jdbcType=JdbcType.BIGINT), @Result(column="operator_name", property="operatorName", jdbcType=JdbcType.VARCHAR), @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), @@ -183,6 +186,7 @@ public interface HighMerchantStoreMapper extends HighMerchantStoreMapperExt { "device_sn = #{deviceSn,jdbcType=VARCHAR},", "device_key = #{deviceKey,jdbcType=VARCHAR},", "device_name = #{deviceName,jdbcType=VARCHAR},", + "prestore_type = #{prestoreType,jdbcType=INTEGER},", "operator_id = #{operatorId,jdbcType=BIGINT},", "operator_name = #{operatorName,jdbcType=VARCHAR},", "update_time = #{updateTime,jdbcType=TIMESTAMP},", diff --git a/hai-service/src/main/java/com/hai/dao/HighMerchantStoreSqlProvider.java b/hai-service/src/main/java/com/hai/dao/HighMerchantStoreSqlProvider.java index 3e0ad5cc..828cf14a 100644 --- a/hai-service/src/main/java/com/hai/dao/HighMerchantStoreSqlProvider.java +++ b/hai-service/src/main/java/com/hai/dao/HighMerchantStoreSqlProvider.java @@ -112,6 +112,10 @@ public class HighMerchantStoreSqlProvider { sql.VALUES("device_name", "#{deviceName,jdbcType=VARCHAR}"); } + if (record.getPrestoreType() != null) { + sql.VALUES("prestore_type", "#{prestoreType,jdbcType=INTEGER}"); + } + if (record.getOperatorId() != null) { sql.VALUES("operator_id", "#{operatorId,jdbcType=BIGINT}"); } @@ -171,6 +175,7 @@ public class HighMerchantStoreSqlProvider { sql.SELECT("device_sn"); sql.SELECT("device_key"); sql.SELECT("device_name"); + sql.SELECT("prestore_type"); sql.SELECT("operator_id"); sql.SELECT("operator_name"); sql.SELECT("update_time"); @@ -283,6 +288,10 @@ public class HighMerchantStoreSqlProvider { sql.SET("device_name = #{record.deviceName,jdbcType=VARCHAR}"); } + if (record.getPrestoreType() != null) { + sql.SET("prestore_type = #{record.prestoreType,jdbcType=INTEGER}"); + } + if (record.getOperatorId() != null) { sql.SET("operator_id = #{record.operatorId,jdbcType=BIGINT}"); } @@ -341,6 +350,7 @@ public class HighMerchantStoreSqlProvider { sql.SET("device_sn = #{record.deviceSn,jdbcType=VARCHAR}"); sql.SET("device_key = #{record.deviceKey,jdbcType=VARCHAR}"); sql.SET("device_name = #{record.deviceName,jdbcType=VARCHAR}"); + sql.SET("prestore_type = #{record.prestoreType,jdbcType=INTEGER}"); sql.SET("operator_id = #{record.operatorId,jdbcType=BIGINT}"); sql.SET("operator_name = #{record.operatorName,jdbcType=VARCHAR}"); sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); @@ -442,6 +452,10 @@ public class HighMerchantStoreSqlProvider { sql.SET("device_name = #{deviceName,jdbcType=VARCHAR}"); } + if (record.getPrestoreType() != null) { + sql.SET("prestore_type = #{prestoreType,jdbcType=INTEGER}"); + } + if (record.getOperatorId() != null) { sql.SET("operator_id = #{operatorId,jdbcType=BIGINT}"); } diff --git a/hai-service/src/main/java/com/hai/entity/HighMerchantStore.java b/hai-service/src/main/java/com/hai/entity/HighMerchantStore.java index 80a5e4c2..656fc60c 100644 --- a/hai-service/src/main/java/com/hai/entity/HighMerchantStore.java +++ b/hai-service/src/main/java/com/hai/entity/HighMerchantStore.java @@ -123,6 +123,11 @@ public class HighMerchantStore implements Serializable { */ private String deviceName; + /** + * 预存类型 0:非预存 1:预存门店 + */ + private Integer prestoreType; + /** * 操作人id */ @@ -347,6 +352,14 @@ public class HighMerchantStore implements Serializable { this.deviceName = deviceName; } + public Integer getPrestoreType() { + return prestoreType; + } + + public void setPrestoreType(Integer prestoreType) { + this.prestoreType = prestoreType; + } + public Long getOperatorId() { return operatorId; } @@ -437,6 +450,7 @@ public class HighMerchantStore implements Serializable { && (this.getDeviceSn() == null ? other.getDeviceSn() == null : this.getDeviceSn().equals(other.getDeviceSn())) && (this.getDeviceKey() == null ? other.getDeviceKey() == null : this.getDeviceKey().equals(other.getDeviceKey())) && (this.getDeviceName() == null ? other.getDeviceName() == null : this.getDeviceName().equals(other.getDeviceName())) + && (this.getPrestoreType() == null ? other.getPrestoreType() == null : this.getPrestoreType().equals(other.getPrestoreType())) && (this.getOperatorId() == null ? other.getOperatorId() == null : this.getOperatorId().equals(other.getOperatorId())) && (this.getOperatorName() == null ? other.getOperatorName() == null : this.getOperatorName().equals(other.getOperatorName())) && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime())) @@ -472,6 +486,7 @@ public class HighMerchantStore implements Serializable { result = prime * result + ((getDeviceSn() == null) ? 0 : getDeviceSn().hashCode()); result = prime * result + ((getDeviceKey() == null) ? 0 : getDeviceKey().hashCode()); result = prime * result + ((getDeviceName() == null) ? 0 : getDeviceName().hashCode()); + result = prime * result + ((getPrestoreType() == null) ? 0 : getPrestoreType().hashCode()); result = prime * result + ((getOperatorId() == null) ? 0 : getOperatorId().hashCode()); result = prime * result + ((getOperatorName() == null) ? 0 : getOperatorName().hashCode()); result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode()); @@ -510,6 +525,7 @@ public class HighMerchantStore implements Serializable { sb.append(", deviceSn=").append(deviceSn); sb.append(", deviceKey=").append(deviceKey); sb.append(", deviceName=").append(deviceName); + sb.append(", prestoreType=").append(prestoreType); sb.append(", operatorId=").append(operatorId); sb.append(", operatorName=").append(operatorName); sb.append(", updateTime=").append(updateTime); diff --git a/hai-service/src/main/java/com/hai/entity/HighMerchantStoreAccount.java b/hai-service/src/main/java/com/hai/entity/HighMerchantStoreAccount.java new file mode 100644 index 00000000..d7117b89 --- /dev/null +++ b/hai-service/src/main/java/com/hai/entity/HighMerchantStoreAccount.java @@ -0,0 +1,198 @@ +package com.hai.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * high_merchant_store_account + * @author + */ +/** + * + * 代码由工具生成 + * + **/ +public class HighMerchantStoreAccount implements Serializable { + private Long id; + + /** + * 门店id + */ + private Long storeId; + + /** + * 账户号码 + */ + private String accountNo; + + /** + * 账户余额 + */ + private BigDecimal amounts; + + /** + * 状态 0:删除 1:正常 + */ + private Integer status; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 修改时间 + */ + private Date updateTime; + + 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 getStoreId() { + return storeId; + } + + public void setStoreId(Long storeId) { + this.storeId = storeId; + } + + public String getAccountNo() { + return accountNo; + } + + public void setAccountNo(String accountNo) { + this.accountNo = accountNo; + } + + public BigDecimal getAmounts() { + return amounts; + } + + public void setAmounts(BigDecimal amounts) { + this.amounts = amounts; + } + + 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 Date getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + + 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; + } + HighMerchantStoreAccount other = (HighMerchantStoreAccount) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getStoreId() == null ? other.getStoreId() == null : this.getStoreId().equals(other.getStoreId())) + && (this.getAccountNo() == null ? other.getAccountNo() == null : this.getAccountNo().equals(other.getAccountNo())) + && (this.getAmounts() == null ? other.getAmounts() == null : this.getAmounts().equals(other.getAmounts())) + && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) + && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) + && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime())) + && (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 + ((getStoreId() == null) ? 0 : getStoreId().hashCode()); + result = prime * result + ((getAccountNo() == null) ? 0 : getAccountNo().hashCode()); + result = prime * result + ((getAmounts() == null) ? 0 : getAmounts().hashCode()); + result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); + result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); + result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().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(", storeId=").append(storeId); + sb.append(", accountNo=").append(accountNo); + sb.append(", amounts=").append(amounts); + sb.append(", status=").append(status); + sb.append(", createTime=").append(createTime); + sb.append(", updateTime=").append(updateTime); + 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(); + } +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/entity/HighMerchantStoreAccountExample.java b/hai-service/src/main/java/com/hai/entity/HighMerchantStoreAccountExample.java new file mode 100644 index 00000000..1d266aa7 --- /dev/null +++ b/hai-service/src/main/java/com/hai/entity/HighMerchantStoreAccountExample.java @@ -0,0 +1,864 @@ +package com.hai.entity; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class HighMerchantStoreAccountExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + private Integer limit; + + private Long offset; + + public HighMerchantStoreAccountExample() { + oredCriteria = new ArrayList(); + } + + 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 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 criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List 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 values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List 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 andStoreIdIsNull() { + addCriterion("store_id is null"); + return (Criteria) this; + } + + public Criteria andStoreIdIsNotNull() { + addCriterion("store_id is not null"); + return (Criteria) this; + } + + public Criteria andStoreIdEqualTo(Long value) { + addCriterion("store_id =", value, "storeId"); + return (Criteria) this; + } + + public Criteria andStoreIdNotEqualTo(Long value) { + addCriterion("store_id <>", value, "storeId"); + return (Criteria) this; + } + + public Criteria andStoreIdGreaterThan(Long value) { + addCriterion("store_id >", value, "storeId"); + return (Criteria) this; + } + + public Criteria andStoreIdGreaterThanOrEqualTo(Long value) { + addCriterion("store_id >=", value, "storeId"); + return (Criteria) this; + } + + public Criteria andStoreIdLessThan(Long value) { + addCriterion("store_id <", value, "storeId"); + return (Criteria) this; + } + + public Criteria andStoreIdLessThanOrEqualTo(Long value) { + addCriterion("store_id <=", value, "storeId"); + return (Criteria) this; + } + + public Criteria andStoreIdIn(List values) { + addCriterion("store_id in", values, "storeId"); + return (Criteria) this; + } + + public Criteria andStoreIdNotIn(List values) { + addCriterion("store_id not in", values, "storeId"); + return (Criteria) this; + } + + public Criteria andStoreIdBetween(Long value1, Long value2) { + addCriterion("store_id between", value1, value2, "storeId"); + return (Criteria) this; + } + + public Criteria andStoreIdNotBetween(Long value1, Long value2) { + addCriterion("store_id not between", value1, value2, "storeId"); + return (Criteria) this; + } + + public Criteria andAccountNoIsNull() { + addCriterion("account_no is null"); + return (Criteria) this; + } + + public Criteria andAccountNoIsNotNull() { + addCriterion("account_no is not null"); + return (Criteria) this; + } + + public Criteria andAccountNoEqualTo(String value) { + addCriterion("account_no =", value, "accountNo"); + return (Criteria) this; + } + + public Criteria andAccountNoNotEqualTo(String value) { + addCriterion("account_no <>", value, "accountNo"); + return (Criteria) this; + } + + public Criteria andAccountNoGreaterThan(String value) { + addCriterion("account_no >", value, "accountNo"); + return (Criteria) this; + } + + public Criteria andAccountNoGreaterThanOrEqualTo(String value) { + addCriterion("account_no >=", value, "accountNo"); + return (Criteria) this; + } + + public Criteria andAccountNoLessThan(String value) { + addCriterion("account_no <", value, "accountNo"); + return (Criteria) this; + } + + public Criteria andAccountNoLessThanOrEqualTo(String value) { + addCriterion("account_no <=", value, "accountNo"); + return (Criteria) this; + } + + public Criteria andAccountNoLike(String value) { + addCriterion("account_no like", value, "accountNo"); + return (Criteria) this; + } + + public Criteria andAccountNoNotLike(String value) { + addCriterion("account_no not like", value, "accountNo"); + return (Criteria) this; + } + + public Criteria andAccountNoIn(List values) { + addCriterion("account_no in", values, "accountNo"); + return (Criteria) this; + } + + public Criteria andAccountNoNotIn(List values) { + addCriterion("account_no not in", values, "accountNo"); + return (Criteria) this; + } + + public Criteria andAccountNoBetween(String value1, String value2) { + addCriterion("account_no between", value1, value2, "accountNo"); + return (Criteria) this; + } + + public Criteria andAccountNoNotBetween(String value1, String value2) { + addCriterion("account_no not between", value1, value2, "accountNo"); + return (Criteria) this; + } + + public Criteria andAmountsIsNull() { + addCriterion("amounts is null"); + return (Criteria) this; + } + + public Criteria andAmountsIsNotNull() { + addCriterion("amounts is not null"); + return (Criteria) this; + } + + public Criteria andAmountsEqualTo(BigDecimal value) { + addCriterion("amounts =", value, "amounts"); + return (Criteria) this; + } + + public Criteria andAmountsNotEqualTo(BigDecimal value) { + addCriterion("amounts <>", value, "amounts"); + return (Criteria) this; + } + + public Criteria andAmountsGreaterThan(BigDecimal value) { + addCriterion("amounts >", value, "amounts"); + return (Criteria) this; + } + + public Criteria andAmountsGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("amounts >=", value, "amounts"); + return (Criteria) this; + } + + public Criteria andAmountsLessThan(BigDecimal value) { + addCriterion("amounts <", value, "amounts"); + return (Criteria) this; + } + + public Criteria andAmountsLessThanOrEqualTo(BigDecimal value) { + addCriterion("amounts <=", value, "amounts"); + return (Criteria) this; + } + + public Criteria andAmountsIn(List values) { + addCriterion("amounts in", values, "amounts"); + return (Criteria) this; + } + + public Criteria andAmountsNotIn(List values) { + addCriterion("amounts not in", values, "amounts"); + return (Criteria) this; + } + + public Criteria andAmountsBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("amounts between", value1, value2, "amounts"); + return (Criteria) this; + } + + public Criteria andAmountsNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("amounts not between", value1, value2, "amounts"); + 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 values) { + addCriterion("`status` in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotIn(List 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 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 values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List 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 andUpdateTimeIsNull() { + addCriterion("update_time is null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNotNull() { + addCriterion("update_time is not null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeEqualTo(Date value) { + addCriterion("update_time =", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotEqualTo(Date value) { + addCriterion("update_time <>", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThan(Date value) { + addCriterion("update_time >", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("update_time >=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThan(Date value) { + addCriterion("update_time <", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThanOrEqualTo(Date value) { + addCriterion("update_time <=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIn(List values) { + addCriterion("update_time in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotIn(List values) { + addCriterion("update_time not in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeBetween(Date value1, Date value2) { + addCriterion("update_time between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotBetween(Date value1, Date value2) { + addCriterion("update_time not between", value1, value2, "updateTime"); + 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 values) { + addCriterion("ext_1 in", values, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotIn(List 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 values) { + addCriterion("ext_2 in", values, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotIn(List 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 values) { + addCriterion("ext_3 in", values, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotIn(List 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); + } + } +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/entity/HighMerchantStoreAccountRecord.java b/hai-service/src/main/java/com/hai/entity/HighMerchantStoreAccountRecord.java new file mode 100644 index 00000000..ba1c86de --- /dev/null +++ b/hai-service/src/main/java/com/hai/entity/HighMerchantStoreAccountRecord.java @@ -0,0 +1,358 @@ +package com.hai.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * high_merchant_store_account_record + * @author + */ +/** + * + * 代码由工具生成 + * + **/ +public class HighMerchantStoreAccountRecord implements Serializable { + private Long id; + + /** + * 门店账户表id + */ + private Long storeAmountId; + + /** + * 商户id + */ + private Long merId; + + /** + * 商户名称 + */ + private String merName; + + /** + * 门店id + */ + private Long storeId; + + /** + * 门店名称 + */ + private String storeName; + + /** + * 类型 1:进账 2:出账 + */ + private Integer type; + + /** + * 金额 + */ + private BigDecimal amount; + + /** + * 变更前金额 + */ + private BigDecimal beforeAmount; + + /** + * 变更后金额 + */ + private BigDecimal afterAmount; + + /** + * 来源类型 1.金额充值 2. 订单消费 + */ + private Integer sourceType; + + /** + * 来源id + */ + private Long sourceId; + + /** + * 来源内容 + */ + private String sourceContent; + + /** + * 状态 0:删除 1:正常 + */ + private Integer status; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 操作人id + */ + private Long opUserId; + + /** + * 操作人名称 + */ + private String opUserName; + + 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 getStoreAmountId() { + return storeAmountId; + } + + public void setStoreAmountId(Long storeAmountId) { + this.storeAmountId = storeAmountId; + } + + public Long getMerId() { + return merId; + } + + public void setMerId(Long merId) { + this.merId = merId; + } + + public String getMerName() { + return merName; + } + + public void setMerName(String merName) { + this.merName = merName; + } + + public Long getStoreId() { + return storeId; + } + + public void setStoreId(Long storeId) { + this.storeId = storeId; + } + + public String getStoreName() { + return storeName; + } + + public void setStoreName(String storeName) { + this.storeName = storeName; + } + + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } + + public BigDecimal getAmount() { + return amount; + } + + public void setAmount(BigDecimal amount) { + this.amount = amount; + } + + public BigDecimal getBeforeAmount() { + return beforeAmount; + } + + public void setBeforeAmount(BigDecimal beforeAmount) { + this.beforeAmount = beforeAmount; + } + + public BigDecimal getAfterAmount() { + return afterAmount; + } + + public void setAfterAmount(BigDecimal afterAmount) { + this.afterAmount = afterAmount; + } + + public Integer getSourceType() { + return sourceType; + } + + public void setSourceType(Integer sourceType) { + this.sourceType = sourceType; + } + + public Long getSourceId() { + return sourceId; + } + + public void setSourceId(Long sourceId) { + this.sourceId = sourceId; + } + + public String getSourceContent() { + return sourceContent; + } + + public void setSourceContent(String sourceContent) { + this.sourceContent = sourceContent; + } + + 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 Long getOpUserId() { + return opUserId; + } + + public void setOpUserId(Long opUserId) { + this.opUserId = opUserId; + } + + public String getOpUserName() { + return opUserName; + } + + public void setOpUserName(String opUserName) { + this.opUserName = opUserName; + } + + 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; + } + HighMerchantStoreAccountRecord other = (HighMerchantStoreAccountRecord) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getStoreAmountId() == null ? other.getStoreAmountId() == null : this.getStoreAmountId().equals(other.getStoreAmountId())) + && (this.getMerId() == null ? other.getMerId() == null : this.getMerId().equals(other.getMerId())) + && (this.getMerName() == null ? other.getMerName() == null : this.getMerName().equals(other.getMerName())) + && (this.getStoreId() == null ? other.getStoreId() == null : this.getStoreId().equals(other.getStoreId())) + && (this.getStoreName() == null ? other.getStoreName() == null : this.getStoreName().equals(other.getStoreName())) + && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType())) + && (this.getAmount() == null ? other.getAmount() == null : this.getAmount().equals(other.getAmount())) + && (this.getBeforeAmount() == null ? other.getBeforeAmount() == null : this.getBeforeAmount().equals(other.getBeforeAmount())) + && (this.getAfterAmount() == null ? other.getAfterAmount() == null : this.getAfterAmount().equals(other.getAfterAmount())) + && (this.getSourceType() == null ? other.getSourceType() == null : this.getSourceType().equals(other.getSourceType())) + && (this.getSourceId() == null ? other.getSourceId() == null : this.getSourceId().equals(other.getSourceId())) + && (this.getSourceContent() == null ? other.getSourceContent() == null : this.getSourceContent().equals(other.getSourceContent())) + && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) + && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) + && (this.getOpUserId() == null ? other.getOpUserId() == null : this.getOpUserId().equals(other.getOpUserId())) + && (this.getOpUserName() == null ? other.getOpUserName() == null : this.getOpUserName().equals(other.getOpUserName())) + && (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 + ((getStoreAmountId() == null) ? 0 : getStoreAmountId().hashCode()); + result = prime * result + ((getMerId() == null) ? 0 : getMerId().hashCode()); + result = prime * result + ((getMerName() == null) ? 0 : getMerName().hashCode()); + result = prime * result + ((getStoreId() == null) ? 0 : getStoreId().hashCode()); + result = prime * result + ((getStoreName() == null) ? 0 : getStoreName().hashCode()); + result = prime * result + ((getType() == null) ? 0 : getType().hashCode()); + result = prime * result + ((getAmount() == null) ? 0 : getAmount().hashCode()); + result = prime * result + ((getBeforeAmount() == null) ? 0 : getBeforeAmount().hashCode()); + result = prime * result + ((getAfterAmount() == null) ? 0 : getAfterAmount().hashCode()); + result = prime * result + ((getSourceType() == null) ? 0 : getSourceType().hashCode()); + result = prime * result + ((getSourceId() == null) ? 0 : getSourceId().hashCode()); + result = prime * result + ((getSourceContent() == null) ? 0 : getSourceContent().hashCode()); + result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); + result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); + result = prime * result + ((getOpUserId() == null) ? 0 : getOpUserId().hashCode()); + result = prime * result + ((getOpUserName() == null) ? 0 : getOpUserName().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(", storeAmountId=").append(storeAmountId); + sb.append(", merId=").append(merId); + sb.append(", merName=").append(merName); + sb.append(", storeId=").append(storeId); + sb.append(", storeName=").append(storeName); + sb.append(", type=").append(type); + sb.append(", amount=").append(amount); + sb.append(", beforeAmount=").append(beforeAmount); + sb.append(", afterAmount=").append(afterAmount); + sb.append(", sourceType=").append(sourceType); + sb.append(", sourceId=").append(sourceId); + sb.append(", sourceContent=").append(sourceContent); + sb.append(", status=").append(status); + sb.append(", createTime=").append(createTime); + sb.append(", opUserId=").append(opUserId); + sb.append(", opUserName=").append(opUserName); + 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(); + } +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/entity/HighMerchantStoreAccountRecordExample.java b/hai-service/src/main/java/com/hai/entity/HighMerchantStoreAccountRecordExample.java new file mode 100644 index 00000000..24a079dd --- /dev/null +++ b/hai-service/src/main/java/com/hai/entity/HighMerchantStoreAccountRecordExample.java @@ -0,0 +1,1494 @@ +package com.hai.entity; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class HighMerchantStoreAccountRecordExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + private Integer limit; + + private Long offset; + + public HighMerchantStoreAccountRecordExample() { + oredCriteria = new ArrayList(); + } + + 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 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 criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List 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 values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List 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 andStoreAmountIdIsNull() { + addCriterion("store_amount_id is null"); + return (Criteria) this; + } + + public Criteria andStoreAmountIdIsNotNull() { + addCriterion("store_amount_id is not null"); + return (Criteria) this; + } + + public Criteria andStoreAmountIdEqualTo(Long value) { + addCriterion("store_amount_id =", value, "storeAmountId"); + return (Criteria) this; + } + + public Criteria andStoreAmountIdNotEqualTo(Long value) { + addCriterion("store_amount_id <>", value, "storeAmountId"); + return (Criteria) this; + } + + public Criteria andStoreAmountIdGreaterThan(Long value) { + addCriterion("store_amount_id >", value, "storeAmountId"); + return (Criteria) this; + } + + public Criteria andStoreAmountIdGreaterThanOrEqualTo(Long value) { + addCriterion("store_amount_id >=", value, "storeAmountId"); + return (Criteria) this; + } + + public Criteria andStoreAmountIdLessThan(Long value) { + addCriterion("store_amount_id <", value, "storeAmountId"); + return (Criteria) this; + } + + public Criteria andStoreAmountIdLessThanOrEqualTo(Long value) { + addCriterion("store_amount_id <=", value, "storeAmountId"); + return (Criteria) this; + } + + public Criteria andStoreAmountIdIn(List values) { + addCriterion("store_amount_id in", values, "storeAmountId"); + return (Criteria) this; + } + + public Criteria andStoreAmountIdNotIn(List values) { + addCriterion("store_amount_id not in", values, "storeAmountId"); + return (Criteria) this; + } + + public Criteria andStoreAmountIdBetween(Long value1, Long value2) { + addCriterion("store_amount_id between", value1, value2, "storeAmountId"); + return (Criteria) this; + } + + public Criteria andStoreAmountIdNotBetween(Long value1, Long value2) { + addCriterion("store_amount_id not between", value1, value2, "storeAmountId"); + return (Criteria) this; + } + + public Criteria andMerIdIsNull() { + addCriterion("mer_id is null"); + return (Criteria) this; + } + + public Criteria andMerIdIsNotNull() { + addCriterion("mer_id is not null"); + return (Criteria) this; + } + + public Criteria andMerIdEqualTo(Long value) { + addCriterion("mer_id =", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdNotEqualTo(Long value) { + addCriterion("mer_id <>", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdGreaterThan(Long value) { + addCriterion("mer_id >", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdGreaterThanOrEqualTo(Long value) { + addCriterion("mer_id >=", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdLessThan(Long value) { + addCriterion("mer_id <", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdLessThanOrEqualTo(Long value) { + addCriterion("mer_id <=", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdIn(List values) { + addCriterion("mer_id in", values, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdNotIn(List values) { + addCriterion("mer_id not in", values, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdBetween(Long value1, Long value2) { + addCriterion("mer_id between", value1, value2, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdNotBetween(Long value1, Long value2) { + addCriterion("mer_id not between", value1, value2, "merId"); + return (Criteria) this; + } + + public Criteria andMerNameIsNull() { + addCriterion("mer_name is null"); + return (Criteria) this; + } + + public Criteria andMerNameIsNotNull() { + addCriterion("mer_name is not null"); + return (Criteria) this; + } + + public Criteria andMerNameEqualTo(String value) { + addCriterion("mer_name =", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameNotEqualTo(String value) { + addCriterion("mer_name <>", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameGreaterThan(String value) { + addCriterion("mer_name >", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameGreaterThanOrEqualTo(String value) { + addCriterion("mer_name >=", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameLessThan(String value) { + addCriterion("mer_name <", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameLessThanOrEqualTo(String value) { + addCriterion("mer_name <=", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameLike(String value) { + addCriterion("mer_name like", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameNotLike(String value) { + addCriterion("mer_name not like", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameIn(List values) { + addCriterion("mer_name in", values, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameNotIn(List values) { + addCriterion("mer_name not in", values, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameBetween(String value1, String value2) { + addCriterion("mer_name between", value1, value2, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameNotBetween(String value1, String value2) { + addCriterion("mer_name not between", value1, value2, "merName"); + return (Criteria) this; + } + + public Criteria andStoreIdIsNull() { + addCriterion("store_id is null"); + return (Criteria) this; + } + + public Criteria andStoreIdIsNotNull() { + addCriterion("store_id is not null"); + return (Criteria) this; + } + + public Criteria andStoreIdEqualTo(Long value) { + addCriterion("store_id =", value, "storeId"); + return (Criteria) this; + } + + public Criteria andStoreIdNotEqualTo(Long value) { + addCriterion("store_id <>", value, "storeId"); + return (Criteria) this; + } + + public Criteria andStoreIdGreaterThan(Long value) { + addCriterion("store_id >", value, "storeId"); + return (Criteria) this; + } + + public Criteria andStoreIdGreaterThanOrEqualTo(Long value) { + addCriterion("store_id >=", value, "storeId"); + return (Criteria) this; + } + + public Criteria andStoreIdLessThan(Long value) { + addCriterion("store_id <", value, "storeId"); + return (Criteria) this; + } + + public Criteria andStoreIdLessThanOrEqualTo(Long value) { + addCriterion("store_id <=", value, "storeId"); + return (Criteria) this; + } + + public Criteria andStoreIdIn(List values) { + addCriterion("store_id in", values, "storeId"); + return (Criteria) this; + } + + public Criteria andStoreIdNotIn(List values) { + addCriterion("store_id not in", values, "storeId"); + return (Criteria) this; + } + + public Criteria andStoreIdBetween(Long value1, Long value2) { + addCriterion("store_id between", value1, value2, "storeId"); + return (Criteria) this; + } + + public Criteria andStoreIdNotBetween(Long value1, Long value2) { + addCriterion("store_id not between", value1, value2, "storeId"); + return (Criteria) this; + } + + public Criteria andStoreNameIsNull() { + addCriterion("store_name is null"); + return (Criteria) this; + } + + public Criteria andStoreNameIsNotNull() { + addCriterion("store_name is not null"); + return (Criteria) this; + } + + public Criteria andStoreNameEqualTo(String value) { + addCriterion("store_name =", value, "storeName"); + return (Criteria) this; + } + + public Criteria andStoreNameNotEqualTo(String value) { + addCriterion("store_name <>", value, "storeName"); + return (Criteria) this; + } + + public Criteria andStoreNameGreaterThan(String value) { + addCriterion("store_name >", value, "storeName"); + return (Criteria) this; + } + + public Criteria andStoreNameGreaterThanOrEqualTo(String value) { + addCriterion("store_name >=", value, "storeName"); + return (Criteria) this; + } + + public Criteria andStoreNameLessThan(String value) { + addCriterion("store_name <", value, "storeName"); + return (Criteria) this; + } + + public Criteria andStoreNameLessThanOrEqualTo(String value) { + addCriterion("store_name <=", value, "storeName"); + return (Criteria) this; + } + + public Criteria andStoreNameLike(String value) { + addCriterion("store_name like", value, "storeName"); + return (Criteria) this; + } + + public Criteria andStoreNameNotLike(String value) { + addCriterion("store_name not like", value, "storeName"); + return (Criteria) this; + } + + public Criteria andStoreNameIn(List values) { + addCriterion("store_name in", values, "storeName"); + return (Criteria) this; + } + + public Criteria andStoreNameNotIn(List values) { + addCriterion("store_name not in", values, "storeName"); + return (Criteria) this; + } + + public Criteria andStoreNameBetween(String value1, String value2) { + addCriterion("store_name between", value1, value2, "storeName"); + return (Criteria) this; + } + + public Criteria andStoreNameNotBetween(String value1, String value2) { + addCriterion("store_name not between", value1, value2, "storeName"); + return (Criteria) this; + } + + public Criteria andTypeIsNull() { + addCriterion("`type` is null"); + return (Criteria) this; + } + + public Criteria andTypeIsNotNull() { + addCriterion("`type` is not null"); + return (Criteria) this; + } + + public Criteria andTypeEqualTo(Integer value) { + addCriterion("`type` =", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotEqualTo(Integer value) { + addCriterion("`type` <>", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThan(Integer value) { + addCriterion("`type` >", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThanOrEqualTo(Integer value) { + addCriterion("`type` >=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThan(Integer value) { + addCriterion("`type` <", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThanOrEqualTo(Integer value) { + addCriterion("`type` <=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeIn(List values) { + addCriterion("`type` in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotIn(List values) { + addCriterion("`type` not in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeBetween(Integer value1, Integer value2) { + addCriterion("`type` between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotBetween(Integer value1, Integer value2) { + addCriterion("`type` not between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andAmountIsNull() { + addCriterion("amount is null"); + return (Criteria) this; + } + + public Criteria andAmountIsNotNull() { + addCriterion("amount is not null"); + return (Criteria) this; + } + + public Criteria andAmountEqualTo(BigDecimal value) { + addCriterion("amount =", value, "amount"); + return (Criteria) this; + } + + public Criteria andAmountNotEqualTo(BigDecimal value) { + addCriterion("amount <>", value, "amount"); + return (Criteria) this; + } + + public Criteria andAmountGreaterThan(BigDecimal value) { + addCriterion("amount >", value, "amount"); + return (Criteria) this; + } + + public Criteria andAmountGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("amount >=", value, "amount"); + return (Criteria) this; + } + + public Criteria andAmountLessThan(BigDecimal value) { + addCriterion("amount <", value, "amount"); + return (Criteria) this; + } + + public Criteria andAmountLessThanOrEqualTo(BigDecimal value) { + addCriterion("amount <=", value, "amount"); + return (Criteria) this; + } + + public Criteria andAmountIn(List values) { + addCriterion("amount in", values, "amount"); + return (Criteria) this; + } + + public Criteria andAmountNotIn(List values) { + addCriterion("amount not in", values, "amount"); + return (Criteria) this; + } + + public Criteria andAmountBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("amount between", value1, value2, "amount"); + return (Criteria) this; + } + + public Criteria andAmountNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("amount not between", value1, value2, "amount"); + return (Criteria) this; + } + + public Criteria andBeforeAmountIsNull() { + addCriterion("before_amount is null"); + return (Criteria) this; + } + + public Criteria andBeforeAmountIsNotNull() { + addCriterion("before_amount is not null"); + return (Criteria) this; + } + + public Criteria andBeforeAmountEqualTo(BigDecimal value) { + addCriterion("before_amount =", value, "beforeAmount"); + return (Criteria) this; + } + + public Criteria andBeforeAmountNotEqualTo(BigDecimal value) { + addCriterion("before_amount <>", value, "beforeAmount"); + return (Criteria) this; + } + + public Criteria andBeforeAmountGreaterThan(BigDecimal value) { + addCriterion("before_amount >", value, "beforeAmount"); + return (Criteria) this; + } + + public Criteria andBeforeAmountGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("before_amount >=", value, "beforeAmount"); + return (Criteria) this; + } + + public Criteria andBeforeAmountLessThan(BigDecimal value) { + addCriterion("before_amount <", value, "beforeAmount"); + return (Criteria) this; + } + + public Criteria andBeforeAmountLessThanOrEqualTo(BigDecimal value) { + addCriterion("before_amount <=", value, "beforeAmount"); + return (Criteria) this; + } + + public Criteria andBeforeAmountIn(List values) { + addCriterion("before_amount in", values, "beforeAmount"); + return (Criteria) this; + } + + public Criteria andBeforeAmountNotIn(List values) { + addCriterion("before_amount not in", values, "beforeAmount"); + return (Criteria) this; + } + + public Criteria andBeforeAmountBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("before_amount between", value1, value2, "beforeAmount"); + return (Criteria) this; + } + + public Criteria andBeforeAmountNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("before_amount not between", value1, value2, "beforeAmount"); + return (Criteria) this; + } + + public Criteria andAfterAmountIsNull() { + addCriterion("after_amount is null"); + return (Criteria) this; + } + + public Criteria andAfterAmountIsNotNull() { + addCriterion("after_amount is not null"); + return (Criteria) this; + } + + public Criteria andAfterAmountEqualTo(BigDecimal value) { + addCriterion("after_amount =", value, "afterAmount"); + return (Criteria) this; + } + + public Criteria andAfterAmountNotEqualTo(BigDecimal value) { + addCriterion("after_amount <>", value, "afterAmount"); + return (Criteria) this; + } + + public Criteria andAfterAmountGreaterThan(BigDecimal value) { + addCriterion("after_amount >", value, "afterAmount"); + return (Criteria) this; + } + + public Criteria andAfterAmountGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("after_amount >=", value, "afterAmount"); + return (Criteria) this; + } + + public Criteria andAfterAmountLessThan(BigDecimal value) { + addCriterion("after_amount <", value, "afterAmount"); + return (Criteria) this; + } + + public Criteria andAfterAmountLessThanOrEqualTo(BigDecimal value) { + addCriterion("after_amount <=", value, "afterAmount"); + return (Criteria) this; + } + + public Criteria andAfterAmountIn(List values) { + addCriterion("after_amount in", values, "afterAmount"); + return (Criteria) this; + } + + public Criteria andAfterAmountNotIn(List values) { + addCriterion("after_amount not in", values, "afterAmount"); + return (Criteria) this; + } + + public Criteria andAfterAmountBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("after_amount between", value1, value2, "afterAmount"); + return (Criteria) this; + } + + public Criteria andAfterAmountNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("after_amount not between", value1, value2, "afterAmount"); + return (Criteria) this; + } + + public Criteria andSourceTypeIsNull() { + addCriterion("source_type is null"); + return (Criteria) this; + } + + public Criteria andSourceTypeIsNotNull() { + addCriterion("source_type is not null"); + return (Criteria) this; + } + + public Criteria andSourceTypeEqualTo(Integer value) { + addCriterion("source_type =", value, "sourceType"); + return (Criteria) this; + } + + public Criteria andSourceTypeNotEqualTo(Integer value) { + addCriterion("source_type <>", value, "sourceType"); + return (Criteria) this; + } + + public Criteria andSourceTypeGreaterThan(Integer value) { + addCriterion("source_type >", value, "sourceType"); + return (Criteria) this; + } + + public Criteria andSourceTypeGreaterThanOrEqualTo(Integer value) { + addCriterion("source_type >=", value, "sourceType"); + return (Criteria) this; + } + + public Criteria andSourceTypeLessThan(Integer value) { + addCriterion("source_type <", value, "sourceType"); + return (Criteria) this; + } + + public Criteria andSourceTypeLessThanOrEqualTo(Integer value) { + addCriterion("source_type <=", value, "sourceType"); + return (Criteria) this; + } + + public Criteria andSourceTypeIn(List values) { + addCriterion("source_type in", values, "sourceType"); + return (Criteria) this; + } + + public Criteria andSourceTypeNotIn(List values) { + addCriterion("source_type not in", values, "sourceType"); + return (Criteria) this; + } + + public Criteria andSourceTypeBetween(Integer value1, Integer value2) { + addCriterion("source_type between", value1, value2, "sourceType"); + return (Criteria) this; + } + + public Criteria andSourceTypeNotBetween(Integer value1, Integer value2) { + addCriterion("source_type not between", value1, value2, "sourceType"); + return (Criteria) this; + } + + public Criteria andSourceIdIsNull() { + addCriterion("source_id is null"); + return (Criteria) this; + } + + public Criteria andSourceIdIsNotNull() { + addCriterion("source_id is not null"); + return (Criteria) this; + } + + public Criteria andSourceIdEqualTo(Long value) { + addCriterion("source_id =", value, "sourceId"); + return (Criteria) this; + } + + public Criteria andSourceIdNotEqualTo(Long value) { + addCriterion("source_id <>", value, "sourceId"); + return (Criteria) this; + } + + public Criteria andSourceIdGreaterThan(Long value) { + addCriterion("source_id >", value, "sourceId"); + return (Criteria) this; + } + + public Criteria andSourceIdGreaterThanOrEqualTo(Long value) { + addCriterion("source_id >=", value, "sourceId"); + return (Criteria) this; + } + + public Criteria andSourceIdLessThan(Long value) { + addCriterion("source_id <", value, "sourceId"); + return (Criteria) this; + } + + public Criteria andSourceIdLessThanOrEqualTo(Long value) { + addCriterion("source_id <=", value, "sourceId"); + return (Criteria) this; + } + + public Criteria andSourceIdIn(List values) { + addCriterion("source_id in", values, "sourceId"); + return (Criteria) this; + } + + public Criteria andSourceIdNotIn(List values) { + addCriterion("source_id not in", values, "sourceId"); + return (Criteria) this; + } + + public Criteria andSourceIdBetween(Long value1, Long value2) { + addCriterion("source_id between", value1, value2, "sourceId"); + return (Criteria) this; + } + + public Criteria andSourceIdNotBetween(Long value1, Long value2) { + addCriterion("source_id not between", value1, value2, "sourceId"); + return (Criteria) this; + } + + public Criteria andSourceContentIsNull() { + addCriterion("source_content is null"); + return (Criteria) this; + } + + public Criteria andSourceContentIsNotNull() { + addCriterion("source_content is not null"); + return (Criteria) this; + } + + public Criteria andSourceContentEqualTo(String value) { + addCriterion("source_content =", value, "sourceContent"); + return (Criteria) this; + } + + public Criteria andSourceContentNotEqualTo(String value) { + addCriterion("source_content <>", value, "sourceContent"); + return (Criteria) this; + } + + public Criteria andSourceContentGreaterThan(String value) { + addCriterion("source_content >", value, "sourceContent"); + return (Criteria) this; + } + + public Criteria andSourceContentGreaterThanOrEqualTo(String value) { + addCriterion("source_content >=", value, "sourceContent"); + return (Criteria) this; + } + + public Criteria andSourceContentLessThan(String value) { + addCriterion("source_content <", value, "sourceContent"); + return (Criteria) this; + } + + public Criteria andSourceContentLessThanOrEqualTo(String value) { + addCriterion("source_content <=", value, "sourceContent"); + return (Criteria) this; + } + + public Criteria andSourceContentLike(String value) { + addCriterion("source_content like", value, "sourceContent"); + return (Criteria) this; + } + + public Criteria andSourceContentNotLike(String value) { + addCriterion("source_content not like", value, "sourceContent"); + return (Criteria) this; + } + + public Criteria andSourceContentIn(List values) { + addCriterion("source_content in", values, "sourceContent"); + return (Criteria) this; + } + + public Criteria andSourceContentNotIn(List values) { + addCriterion("source_content not in", values, "sourceContent"); + return (Criteria) this; + } + + public Criteria andSourceContentBetween(String value1, String value2) { + addCriterion("source_content between", value1, value2, "sourceContent"); + return (Criteria) this; + } + + public Criteria andSourceContentNotBetween(String value1, String value2) { + addCriterion("source_content not between", value1, value2, "sourceContent"); + 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 values) { + addCriterion("`status` in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotIn(List 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 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 values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List 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 andOpUserIdIsNull() { + addCriterion("op_user_id is null"); + return (Criteria) this; + } + + public Criteria andOpUserIdIsNotNull() { + addCriterion("op_user_id is not null"); + return (Criteria) this; + } + + public Criteria andOpUserIdEqualTo(Long value) { + addCriterion("op_user_id =", value, "opUserId"); + return (Criteria) this; + } + + public Criteria andOpUserIdNotEqualTo(Long value) { + addCriterion("op_user_id <>", value, "opUserId"); + return (Criteria) this; + } + + public Criteria andOpUserIdGreaterThan(Long value) { + addCriterion("op_user_id >", value, "opUserId"); + return (Criteria) this; + } + + public Criteria andOpUserIdGreaterThanOrEqualTo(Long value) { + addCriterion("op_user_id >=", value, "opUserId"); + return (Criteria) this; + } + + public Criteria andOpUserIdLessThan(Long value) { + addCriterion("op_user_id <", value, "opUserId"); + return (Criteria) this; + } + + public Criteria andOpUserIdLessThanOrEqualTo(Long value) { + addCriterion("op_user_id <=", value, "opUserId"); + return (Criteria) this; + } + + public Criteria andOpUserIdIn(List values) { + addCriterion("op_user_id in", values, "opUserId"); + return (Criteria) this; + } + + public Criteria andOpUserIdNotIn(List values) { + addCriterion("op_user_id not in", values, "opUserId"); + return (Criteria) this; + } + + public Criteria andOpUserIdBetween(Long value1, Long value2) { + addCriterion("op_user_id between", value1, value2, "opUserId"); + return (Criteria) this; + } + + public Criteria andOpUserIdNotBetween(Long value1, Long value2) { + addCriterion("op_user_id not between", value1, value2, "opUserId"); + return (Criteria) this; + } + + public Criteria andOpUserNameIsNull() { + addCriterion("op_user_name is null"); + return (Criteria) this; + } + + public Criteria andOpUserNameIsNotNull() { + addCriterion("op_user_name is not null"); + return (Criteria) this; + } + + public Criteria andOpUserNameEqualTo(String value) { + addCriterion("op_user_name =", value, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameNotEqualTo(String value) { + addCriterion("op_user_name <>", value, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameGreaterThan(String value) { + addCriterion("op_user_name >", value, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameGreaterThanOrEqualTo(String value) { + addCriterion("op_user_name >=", value, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameLessThan(String value) { + addCriterion("op_user_name <", value, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameLessThanOrEqualTo(String value) { + addCriterion("op_user_name <=", value, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameLike(String value) { + addCriterion("op_user_name like", value, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameNotLike(String value) { + addCriterion("op_user_name not like", value, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameIn(List values) { + addCriterion("op_user_name in", values, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameNotIn(List values) { + addCriterion("op_user_name not in", values, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameBetween(String value1, String value2) { + addCriterion("op_user_name between", value1, value2, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameNotBetween(String value1, String value2) { + addCriterion("op_user_name not between", value1, value2, "opUserName"); + 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 values) { + addCriterion("ext_1 in", values, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotIn(List 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 values) { + addCriterion("ext_2 in", values, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotIn(List 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 values) { + addCriterion("ext_3 in", values, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotIn(List 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); + } + } +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/entity/HighMerchantStoreExample.java b/hai-service/src/main/java/com/hai/entity/HighMerchantStoreExample.java index fca5750f..da9b80b5 100644 --- a/hai-service/src/main/java/com/hai/entity/HighMerchantStoreExample.java +++ b/hai-service/src/main/java/com/hai/entity/HighMerchantStoreExample.java @@ -1585,6 +1585,66 @@ public class HighMerchantStoreExample { return (Criteria) this; } + public Criteria andPrestoreTypeIsNull() { + addCriterion("prestore_type is null"); + return (Criteria) this; + } + + public Criteria andPrestoreTypeIsNotNull() { + addCriterion("prestore_type is not null"); + return (Criteria) this; + } + + public Criteria andPrestoreTypeEqualTo(Integer value) { + addCriterion("prestore_type =", value, "prestoreType"); + return (Criteria) this; + } + + public Criteria andPrestoreTypeNotEqualTo(Integer value) { + addCriterion("prestore_type <>", value, "prestoreType"); + return (Criteria) this; + } + + public Criteria andPrestoreTypeGreaterThan(Integer value) { + addCriterion("prestore_type >", value, "prestoreType"); + return (Criteria) this; + } + + public Criteria andPrestoreTypeGreaterThanOrEqualTo(Integer value) { + addCriterion("prestore_type >=", value, "prestoreType"); + return (Criteria) this; + } + + public Criteria andPrestoreTypeLessThan(Integer value) { + addCriterion("prestore_type <", value, "prestoreType"); + return (Criteria) this; + } + + public Criteria andPrestoreTypeLessThanOrEqualTo(Integer value) { + addCriterion("prestore_type <=", value, "prestoreType"); + return (Criteria) this; + } + + public Criteria andPrestoreTypeIn(List values) { + addCriterion("prestore_type in", values, "prestoreType"); + return (Criteria) this; + } + + public Criteria andPrestoreTypeNotIn(List values) { + addCriterion("prestore_type not in", values, "prestoreType"); + return (Criteria) this; + } + + public Criteria andPrestoreTypeBetween(Integer value1, Integer value2) { + addCriterion("prestore_type between", value1, value2, "prestoreType"); + return (Criteria) this; + } + + public Criteria andPrestoreTypeNotBetween(Integer value1, Integer value2) { + addCriterion("prestore_type not between", value1, value2, "prestoreType"); + return (Criteria) this; + } + public Criteria andOperatorIdIsNull() { addCriterion("operator_id is null"); return (Criteria) this; diff --git a/hai-service/src/main/java/com/hai/enum_type/MerStoreAmountSourceTypeEnum.java b/hai-service/src/main/java/com/hai/enum_type/MerStoreAmountSourceTypeEnum.java new file mode 100644 index 00000000..4437c29b --- /dev/null +++ b/hai-service/src/main/java/com/hai/enum_type/MerStoreAmountSourceTypeEnum.java @@ -0,0 +1,36 @@ +package com.hai.enum_type; + +/** + * 门店账户记录来源 + * @author hurui + */ +public enum MerStoreAmountSourceTypeEnum { + type1(1, "金额充值"), + type2(2, "订单消费"), + ; + + private Integer type; + + private String name; + + MerStoreAmountSourceTypeEnum(int type, String name) { + this.type = type; + this.name = name; + } + + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/hai-service/src/main/java/com/hai/enum_type/MerStoreAmountTypeEnum.java b/hai-service/src/main/java/com/hai/enum_type/MerStoreAmountTypeEnum.java new file mode 100644 index 00000000..b3d5f2ac --- /dev/null +++ b/hai-service/src/main/java/com/hai/enum_type/MerStoreAmountTypeEnum.java @@ -0,0 +1,36 @@ +package com.hai.enum_type; + +/** + * 公司 + * @author hurui + */ +public enum MerStoreAmountTypeEnum { + type1(1, "进账"), + type2(2, "出账") + ; + + private Integer type; + + private String name; + + MerStoreAmountTypeEnum(int type, String name) { + this.type = type; + this.name = name; + } + + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/hai-service/src/main/java/com/hai/service/HighMerchantStoreAccountRecordService.java b/hai-service/src/main/java/com/hai/service/HighMerchantStoreAccountRecordService.java new file mode 100644 index 00000000..325a549d --- /dev/null +++ b/hai-service/src/main/java/com/hai/service/HighMerchantStoreAccountRecordService.java @@ -0,0 +1,26 @@ +package com.hai.service; + +import com.hai.entity.HighMerchantStoreAccountRecord; + +import java.util.List; +import java.util.Map; + +/** + * 商户门店账户记录 + * @author hurui + */ +public interface HighMerchantStoreAccountRecordService { + + /** + * 编辑记录 + * @param record + */ + void editRecord(HighMerchantStoreAccountRecord record); + + /** + * 查询记录 + * @param param + * @return + */ + List getRecordList(Map param); +} diff --git a/hai-service/src/main/java/com/hai/service/HighMerchantStoreAccountService.java b/hai-service/src/main/java/com/hai/service/HighMerchantStoreAccountService.java new file mode 100644 index 00000000..d00bb894 --- /dev/null +++ b/hai-service/src/main/java/com/hai/service/HighMerchantStoreAccountService.java @@ -0,0 +1,42 @@ +package com.hai.service; + +import com.hai.entity.HighMerchantStoreAccount; + +import java.math.BigDecimal; +import java.util.Map; + +/** + * 门店账户 + * @author hurui + */ +public interface HighMerchantStoreAccountService { + + /** + * 编辑门店账户 + * @param merchantStoreAccount + */ + void editStoreAccount(HighMerchantStoreAccount merchantStoreAccount); + + /** + * 查询门店账户 + * @param storeId + * @return + */ + HighMerchantStoreAccount getStoreAccountDetail(Long storeId); + + /** + * 进账 + * @param storeId 门店id + * @param amount 金额 + */ + void recharge(Long storeId, BigDecimal amount, Map otherParam); + + /** + * 出账 + * @param storeId 门店id + * @param amount 金额 + * @param otherParam 其他参数 + */ + void consume(Long storeId, BigDecimal amount, Map otherParam); + +} diff --git a/hai-service/src/main/java/com/hai/service/impl/HighMerchantStoreAccountRecordServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighMerchantStoreAccountRecordServiceImpl.java new file mode 100644 index 00000000..29b00a6a --- /dev/null +++ b/hai-service/src/main/java/com/hai/service/impl/HighMerchantStoreAccountRecordServiceImpl.java @@ -0,0 +1,64 @@ +package com.hai.service.impl; + +import com.hai.dao.HighMerchantStoreAccountRecordMapper; +import com.hai.entity.HighMerchantStoreAccountRecord; +import com.hai.entity.HighMerchantStoreAccountRecordExample; +import com.hai.service.HighMerchantStoreAccountRecordService; +import org.apache.commons.collections4.MapUtils; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.Date; +import java.util.List; +import java.util.Map; + +@Service("merStoreAccountRecordService") +public class HighMerchantStoreAccountRecordServiceImpl implements HighMerchantStoreAccountRecordService { + + @Resource + private HighMerchantStoreAccountRecordMapper accountRecordMapper; + + @Override + public void editRecord(HighMerchantStoreAccountRecord record) { + if (record.getId() == null) { + record.setCreateTime(new Date()); + record.setStatus(1); + accountRecordMapper.insert(record); + } else { + accountRecordMapper.updateByPrimaryKey(record); + } + } + + @Override + public List getRecordList(Map param) { + HighMerchantStoreAccountRecordExample example = new HighMerchantStoreAccountRecordExample(); + HighMerchantStoreAccountRecordExample.Criteria criteria = example.createCriteria().andStatusEqualTo(1); + + if (MapUtils.getLong(param, "storeAmountId") != null) { + criteria.andStoreAmountIdEqualTo(MapUtils.getLong(param, "storeAmountId")); + } + + if (MapUtils.getLong(param, "storeId") != null) { + criteria.andStoreIdEqualTo(MapUtils.getLong(param, "storeId")); + } + + if (MapUtils.getInteger(param, "type") != null) { + criteria.andTypeEqualTo(MapUtils.getInteger(param, "type")); + } + + if (MapUtils.getInteger(param, "sourceType") != null) { + criteria.andTypeEqualTo(MapUtils.getInteger(param, "sourceType")); + } + + if (MapUtils.getLong(param, "createTimeS") != null) { + criteria.andCreateTimeGreaterThanOrEqualTo(new Date(MapUtils.getLong(param, "createTimeS"))); + } + + if (MapUtils.getLong(param, "createTimeE") != null) { + criteria.andCreateTimeLessThanOrEqualTo(new Date(MapUtils.getLong(param, "createTimeE"))); + } + + example.setOrderByClause("create_time desc"); + return accountRecordMapper.selectByExample(example); + } +} diff --git a/hai-service/src/main/java/com/hai/service/impl/HighMerchantStoreAccountServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighMerchantStoreAccountServiceImpl.java new file mode 100644 index 00000000..50908977 --- /dev/null +++ b/hai-service/src/main/java/com/hai/service/impl/HighMerchantStoreAccountServiceImpl.java @@ -0,0 +1,179 @@ +package com.hai.service.impl; + +import com.hai.common.exception.ErrorCode; +import com.hai.common.exception.ErrorHelp; +import com.hai.common.exception.SysCode; +import com.hai.common.security.UserCenter; +import com.hai.common.utils.BankNumberUtil; +import com.hai.dao.HighMerchantStoreAccountMapper; +import com.hai.entity.*; +import com.hai.enum_type.MerStoreAmountTypeEnum; +import com.hai.model.HighMerchantModel; +import com.hai.model.HighMerchantStoreModel; +import com.hai.model.UserInfoModel; +import com.hai.service.HighMerchantService; +import com.hai.service.HighMerchantStoreAccountRecordService; +import com.hai.service.HighMerchantStoreAccountService; +import com.hai.service.HighMerchantStoreService; +import org.apache.commons.collections4.MapUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Isolation; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; +import java.util.Map; + +@Service("merchantStoreAccountService") +public class HighMerchantStoreAccountServiceImpl implements HighMerchantStoreAccountService { + + @Resource + private HighMerchantStoreAccountMapper merchantStoreAccountMapper; + + @Resource + private HighMerchantService merchantService; + + @Resource + private HighMerchantStoreService merchantStoreService; + + @Resource + private HighMerchantStoreAccountRecordService merchantStoreAccountRecordService; + + @Resource + private UserCenter userCenter; + + @Override + public void editStoreAccount(HighMerchantStoreAccount merchantStoreAccount) { + if (merchantStoreAccount.getId() == null) { + merchantStoreAccount.setAccountNo(BankNumberUtil.getBrankNumber("6")); + merchantStoreAccount.setCreateTime(new Date()); + merchantStoreAccount.setUpdateTime(new Date()); + merchantStoreAccount.setStatus(1); + merchantStoreAccountMapper.insert(merchantStoreAccount); + } else { + merchantStoreAccount.setUpdateTime(new Date()); + merchantStoreAccountMapper.updateByPrimaryKey(merchantStoreAccount); + } + } + + @Override + public HighMerchantStoreAccount getStoreAccountDetail(Long storeId) { + HighMerchantStoreAccountExample example = new HighMerchantStoreAccountExample(); + example.createCriteria().andStatusEqualTo(1).andStoreIdEqualTo(storeId); + List list = merchantStoreAccountMapper.selectByExample(example); + if (list.size() > 0) { + return list.get(0); + } + return null; + } + + @Override + @Transactional(rollbackFor=Exception.class,isolation = Isolation.SERIALIZABLE,propagation= Propagation.REQUIRES_NEW) + public void recharge(Long storeId, BigDecimal amount, Map otherParam) { + // 查询门店 + HighMerchantStoreModel store = merchantStoreService.getMerchantStoreById(storeId); + if (store == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的门店"); + } + // 预存类型 0:非预存 1:预存 + if (!store.getPrestoreType().equals(1)) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "门店不属于预存类型"); + } + // 查询商户 + HighMerchantModel merchant = merchantService.getMerchantById(store.getMerchantId()); + if (merchant == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的商户"); + } + // 操作人 + UserInfoModel sessionModel = userCenter.getSessionModel(UserInfoModel.class); + if (sessionModel == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知用户"); + } + // 是否开通了账户 + HighMerchantStoreAccount account = getStoreAccountDetail(storeId); + if (account == null) { + account = new HighMerchantStoreAccount(); + account.setStoreId(storeId); + account.setAmounts(new BigDecimal("0")); + } + // 变更前金额 + BigDecimal beforeAmount = account.getAmounts(); + // 计算金额 + account.setAmounts(account.getAmounts().add(amount)); + // 变更后金额 + BigDecimal afterAmount = account.getAmounts(); + editStoreAccount(account); + + HighMerchantStoreAccountRecord record = new HighMerchantStoreAccountRecord(); + record.setStoreAmountId(account.getId()); + record.setMerId(merchant.getId()); + record.setMerName(merchant.getMerchantName()); + record.setStoreId(store.getId()); + record.setStoreName(store.getStoreName()); + record.setAmount(amount); + record.setBeforeAmount(beforeAmount); + record.setAfterAmount(afterAmount); + record.setType(MerStoreAmountTypeEnum.type1.getType()); + record.setSourceType(MapUtils.getInteger(otherParam, "sourceType")); + record.setSourceId(MapUtils.getLong(otherParam, "sourceId")); + record.setSourceContent(MapUtils.getString(otherParam, "sourceContent")); + record.setOpUserId(sessionModel.getSecUser().getId()); + record.setOpUserName(sessionModel.getSecUser().getUserName()); + merchantStoreAccountRecordService.editRecord(record); + } + + @Override + @Transactional(rollbackFor=Exception.class,isolation = Isolation.SERIALIZABLE,propagation= Propagation.REQUIRES_NEW) + public void consume(Long storeId, BigDecimal amount, Map otherParam) { + // 查询门店 + HighMerchantStoreModel store = merchantStoreService.getMerchantStoreById(storeId); + if (store == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的门店"); + } + // 查询商户 + HighMerchantModel merchant = merchantService.getMerchantById(store.getMerchantId()); + if (merchant == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的商户"); + } + // 操作人 + UserInfoModel sessionModel = userCenter.getSessionModel(UserInfoModel.class); + if (sessionModel == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知用户"); + } + // 是否开通了账户 + HighMerchantStoreAccount account = getStoreAccountDetail(storeId); + if (account == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "余额不足"); + } + // 账户余额 是否小于 出账余额 + if (account.getAmounts().compareTo(amount) == -1) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "余额不足"); + } + + // 变更前金额 + BigDecimal beforeAmount = account.getAmounts(); + // 计算金额 + account.setAmounts(account.getAmounts().subtract(amount)); + // 变更后金额 + BigDecimal afterAmount = account.getAmounts(); + editStoreAccount(account); + + HighMerchantStoreAccountRecord record = new HighMerchantStoreAccountRecord(); + record.setStoreAmountId(account.getId()); + record.setMerId(merchant.getId()); + record.setMerName(merchant.getMerchantName()); + record.setAmount(amount); + record.setBeforeAmount(beforeAmount); + record.setAfterAmount(afterAmount); + record.setType(MerStoreAmountTypeEnum.type2.getType()); + record.setSourceType(MapUtils.getInteger(otherParam, "sourceType")); + record.setSourceId(MapUtils.getLong(otherParam, "sourceId")); + record.setSourceContent(MapUtils.getString(otherParam, "sourceContent")); + record.setOpUserId(sessionModel.getSecUser().getId()); + record.setOpUserName(sessionModel.getSecUser().getUserName()); + merchantStoreAccountRecordService.editRecord(record); + } +} diff --git a/hai-service/src/main/java/com/hai/service/pay/impl/GoodsOrderServiceImpl.java b/hai-service/src/main/java/com/hai/service/pay/impl/GoodsOrderServiceImpl.java index c592db72..9af93272 100644 --- a/hai-service/src/main/java/com/hai/service/pay/impl/GoodsOrderServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/pay/impl/GoodsOrderServiceImpl.java @@ -271,38 +271,47 @@ public class GoodsOrderServiceImpl implements PayService { if (highChildOrder.getGoodsType() == 3) { highChildOrder.setChildOrdeStatus(3); HighMerchantStoreModel store = highMerchantStoreService.getMerchantStoreById(highChildOrder.getGoodsId()); - // 推送团油订单 - Map paramMap = new HashMap<>(); - paramMap.put("gasId", store.getStoreKey()); - paramMap.put("oilNo", highChildOrder.getGasOilNo()); - paramMap.put("gunNo", highChildOrder.getGasGunNo()); - BigDecimal priceGun = highChildOrder.getGasPriceGun(); - BigDecimal priceVip = highChildOrder.getGasPriceVip(); - paramMap.put("priceGun", priceGun); // 枪单价 - paramMap.put("priceVip", priceVip); // 优惠价 - paramMap.put("driverPhone", order.getMemPhone()); - paramMap.put("thirdSerialNo", order.getOrderNo()); - paramMap.put("refuelingAmount", highChildOrder.getTotalPrice()); - - // 油品类型 1:汽油:2:柴油;3:天然气 - if (highChildOrder.getGasOilType() == 1) { - paramMap.put("accountNo", CommonSysConst.getSysConfig().getTuanYouGasolineAccount()); - } else if (highChildOrder.getGasOilType() == 2) { - paramMap.put("accountNo", CommonSysConst.getSysConfig().getTuanYouDieselAccount()); - } - JSONObject orderPushObject = TuanYouConfig.refuelingOrderPush(paramMap); - // 推送团油订单记录 - HighGasOrderPush highGasOrderPush = new HighGasOrderPush(); - highGasOrderPush.setType(OrderPushType.type1.getType()); - highGasOrderPush.setOrderNo(order.getOrderNo()); - highGasOrderPush.setCreateTime(new Date()); - highGasOrderPush.setCode(orderPushObject.getString("code")); - highGasOrderPush.setRequestContent(JSONObject.toJSONString(paramMap)); - highGasOrderPush.setReturnContent(orderPushObject.toJSONString()); - highGasOrderPushMapper.insert(highGasOrderPush); - - if (orderPushObject != null && orderPushObject.getString("code").equals("200")) { - highChildOrder.setGasOrderNo(orderPushObject.getJSONObject("result").getString("orderNo")); + + // 来源类型 1:平台自建 2:团油 + if (store.getSourceType().equals(1)) { + // 预存类型 0:非预存 1:预存门店 + if (store.getPrestoreType() != null && store.getPrestoreType().equals(1)) { + + } + } else if (store.getSourceType().equals(2)) { + // 推送团油订单 + Map paramMap = new HashMap<>(); + paramMap.put("gasId", store.getStoreKey()); + paramMap.put("oilNo", highChildOrder.getGasOilNo()); + paramMap.put("gunNo", highChildOrder.getGasGunNo()); + BigDecimal priceGun = highChildOrder.getGasPriceGun(); + BigDecimal priceVip = highChildOrder.getGasPriceVip(); + paramMap.put("priceGun", priceGun); // 枪单价 + paramMap.put("priceVip", priceVip); // 优惠价 + paramMap.put("driverPhone", order.getMemPhone()); + paramMap.put("thirdSerialNo", order.getOrderNo()); + paramMap.put("refuelingAmount", highChildOrder.getTotalPrice()); + + // 油品类型 1:汽油:2:柴油;3:天然气 + if (highChildOrder.getGasOilType() == 1) { + paramMap.put("accountNo", CommonSysConst.getSysConfig().getTuanYouGasolineAccount()); + } else if (highChildOrder.getGasOilType() == 2) { + paramMap.put("accountNo", CommonSysConst.getSysConfig().getTuanYouDieselAccount()); + } + JSONObject orderPushObject = TuanYouConfig.refuelingOrderPush(paramMap); + // 推送团油订单记录 + HighGasOrderPush highGasOrderPush = new HighGasOrderPush(); + highGasOrderPush.setType(OrderPushType.type1.getType()); + highGasOrderPush.setOrderNo(order.getOrderNo()); + highGasOrderPush.setCreateTime(new Date()); + highGasOrderPush.setCode(orderPushObject.getString("code")); + highGasOrderPush.setRequestContent(JSONObject.toJSONString(paramMap)); + highGasOrderPush.setReturnContent(orderPushObject.toJSONString()); + highGasOrderPushMapper.insert(highGasOrderPush); + + if (orderPushObject != null && orderPushObject.getString("code").equals("200")) { + highChildOrder.setGasOrderNo(orderPushObject.getJSONObject("result").getString("orderNo")); + } } }