parent
ab3b53c7e8
commit
995a3aef4c
@ -0,0 +1,116 @@ |
||||
package com.bweb.controller; |
||||
|
||||
import com.alibaba.fastjson.JSONObject; |
||||
import com.github.pagehelper.PageHelper; |
||||
import com.github.pagehelper.PageInfo; |
||||
import com.hfkj.common.exception.ErrorCode; |
||||
import com.hfkj.common.exception.ErrorHelp; |
||||
import com.hfkj.common.exception.SysCode; |
||||
import com.hfkj.common.security.UserCenter; |
||||
import com.hfkj.common.utils.ResponseMsgUtil; |
||||
import com.hfkj.entity.BsAgentMerAccount; |
||||
import com.hfkj.entity.BsAgentStaff; |
||||
import com.hfkj.entity.BsMerchantChainBrand; |
||||
import com.hfkj.entity.BsMerchantChainBrandAccount; |
||||
import com.hfkj.model.ResponseData; |
||||
import com.hfkj.model.SecUserSessionObject; |
||||
import com.hfkj.service.merchant.BsMerchantChainBrandAccountRecordService; |
||||
import com.hfkj.service.merchant.BsMerchantChainBrandAccountService; |
||||
import com.hfkj.service.merchant.BsMerchantChainBrandService; |
||||
import com.hfkj.sysenum.SecUserObjectTypeEnum; |
||||
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.stereotype.Controller; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
import javax.annotation.Resource; |
||||
import java.util.HashMap; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* @className: BsMerchantChainBrandController |
||||
* @author: HuRui |
||||
* @date: 2024/8/15 |
||||
**/ |
||||
@Controller |
||||
@RequestMapping(value = "/merchantChainBrandAccount") |
||||
@Api(value = "商户连锁管理") |
||||
public class BsMerchantChainBrandAccountController { |
||||
private static Logger log = LoggerFactory.getLogger(BsMerchantChainBrandAccountController.class); |
||||
@Resource |
||||
private BsMerchantChainBrandAccountService merchantChainBrandAccountService; |
||||
@Resource |
||||
private BsMerchantChainBrandAccountRecordService merchantChainBrandAccountRecordService; |
||||
@Resource |
||||
private UserCenter userCenter; |
||||
|
||||
@RequestMapping(value = "/getAccount", method = RequestMethod.GET) |
||||
@ResponseBody |
||||
@ApiOperation(value = "查询账户") |
||||
public ResponseData getAccount(@RequestParam(value = "chainBrandId", required = true) Long chainBrandId) { |
||||
try { |
||||
// 查询账户
|
||||
return ResponseMsgUtil.success(merchantChainBrandAccountService.getAccount(chainBrandId)); |
||||
|
||||
} catch (Exception e) { |
||||
log.error("BsMerchantChainBrandAccountController --> getAccount() error!", e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
@RequestMapping(value = "/recharge", method = RequestMethod.POST) |
||||
@ResponseBody |
||||
@ApiOperation(value = "充值") |
||||
public ResponseData recharge(@RequestBody JSONObject body) { |
||||
try { |
||||
SecUserSessionObject userSession = userCenter.getSessionModel(SecUserSessionObject.class); |
||||
if (SecUserObjectTypeEnum.type1.getCode() != userSession.getAccount().getObjectType()) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.ROLE_NOT_PERMISSIONS, ""); |
||||
} |
||||
if (body == null |
||||
|| body.getLong("chainBrandId") == null |
||||
|| body.getBigDecimal("amount") == null |
||||
) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); |
||||
} |
||||
|
||||
// 账户充值
|
||||
merchantChainBrandAccountService.recharge(body.getLong("chainBrandId"), body.getBigDecimal("amount")); |
||||
|
||||
return ResponseMsgUtil.success("操作成功"); |
||||
|
||||
} catch (Exception e) { |
||||
log.error("BsMerchantChainBrandAccountController --> recharge() error!", e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
@RequestMapping(value = "/getRecordList", method = RequestMethod.GET) |
||||
@ResponseBody |
||||
@ApiOperation(value = "记录列表") |
||||
public ResponseData getRecordList(@RequestParam(value = "chainBrandId", required = true) Long chainBrandId, |
||||
@RequestParam(value = "merNo", required = false) String merNo, |
||||
@RequestParam(value = "pageNum", required = true) Integer pageNum, |
||||
@RequestParam(value = "pageSize", required = true) Integer pageSize) { |
||||
try { |
||||
|
||||
// 查询账户
|
||||
BsMerchantChainBrandAccount account = merchantChainBrandAccountService.getAccount(chainBrandId); |
||||
|
||||
Map<String,Object> param = new HashMap<>(); |
||||
param.put("merChainBrandAccountId", account.getId()); |
||||
param.put("merNo", merNo); |
||||
|
||||
PageHelper.startPage(pageNum,pageSize); |
||||
return ResponseMsgUtil.success(new PageInfo<>(merchantChainBrandAccountRecordService.getList(param))); |
||||
|
||||
} catch (Exception e) { |
||||
log.error("BsMerchantChainBrandAccountController --> getRecordList() error!", e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,122 @@ |
||||
package com.bweb.controller; |
||||
|
||||
import com.github.pagehelper.PageHelper; |
||||
import com.github.pagehelper.PageInfo; |
||||
import com.hfkj.common.exception.ErrorCode; |
||||
import com.hfkj.common.exception.ErrorHelp; |
||||
import com.hfkj.common.exception.SysCode; |
||||
import com.hfkj.common.utils.ResponseMsgUtil; |
||||
import com.hfkj.entity.BsMerchantChainBrand; |
||||
import com.hfkj.model.ResponseData; |
||||
import com.hfkj.service.merchant.BsMerchantChainBrandAccountService; |
||||
import com.hfkj.service.merchant.BsMerchantChainBrandService; |
||||
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.stereotype.Controller; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
import javax.annotation.Resource; |
||||
import java.util.HashMap; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* @className: BsMerchantChainBrandController |
||||
* @author: HuRui |
||||
* @date: 2024/8/14 |
||||
**/ |
||||
@Controller |
||||
@RequestMapping(value = "/merchantChainBrand") |
||||
@Api(value = "商户连锁管理") |
||||
public class BsMerchantChainBrandController { |
||||
private static Logger log = LoggerFactory.getLogger(BsMerchantChainBrandController.class); |
||||
@Resource |
||||
private BsMerchantChainBrandService merchantChainBrandService; |
||||
@Resource |
||||
private BsMerchantChainBrandAccountService merchantChainBrandAccountService; |
||||
|
||||
@RequestMapping(value = "/editChainBrand", method = RequestMethod.POST) |
||||
@ResponseBody |
||||
@ApiOperation(value = "编辑商户连锁") |
||||
public ResponseData editChainBrand(@RequestBody BsMerchantChainBrand body) { |
||||
try { |
||||
if (body == null |
||||
|| StringUtils.isBlank(body.getName()) |
||||
|| StringUtils.isBlank(body.getContactsName()) |
||||
|| StringUtils.isBlank(body.getContactsTelephone()) |
||||
) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); |
||||
} |
||||
|
||||
BsMerchantChainBrand chainBrand; |
||||
if (body.getId() != null) { |
||||
// 查询商户连锁
|
||||
chainBrand = merchantChainBrandService.getDetail(body.getId()); |
||||
if (chainBrand == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到数据"); |
||||
} |
||||
} else { |
||||
chainBrand = new BsMerchantChainBrand(); |
||||
chainBrand.setStatus(1); |
||||
} |
||||
chainBrand.setName(body.getName()); |
||||
chainBrand.setContactsName(body.getContactsName()); |
||||
chainBrand.setContactsTelephone(body.getContactsTelephone()); |
||||
if (body.getId() != null) { |
||||
merchantChainBrandService.update(chainBrand); |
||||
} else { |
||||
merchantChainBrandService.create(chainBrand); |
||||
} |
||||
return ResponseMsgUtil.success("操作成功"); |
||||
|
||||
} catch (Exception e) { |
||||
log.error("BsMerchantChainBrandController --> editChainBrand() error!", e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
|
||||
@RequestMapping(value = "/getDetail", method = RequestMethod.GET) |
||||
@ResponseBody |
||||
@ApiOperation(value = "查询") |
||||
public ResponseData getDetail(@RequestParam(name = "id", required = true) Long id) { |
||||
try { |
||||
// 查询商户连锁
|
||||
BsMerchantChainBrand chainBrand = merchantChainBrandService.getDetail(id); |
||||
if (chainBrand == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到数据"); |
||||
} |
||||
Map<String,Object> param = new HashMap<>(); |
||||
param.put("chainBrand", chainBrand); |
||||
param.put("account", merchantChainBrandAccountService.getAccount(chainBrand.getId())); |
||||
return ResponseMsgUtil.success(param); |
||||
|
||||
} catch (Exception e) { |
||||
log.error("BsMerchantChainBrandController --> editChainBrand() error!", e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
|
||||
@RequestMapping(value = "/getList", method = RequestMethod.GET) |
||||
@ResponseBody |
||||
@ApiOperation(value = "查询商户连锁列表") |
||||
public ResponseData getList(@RequestParam(name = "name", required = false) String name, |
||||
@RequestParam(name = "pageNum", required = true) Integer pageNum, |
||||
@RequestParam(name = "pageSize", required = true) Integer pageSize) { |
||||
try { |
||||
Map<String,Object> param = new HashMap<>(); |
||||
param.put("name", name); |
||||
|
||||
PageHelper.startPage(pageNum,pageSize); |
||||
return ResponseMsgUtil.success(new PageInfo<>(merchantChainBrandService.getList(param))); |
||||
|
||||
} catch (Exception e) { |
||||
log.error("BsMerchantChainBrandController --> getList() error!", e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,117 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
import com.hfkj.entity.BsMerchantChainBrandAccount; |
||||
import com.hfkj.entity.BsMerchantChainBrandAccountExample; |
||||
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 BsMerchantChainBrandAccountMapper extends BsMerchantChainBrandAccountMapperExt { |
||||
@SelectProvider(type=BsMerchantChainBrandAccountSqlProvider.class, method="countByExample") |
||||
long countByExample(BsMerchantChainBrandAccountExample example); |
||||
|
||||
@DeleteProvider(type=BsMerchantChainBrandAccountSqlProvider.class, method="deleteByExample") |
||||
int deleteByExample(BsMerchantChainBrandAccountExample example); |
||||
|
||||
@Delete({ |
||||
"delete from bs_merchant_chain_brand_account", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
int deleteByPrimaryKey(Long id); |
||||
|
||||
@Insert({ |
||||
"insert into bs_merchant_chain_brand_account (mer_chain_brand_id, amount, ", |
||||
"amount_consume, `status`, ", |
||||
"create_time, update_time, ", |
||||
"ext_1, ext_2, ext_3)", |
||||
"values (#{merChainBrandId,jdbcType=BIGINT}, #{amount,jdbcType=DECIMAL}, ", |
||||
"#{amountConsume,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(BsMerchantChainBrandAccount record); |
||||
|
||||
@InsertProvider(type=BsMerchantChainBrandAccountSqlProvider.class, method="insertSelective") |
||||
@Options(useGeneratedKeys=true,keyProperty="id") |
||||
int insertSelective(BsMerchantChainBrandAccount record); |
||||
|
||||
@SelectProvider(type=BsMerchantChainBrandAccountSqlProvider.class, method="selectByExample") |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), |
||||
@Result(column="mer_chain_brand_id", property="merChainBrandId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="amount", property="amount", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="amount_consume", property="amountConsume", 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<BsMerchantChainBrandAccount> selectByExample(BsMerchantChainBrandAccountExample example); |
||||
|
||||
@Select({ |
||||
"select", |
||||
"id, mer_chain_brand_id, amount, amount_consume, `status`, create_time, update_time, ", |
||||
"ext_1, ext_2, ext_3", |
||||
"from bs_merchant_chain_brand_account", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), |
||||
@Result(column="mer_chain_brand_id", property="merChainBrandId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="amount", property="amount", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="amount_consume", property="amountConsume", 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) |
||||
}) |
||||
BsMerchantChainBrandAccount selectByPrimaryKey(Long id); |
||||
|
||||
@UpdateProvider(type=BsMerchantChainBrandAccountSqlProvider.class, method="updateByExampleSelective") |
||||
int updateByExampleSelective(@Param("record") BsMerchantChainBrandAccount record, @Param("example") BsMerchantChainBrandAccountExample example); |
||||
|
||||
@UpdateProvider(type=BsMerchantChainBrandAccountSqlProvider.class, method="updateByExample") |
||||
int updateByExample(@Param("record") BsMerchantChainBrandAccount record, @Param("example") BsMerchantChainBrandAccountExample example); |
||||
|
||||
@UpdateProvider(type=BsMerchantChainBrandAccountSqlProvider.class, method="updateByPrimaryKeySelective") |
||||
int updateByPrimaryKeySelective(BsMerchantChainBrandAccount record); |
||||
|
||||
@Update({ |
||||
"update bs_merchant_chain_brand_account", |
||||
"set mer_chain_brand_id = #{merChainBrandId,jdbcType=BIGINT},", |
||||
"amount = #{amount,jdbcType=DECIMAL},", |
||||
"amount_consume = #{amountConsume,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(BsMerchantChainBrandAccount record); |
||||
} |
@ -0,0 +1,7 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
/** |
||||
* mapper扩展类 |
||||
*/ |
||||
public interface BsMerchantChainBrandAccountMapperExt { |
||||
} |
@ -0,0 +1,167 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
import com.hfkj.entity.BsMerchantChainBrandAccountRecord; |
||||
import com.hfkj.entity.BsMerchantChainBrandAccountRecordExample; |
||||
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 BsMerchantChainBrandAccountRecordMapper extends BsMerchantChainBrandAccountRecordMapperExt { |
||||
@SelectProvider(type=BsMerchantChainBrandAccountRecordSqlProvider.class, method="countByExample") |
||||
long countByExample(BsMerchantChainBrandAccountRecordExample example); |
||||
|
||||
@DeleteProvider(type=BsMerchantChainBrandAccountRecordSqlProvider.class, method="deleteByExample") |
||||
int deleteByExample(BsMerchantChainBrandAccountRecordExample example); |
||||
|
||||
@Delete({ |
||||
"delete from bs_merchant_chain_brand_account_record", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
int deleteByPrimaryKey(Long id); |
||||
|
||||
@Insert({ |
||||
"insert into bs_merchant_chain_brand_account_record (mer_chain_brand_account_id, mer_id, ", |
||||
"mer_no, mer_name, ", |
||||
"`type`, transaction_amount, ", |
||||
"before_amount, after_amount, ", |
||||
"source_type, source_id, ", |
||||
"source_order_no, source_content, ", |
||||
"`status`, create_time, ", |
||||
"op_user_type, op_user_id, ", |
||||
"op_user_name, op_user_phone, ", |
||||
"ext_1, ext_2, ext_3)", |
||||
"values (#{merChainBrandAccountId,jdbcType=BIGINT}, #{merId,jdbcType=BIGINT}, ", |
||||
"#{merNo,jdbcType=VARCHAR}, #{merName,jdbcType=VARCHAR}, ", |
||||
"#{type,jdbcType=INTEGER}, #{transactionAmount,jdbcType=DECIMAL}, ", |
||||
"#{beforeAmount,jdbcType=DECIMAL}, #{afterAmount,jdbcType=DECIMAL}, ", |
||||
"#{sourceType,jdbcType=INTEGER}, #{sourceId,jdbcType=BIGINT}, ", |
||||
"#{sourceOrderNo,jdbcType=VARCHAR}, #{sourceContent,jdbcType=VARCHAR}, ", |
||||
"#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ", |
||||
"#{opUserType,jdbcType=INTEGER}, #{opUserId,jdbcType=BIGINT}, ", |
||||
"#{opUserName,jdbcType=VARCHAR}, #{opUserPhone,jdbcType=VARCHAR}, ", |
||||
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" |
||||
}) |
||||
@Options(useGeneratedKeys=true,keyProperty="id") |
||||
int insert(BsMerchantChainBrandAccountRecord record); |
||||
|
||||
@InsertProvider(type=BsMerchantChainBrandAccountRecordSqlProvider.class, method="insertSelective") |
||||
@Options(useGeneratedKeys=true,keyProperty="id") |
||||
int insertSelective(BsMerchantChainBrandAccountRecord record); |
||||
|
||||
@SelectProvider(type=BsMerchantChainBrandAccountRecordSqlProvider.class, method="selectByExample") |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), |
||||
@Result(column="mer_chain_brand_account_id", property="merChainBrandAccountId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="mer_no", property="merNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="type", property="type", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="transaction_amount", property="transactionAmount", 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_order_no", property="sourceOrderNo", jdbcType=JdbcType.VARCHAR), |
||||
@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_type", property="opUserType", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="op_user_id", property="opUserId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="op_user_name", property="opUserName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="op_user_phone", property="opUserPhone", 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<BsMerchantChainBrandAccountRecord> selectByExample(BsMerchantChainBrandAccountRecordExample example); |
||||
|
||||
@Select({ |
||||
"select", |
||||
"id, mer_chain_brand_account_id, mer_id, mer_no, mer_name, `type`, transaction_amount, ", |
||||
"before_amount, after_amount, source_type, source_id, source_order_no, source_content, ", |
||||
"`status`, create_time, op_user_type, op_user_id, op_user_name, op_user_phone, ", |
||||
"ext_1, ext_2, ext_3", |
||||
"from bs_merchant_chain_brand_account_record", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), |
||||
@Result(column="mer_chain_brand_account_id", property="merChainBrandAccountId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="mer_no", property="merNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="type", property="type", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="transaction_amount", property="transactionAmount", 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_order_no", property="sourceOrderNo", jdbcType=JdbcType.VARCHAR), |
||||
@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_type", property="opUserType", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="op_user_id", property="opUserId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="op_user_name", property="opUserName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="op_user_phone", property="opUserPhone", 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) |
||||
}) |
||||
BsMerchantChainBrandAccountRecord selectByPrimaryKey(Long id); |
||||
|
||||
@UpdateProvider(type=BsMerchantChainBrandAccountRecordSqlProvider.class, method="updateByExampleSelective") |
||||
int updateByExampleSelective(@Param("record") BsMerchantChainBrandAccountRecord record, @Param("example") BsMerchantChainBrandAccountRecordExample example); |
||||
|
||||
@UpdateProvider(type=BsMerchantChainBrandAccountRecordSqlProvider.class, method="updateByExample") |
||||
int updateByExample(@Param("record") BsMerchantChainBrandAccountRecord record, @Param("example") BsMerchantChainBrandAccountRecordExample example); |
||||
|
||||
@UpdateProvider(type=BsMerchantChainBrandAccountRecordSqlProvider.class, method="updateByPrimaryKeySelective") |
||||
int updateByPrimaryKeySelective(BsMerchantChainBrandAccountRecord record); |
||||
|
||||
@Update({ |
||||
"update bs_merchant_chain_brand_account_record", |
||||
"set mer_chain_brand_account_id = #{merChainBrandAccountId,jdbcType=BIGINT},", |
||||
"mer_id = #{merId,jdbcType=BIGINT},", |
||||
"mer_no = #{merNo,jdbcType=VARCHAR},", |
||||
"mer_name = #{merName,jdbcType=VARCHAR},", |
||||
"`type` = #{type,jdbcType=INTEGER},", |
||||
"transaction_amount = #{transactionAmount,jdbcType=DECIMAL},", |
||||
"before_amount = #{beforeAmount,jdbcType=DECIMAL},", |
||||
"after_amount = #{afterAmount,jdbcType=DECIMAL},", |
||||
"source_type = #{sourceType,jdbcType=INTEGER},", |
||||
"source_id = #{sourceId,jdbcType=BIGINT},", |
||||
"source_order_no = #{sourceOrderNo,jdbcType=VARCHAR},", |
||||
"source_content = #{sourceContent,jdbcType=VARCHAR},", |
||||
"`status` = #{status,jdbcType=INTEGER},", |
||||
"create_time = #{createTime,jdbcType=TIMESTAMP},", |
||||
"op_user_type = #{opUserType,jdbcType=INTEGER},", |
||||
"op_user_id = #{opUserId,jdbcType=BIGINT},", |
||||
"op_user_name = #{opUserName,jdbcType=VARCHAR},", |
||||
"op_user_phone = #{opUserPhone,jdbcType=VARCHAR},", |
||||
"ext_1 = #{ext1,jdbcType=VARCHAR},", |
||||
"ext_2 = #{ext2,jdbcType=VARCHAR},", |
||||
"ext_3 = #{ext3,jdbcType=VARCHAR}", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
int updateByPrimaryKey(BsMerchantChainBrandAccountRecord record); |
||||
} |
@ -0,0 +1,7 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
/** |
||||
* mapper扩展类 |
||||
*/ |
||||
public interface BsMerchantChainBrandAccountRecordMapperExt { |
||||
} |
@ -0,0 +1,472 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
import com.hfkj.entity.BsMerchantChainBrandAccountRecord; |
||||
import com.hfkj.entity.BsMerchantChainBrandAccountRecordExample.Criteria; |
||||
import com.hfkj.entity.BsMerchantChainBrandAccountRecordExample.Criterion; |
||||
import com.hfkj.entity.BsMerchantChainBrandAccountRecordExample; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import org.apache.ibatis.jdbc.SQL; |
||||
|
||||
public class BsMerchantChainBrandAccountRecordSqlProvider { |
||||
|
||||
public String countByExample(BsMerchantChainBrandAccountRecordExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.SELECT("count(*)").FROM("bs_merchant_chain_brand_account_record"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String deleteByExample(BsMerchantChainBrandAccountRecordExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.DELETE_FROM("bs_merchant_chain_brand_account_record"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String insertSelective(BsMerchantChainBrandAccountRecord record) { |
||||
SQL sql = new SQL(); |
||||
sql.INSERT_INTO("bs_merchant_chain_brand_account_record"); |
||||
|
||||
if (record.getMerChainBrandAccountId() != null) { |
||||
sql.VALUES("mer_chain_brand_account_id", "#{merChainBrandAccountId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getMerId() != null) { |
||||
sql.VALUES("mer_id", "#{merId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getMerNo() != null) { |
||||
sql.VALUES("mer_no", "#{merNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getMerName() != null) { |
||||
sql.VALUES("mer_name", "#{merName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getType() != null) { |
||||
sql.VALUES("`type`", "#{type,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getTransactionAmount() != null) { |
||||
sql.VALUES("transaction_amount", "#{transactionAmount,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.getSourceOrderNo() != null) { |
||||
sql.VALUES("source_order_no", "#{sourceOrderNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
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.getOpUserType() != null) { |
||||
sql.VALUES("op_user_type", "#{opUserType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
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.getOpUserPhone() != null) { |
||||
sql.VALUES("op_user_phone", "#{opUserPhone,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(BsMerchantChainBrandAccountRecordExample example) { |
||||
SQL sql = new SQL(); |
||||
if (example != null && example.isDistinct()) { |
||||
sql.SELECT_DISTINCT("id"); |
||||
} else { |
||||
sql.SELECT("id"); |
||||
} |
||||
sql.SELECT("mer_chain_brand_account_id"); |
||||
sql.SELECT("mer_id"); |
||||
sql.SELECT("mer_no"); |
||||
sql.SELECT("mer_name"); |
||||
sql.SELECT("`type`"); |
||||
sql.SELECT("transaction_amount"); |
||||
sql.SELECT("before_amount"); |
||||
sql.SELECT("after_amount"); |
||||
sql.SELECT("source_type"); |
||||
sql.SELECT("source_id"); |
||||
sql.SELECT("source_order_no"); |
||||
sql.SELECT("source_content"); |
||||
sql.SELECT("`status`"); |
||||
sql.SELECT("create_time"); |
||||
sql.SELECT("op_user_type"); |
||||
sql.SELECT("op_user_id"); |
||||
sql.SELECT("op_user_name"); |
||||
sql.SELECT("op_user_phone"); |
||||
sql.SELECT("ext_1"); |
||||
sql.SELECT("ext_2"); |
||||
sql.SELECT("ext_3"); |
||||
sql.FROM("bs_merchant_chain_brand_account_record"); |
||||
applyWhere(sql, example, false); |
||||
|
||||
if (example != null && example.getOrderByClause() != null) { |
||||
sql.ORDER_BY(example.getOrderByClause()); |
||||
} |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByExampleSelective(Map<String, Object> parameter) { |
||||
BsMerchantChainBrandAccountRecord record = (BsMerchantChainBrandAccountRecord) parameter.get("record"); |
||||
BsMerchantChainBrandAccountRecordExample example = (BsMerchantChainBrandAccountRecordExample) parameter.get("example"); |
||||
|
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("bs_merchant_chain_brand_account_record"); |
||||
|
||||
if (record.getId() != null) { |
||||
sql.SET("id = #{record.id,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getMerChainBrandAccountId() != null) { |
||||
sql.SET("mer_chain_brand_account_id = #{record.merChainBrandAccountId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getMerId() != null) { |
||||
sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getMerNo() != null) { |
||||
sql.SET("mer_no = #{record.merNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getMerName() != null) { |
||||
sql.SET("mer_name = #{record.merName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getType() != null) { |
||||
sql.SET("`type` = #{record.type,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getTransactionAmount() != null) { |
||||
sql.SET("transaction_amount = #{record.transactionAmount,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.getSourceOrderNo() != null) { |
||||
sql.SET("source_order_no = #{record.sourceOrderNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
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.getOpUserType() != null) { |
||||
sql.SET("op_user_type = #{record.opUserType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
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.getOpUserPhone() != null) { |
||||
sql.SET("op_user_phone = #{record.opUserPhone,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
applyWhere(sql, example, true); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByExample(Map<String, Object> parameter) { |
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("bs_merchant_chain_brand_account_record"); |
||||
|
||||
sql.SET("id = #{record.id,jdbcType=BIGINT}"); |
||||
sql.SET("mer_chain_brand_account_id = #{record.merChainBrandAccountId,jdbcType=BIGINT}"); |
||||
sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}"); |
||||
sql.SET("mer_no = #{record.merNo,jdbcType=VARCHAR}"); |
||||
sql.SET("mer_name = #{record.merName,jdbcType=VARCHAR}"); |
||||
sql.SET("`type` = #{record.type,jdbcType=INTEGER}"); |
||||
sql.SET("transaction_amount = #{record.transactionAmount,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_order_no = #{record.sourceOrderNo,jdbcType=VARCHAR}"); |
||||
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_type = #{record.opUserType,jdbcType=INTEGER}"); |
||||
sql.SET("op_user_id = #{record.opUserId,jdbcType=BIGINT}"); |
||||
sql.SET("op_user_name = #{record.opUserName,jdbcType=VARCHAR}"); |
||||
sql.SET("op_user_phone = #{record.opUserPhone,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}"); |
||||
|
||||
BsMerchantChainBrandAccountRecordExample example = (BsMerchantChainBrandAccountRecordExample) parameter.get("example"); |
||||
applyWhere(sql, example, true); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByPrimaryKeySelective(BsMerchantChainBrandAccountRecord record) { |
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("bs_merchant_chain_brand_account_record"); |
||||
|
||||
if (record.getMerChainBrandAccountId() != null) { |
||||
sql.SET("mer_chain_brand_account_id = #{merChainBrandAccountId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getMerId() != null) { |
||||
sql.SET("mer_id = #{merId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getMerNo() != null) { |
||||
sql.SET("mer_no = #{merNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getMerName() != null) { |
||||
sql.SET("mer_name = #{merName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getType() != null) { |
||||
sql.SET("`type` = #{type,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getTransactionAmount() != null) { |
||||
sql.SET("transaction_amount = #{transactionAmount,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.getSourceOrderNo() != null) { |
||||
sql.SET("source_order_no = #{sourceOrderNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
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.getOpUserType() != null) { |
||||
sql.SET("op_user_type = #{opUserType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
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.getOpUserPhone() != null) { |
||||
sql.SET("op_user_phone = #{opUserPhone,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, BsMerchantChainBrandAccountRecordExample example, boolean includeExamplePhrase) { |
||||
if (example == null) { |
||||
return; |
||||
} |
||||
|
||||
String parmPhrase1; |
||||
String parmPhrase1_th; |
||||
String parmPhrase2; |
||||
String parmPhrase2_th; |
||||
String parmPhrase3; |
||||
String parmPhrase3_th; |
||||
if (includeExamplePhrase) { |
||||
parmPhrase1 = "%s #{example.oredCriteria[%d].allCriteria[%d].value}"; |
||||
parmPhrase1_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; |
||||
parmPhrase2 = "%s #{example.oredCriteria[%d].allCriteria[%d].value} and #{example.oredCriteria[%d].criteria[%d].secondValue}"; |
||||
parmPhrase2_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{example.oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; |
||||
parmPhrase3 = "#{example.oredCriteria[%d].allCriteria[%d].value[%d]}"; |
||||
parmPhrase3_th = "#{example.oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; |
||||
} else { |
||||
parmPhrase1 = "%s #{oredCriteria[%d].allCriteria[%d].value}"; |
||||
parmPhrase1_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; |
||||
parmPhrase2 = "%s #{oredCriteria[%d].allCriteria[%d].value} and #{oredCriteria[%d].criteria[%d].secondValue}"; |
||||
parmPhrase2_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; |
||||
parmPhrase3 = "#{oredCriteria[%d].allCriteria[%d].value[%d]}"; |
||||
parmPhrase3_th = "#{oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; |
||||
} |
||||
|
||||
StringBuilder sb = new StringBuilder(); |
||||
List<Criteria> oredCriteria = example.getOredCriteria(); |
||||
boolean firstCriteria = true; |
||||
for (int i = 0; i < oredCriteria.size(); i++) { |
||||
Criteria criteria = oredCriteria.get(i); |
||||
if (criteria.isValid()) { |
||||
if (firstCriteria) { |
||||
firstCriteria = false; |
||||
} else { |
||||
sb.append(" or "); |
||||
} |
||||
|
||||
sb.append('('); |
||||
List<Criterion> criterions = criteria.getAllCriteria(); |
||||
boolean firstCriterion = true; |
||||
for (int j = 0; j < criterions.size(); j++) { |
||||
Criterion criterion = criterions.get(j); |
||||
if (firstCriterion) { |
||||
firstCriterion = false; |
||||
} else { |
||||
sb.append(" and "); |
||||
} |
||||
|
||||
if (criterion.isNoValue()) { |
||||
sb.append(criterion.getCondition()); |
||||
} else if (criterion.isSingleValue()) { |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase1, criterion.getCondition(), i, j)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase1_th, criterion.getCondition(), i, j,criterion.getTypeHandler())); |
||||
} |
||||
} else if (criterion.isBetweenValue()) { |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase2, criterion.getCondition(), i, j, i, j)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase2_th, criterion.getCondition(), i, j, criterion.getTypeHandler(), i, j, criterion.getTypeHandler())); |
||||
} |
||||
} else if (criterion.isListValue()) { |
||||
sb.append(criterion.getCondition()); |
||||
sb.append(" ("); |
||||
List<?> listItems = (List<?>) criterion.getValue(); |
||||
boolean comma = false; |
||||
for (int k = 0; k < listItems.size(); k++) { |
||||
if (comma) { |
||||
sb.append(", "); |
||||
} else { |
||||
comma = true; |
||||
} |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase3, i, j, k)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase3_th, i, j, k, criterion.getTypeHandler())); |
||||
} |
||||
} |
||||
sb.append(')'); |
||||
} |
||||
} |
||||
sb.append(')'); |
||||
} |
||||
} |
||||
|
||||
if (sb.length() > 0) { |
||||
sql.WHERE(sb.toString()); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,304 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
import com.hfkj.entity.BsMerchantChainBrandAccount; |
||||
import com.hfkj.entity.BsMerchantChainBrandAccountExample.Criteria; |
||||
import com.hfkj.entity.BsMerchantChainBrandAccountExample.Criterion; |
||||
import com.hfkj.entity.BsMerchantChainBrandAccountExample; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import org.apache.ibatis.jdbc.SQL; |
||||
|
||||
public class BsMerchantChainBrandAccountSqlProvider { |
||||
|
||||
public String countByExample(BsMerchantChainBrandAccountExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.SELECT("count(*)").FROM("bs_merchant_chain_brand_account"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String deleteByExample(BsMerchantChainBrandAccountExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.DELETE_FROM("bs_merchant_chain_brand_account"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String insertSelective(BsMerchantChainBrandAccount record) { |
||||
SQL sql = new SQL(); |
||||
sql.INSERT_INTO("bs_merchant_chain_brand_account"); |
||||
|
||||
if (record.getMerChainBrandId() != null) { |
||||
sql.VALUES("mer_chain_brand_id", "#{merChainBrandId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getAmount() != null) { |
||||
sql.VALUES("amount", "#{amount,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getAmountConsume() != null) { |
||||
sql.VALUES("amount_consume", "#{amountConsume,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(BsMerchantChainBrandAccountExample example) { |
||||
SQL sql = new SQL(); |
||||
if (example != null && example.isDistinct()) { |
||||
sql.SELECT_DISTINCT("id"); |
||||
} else { |
||||
sql.SELECT("id"); |
||||
} |
||||
sql.SELECT("mer_chain_brand_id"); |
||||
sql.SELECT("amount"); |
||||
sql.SELECT("amount_consume"); |
||||
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("bs_merchant_chain_brand_account"); |
||||
applyWhere(sql, example, false); |
||||
|
||||
if (example != null && example.getOrderByClause() != null) { |
||||
sql.ORDER_BY(example.getOrderByClause()); |
||||
} |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByExampleSelective(Map<String, Object> parameter) { |
||||
BsMerchantChainBrandAccount record = (BsMerchantChainBrandAccount) parameter.get("record"); |
||||
BsMerchantChainBrandAccountExample example = (BsMerchantChainBrandAccountExample) parameter.get("example"); |
||||
|
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("bs_merchant_chain_brand_account"); |
||||
|
||||
if (record.getId() != null) { |
||||
sql.SET("id = #{record.id,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getMerChainBrandId() != null) { |
||||
sql.SET("mer_chain_brand_id = #{record.merChainBrandId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getAmount() != null) { |
||||
sql.SET("amount = #{record.amount,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getAmountConsume() != null) { |
||||
sql.SET("amount_consume = #{record.amountConsume,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<String, Object> parameter) { |
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("bs_merchant_chain_brand_account"); |
||||
|
||||
sql.SET("id = #{record.id,jdbcType=BIGINT}"); |
||||
sql.SET("mer_chain_brand_id = #{record.merChainBrandId,jdbcType=BIGINT}"); |
||||
sql.SET("amount = #{record.amount,jdbcType=DECIMAL}"); |
||||
sql.SET("amount_consume = #{record.amountConsume,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}"); |
||||
|
||||
BsMerchantChainBrandAccountExample example = (BsMerchantChainBrandAccountExample) parameter.get("example"); |
||||
applyWhere(sql, example, true); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByPrimaryKeySelective(BsMerchantChainBrandAccount record) { |
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("bs_merchant_chain_brand_account"); |
||||
|
||||
if (record.getMerChainBrandId() != null) { |
||||
sql.SET("mer_chain_brand_id = #{merChainBrandId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getAmount() != null) { |
||||
sql.SET("amount = #{amount,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getAmountConsume() != null) { |
||||
sql.SET("amount_consume = #{amountConsume,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, BsMerchantChainBrandAccountExample example, boolean includeExamplePhrase) { |
||||
if (example == null) { |
||||
return; |
||||
} |
||||
|
||||
String parmPhrase1; |
||||
String parmPhrase1_th; |
||||
String parmPhrase2; |
||||
String parmPhrase2_th; |
||||
String parmPhrase3; |
||||
String parmPhrase3_th; |
||||
if (includeExamplePhrase) { |
||||
parmPhrase1 = "%s #{example.oredCriteria[%d].allCriteria[%d].value}"; |
||||
parmPhrase1_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; |
||||
parmPhrase2 = "%s #{example.oredCriteria[%d].allCriteria[%d].value} and #{example.oredCriteria[%d].criteria[%d].secondValue}"; |
||||
parmPhrase2_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{example.oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; |
||||
parmPhrase3 = "#{example.oredCriteria[%d].allCriteria[%d].value[%d]}"; |
||||
parmPhrase3_th = "#{example.oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; |
||||
} else { |
||||
parmPhrase1 = "%s #{oredCriteria[%d].allCriteria[%d].value}"; |
||||
parmPhrase1_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; |
||||
parmPhrase2 = "%s #{oredCriteria[%d].allCriteria[%d].value} and #{oredCriteria[%d].criteria[%d].secondValue}"; |
||||
parmPhrase2_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; |
||||
parmPhrase3 = "#{oredCriteria[%d].allCriteria[%d].value[%d]}"; |
||||
parmPhrase3_th = "#{oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; |
||||
} |
||||
|
||||
StringBuilder sb = new StringBuilder(); |
||||
List<Criteria> oredCriteria = example.getOredCriteria(); |
||||
boolean firstCriteria = true; |
||||
for (int i = 0; i < oredCriteria.size(); i++) { |
||||
Criteria criteria = oredCriteria.get(i); |
||||
if (criteria.isValid()) { |
||||
if (firstCriteria) { |
||||
firstCriteria = false; |
||||
} else { |
||||
sb.append(" or "); |
||||
} |
||||
|
||||
sb.append('('); |
||||
List<Criterion> criterions = criteria.getAllCriteria(); |
||||
boolean firstCriterion = true; |
||||
for (int j = 0; j < criterions.size(); j++) { |
||||
Criterion criterion = criterions.get(j); |
||||
if (firstCriterion) { |
||||
firstCriterion = false; |
||||
} else { |
||||
sb.append(" and "); |
||||
} |
||||
|
||||
if (criterion.isNoValue()) { |
||||
sb.append(criterion.getCondition()); |
||||
} else if (criterion.isSingleValue()) { |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase1, criterion.getCondition(), i, j)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase1_th, criterion.getCondition(), i, j,criterion.getTypeHandler())); |
||||
} |
||||
} else if (criterion.isBetweenValue()) { |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase2, criterion.getCondition(), i, j, i, j)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase2_th, criterion.getCondition(), i, j, criterion.getTypeHandler(), i, j, criterion.getTypeHandler())); |
||||
} |
||||
} else if (criterion.isListValue()) { |
||||
sb.append(criterion.getCondition()); |
||||
sb.append(" ("); |
||||
List<?> listItems = (List<?>) criterion.getValue(); |
||||
boolean comma = false; |
||||
for (int k = 0; k < listItems.size(); k++) { |
||||
if (comma) { |
||||
sb.append(", "); |
||||
} else { |
||||
comma = true; |
||||
} |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase3, i, j, k)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase3_th, i, j, k, criterion.getTypeHandler())); |
||||
} |
||||
} |
||||
sb.append(')'); |
||||
} |
||||
} |
||||
sb.append(')'); |
||||
} |
||||
} |
||||
|
||||
if (sb.length() > 0) { |
||||
sql.WHERE(sb.toString()); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,117 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
import com.hfkj.entity.BsMerchantChainBrand; |
||||
import com.hfkj.entity.BsMerchantChainBrandExample; |
||||
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 BsMerchantChainBrandMapper extends BsMerchantChainBrandMapperExt { |
||||
@SelectProvider(type=BsMerchantChainBrandSqlProvider.class, method="countByExample") |
||||
long countByExample(BsMerchantChainBrandExample example); |
||||
|
||||
@DeleteProvider(type=BsMerchantChainBrandSqlProvider.class, method="deleteByExample") |
||||
int deleteByExample(BsMerchantChainBrandExample example); |
||||
|
||||
@Delete({ |
||||
"delete from bs_merchant_chain_brand", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
int deleteByPrimaryKey(Long id); |
||||
|
||||
@Insert({ |
||||
"insert into bs_merchant_chain_brand (`name`, contacts_name, ", |
||||
"contacts_telephone, `status`, ", |
||||
"create_time, update_time, ", |
||||
"ext_1, ext_2, ext_3)", |
||||
"values (#{name,jdbcType=VARCHAR}, #{contactsName,jdbcType=VARCHAR}, ", |
||||
"#{contactsTelephone,jdbcType=VARCHAR}, #{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(BsMerchantChainBrand record); |
||||
|
||||
@InsertProvider(type=BsMerchantChainBrandSqlProvider.class, method="insertSelective") |
||||
@Options(useGeneratedKeys=true,keyProperty="id") |
||||
int insertSelective(BsMerchantChainBrand record); |
||||
|
||||
@SelectProvider(type=BsMerchantChainBrandSqlProvider.class, method="selectByExample") |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), |
||||
@Result(column="name", property="name", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="contacts_name", property="contactsName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="contacts_telephone", property="contactsTelephone", jdbcType=JdbcType.VARCHAR), |
||||
@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<BsMerchantChainBrand> selectByExample(BsMerchantChainBrandExample example); |
||||
|
||||
@Select({ |
||||
"select", |
||||
"id, `name`, contacts_name, contacts_telephone, `status`, create_time, update_time, ", |
||||
"ext_1, ext_2, ext_3", |
||||
"from bs_merchant_chain_brand", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), |
||||
@Result(column="name", property="name", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="contacts_name", property="contactsName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="contacts_telephone", property="contactsTelephone", jdbcType=JdbcType.VARCHAR), |
||||
@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) |
||||
}) |
||||
BsMerchantChainBrand selectByPrimaryKey(Long id); |
||||
|
||||
@UpdateProvider(type=BsMerchantChainBrandSqlProvider.class, method="updateByExampleSelective") |
||||
int updateByExampleSelective(@Param("record") BsMerchantChainBrand record, @Param("example") BsMerchantChainBrandExample example); |
||||
|
||||
@UpdateProvider(type=BsMerchantChainBrandSqlProvider.class, method="updateByExample") |
||||
int updateByExample(@Param("record") BsMerchantChainBrand record, @Param("example") BsMerchantChainBrandExample example); |
||||
|
||||
@UpdateProvider(type=BsMerchantChainBrandSqlProvider.class, method="updateByPrimaryKeySelective") |
||||
int updateByPrimaryKeySelective(BsMerchantChainBrand record); |
||||
|
||||
@Update({ |
||||
"update bs_merchant_chain_brand", |
||||
"set `name` = #{name,jdbcType=VARCHAR},", |
||||
"contacts_name = #{contactsName,jdbcType=VARCHAR},", |
||||
"contacts_telephone = #{contactsTelephone,jdbcType=VARCHAR},", |
||||
"`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(BsMerchantChainBrand record); |
||||
} |
@ -0,0 +1,30 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
import org.apache.ibatis.annotations.Param; |
||||
import org.apache.ibatis.annotations.Select; |
||||
|
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* mapper扩展类 |
||||
*/ |
||||
public interface BsMerchantChainBrandMapperExt { |
||||
|
||||
@Select("<script>" + |
||||
" SELECT " + |
||||
" a.id," + |
||||
" a.`name`," + |
||||
" a.contacts_name contactsName," + |
||||
" a.contacts_telephone contactsTelephone," + |
||||
" b.amount," + |
||||
" b.amount_consume amountConsume," + |
||||
" a.create_time createTime" + |
||||
" FROM bs_merchant_chain_brand a" + |
||||
" LEFT JOIN bs_merchant_chain_brand_account b on b.mer_chain_brand_id = a.id" + |
||||
" where 1 = 1" + |
||||
" <if test='param.name != null'> and a.name like concat('%',#{param.name},'%') </if>" + |
||||
" ORDER BY b.amount asc" + |
||||
"</script>") |
||||
List<Map<String,Object>> selectChainBrand(@Param("param") Map<String,Object> param); |
||||
} |
@ -0,0 +1,304 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
import com.hfkj.entity.BsMerchantChainBrand; |
||||
import com.hfkj.entity.BsMerchantChainBrandExample.Criteria; |
||||
import com.hfkj.entity.BsMerchantChainBrandExample.Criterion; |
||||
import com.hfkj.entity.BsMerchantChainBrandExample; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import org.apache.ibatis.jdbc.SQL; |
||||
|
||||
public class BsMerchantChainBrandSqlProvider { |
||||
|
||||
public String countByExample(BsMerchantChainBrandExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.SELECT("count(*)").FROM("bs_merchant_chain_brand"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String deleteByExample(BsMerchantChainBrandExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.DELETE_FROM("bs_merchant_chain_brand"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String insertSelective(BsMerchantChainBrand record) { |
||||
SQL sql = new SQL(); |
||||
sql.INSERT_INTO("bs_merchant_chain_brand"); |
||||
|
||||
if (record.getName() != null) { |
||||
sql.VALUES("`name`", "#{name,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getContactsName() != null) { |
||||
sql.VALUES("contacts_name", "#{contactsName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getContactsTelephone() != null) { |
||||
sql.VALUES("contacts_telephone", "#{contactsTelephone,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.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(BsMerchantChainBrandExample example) { |
||||
SQL sql = new SQL(); |
||||
if (example != null && example.isDistinct()) { |
||||
sql.SELECT_DISTINCT("id"); |
||||
} else { |
||||
sql.SELECT("id"); |
||||
} |
||||
sql.SELECT("`name`"); |
||||
sql.SELECT("contacts_name"); |
||||
sql.SELECT("contacts_telephone"); |
||||
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("bs_merchant_chain_brand"); |
||||
applyWhere(sql, example, false); |
||||
|
||||
if (example != null && example.getOrderByClause() != null) { |
||||
sql.ORDER_BY(example.getOrderByClause()); |
||||
} |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByExampleSelective(Map<String, Object> parameter) { |
||||
BsMerchantChainBrand record = (BsMerchantChainBrand) parameter.get("record"); |
||||
BsMerchantChainBrandExample example = (BsMerchantChainBrandExample) parameter.get("example"); |
||||
|
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("bs_merchant_chain_brand"); |
||||
|
||||
if (record.getId() != null) { |
||||
sql.SET("id = #{record.id,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getName() != null) { |
||||
sql.SET("`name` = #{record.name,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getContactsName() != null) { |
||||
sql.SET("contacts_name = #{record.contactsName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getContactsTelephone() != null) { |
||||
sql.SET("contacts_telephone = #{record.contactsTelephone,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.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<String, Object> parameter) { |
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("bs_merchant_chain_brand"); |
||||
|
||||
sql.SET("id = #{record.id,jdbcType=BIGINT}"); |
||||
sql.SET("`name` = #{record.name,jdbcType=VARCHAR}"); |
||||
sql.SET("contacts_name = #{record.contactsName,jdbcType=VARCHAR}"); |
||||
sql.SET("contacts_telephone = #{record.contactsTelephone,jdbcType=VARCHAR}"); |
||||
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}"); |
||||
|
||||
BsMerchantChainBrandExample example = (BsMerchantChainBrandExample) parameter.get("example"); |
||||
applyWhere(sql, example, true); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByPrimaryKeySelective(BsMerchantChainBrand record) { |
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("bs_merchant_chain_brand"); |
||||
|
||||
if (record.getName() != null) { |
||||
sql.SET("`name` = #{name,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getContactsName() != null) { |
||||
sql.SET("contacts_name = #{contactsName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getContactsTelephone() != null) { |
||||
sql.SET("contacts_telephone = #{contactsTelephone,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.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, BsMerchantChainBrandExample example, boolean includeExamplePhrase) { |
||||
if (example == null) { |
||||
return; |
||||
} |
||||
|
||||
String parmPhrase1; |
||||
String parmPhrase1_th; |
||||
String parmPhrase2; |
||||
String parmPhrase2_th; |
||||
String parmPhrase3; |
||||
String parmPhrase3_th; |
||||
if (includeExamplePhrase) { |
||||
parmPhrase1 = "%s #{example.oredCriteria[%d].allCriteria[%d].value}"; |
||||
parmPhrase1_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; |
||||
parmPhrase2 = "%s #{example.oredCriteria[%d].allCriteria[%d].value} and #{example.oredCriteria[%d].criteria[%d].secondValue}"; |
||||
parmPhrase2_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{example.oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; |
||||
parmPhrase3 = "#{example.oredCriteria[%d].allCriteria[%d].value[%d]}"; |
||||
parmPhrase3_th = "#{example.oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; |
||||
} else { |
||||
parmPhrase1 = "%s #{oredCriteria[%d].allCriteria[%d].value}"; |
||||
parmPhrase1_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; |
||||
parmPhrase2 = "%s #{oredCriteria[%d].allCriteria[%d].value} and #{oredCriteria[%d].criteria[%d].secondValue}"; |
||||
parmPhrase2_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; |
||||
parmPhrase3 = "#{oredCriteria[%d].allCriteria[%d].value[%d]}"; |
||||
parmPhrase3_th = "#{oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; |
||||
} |
||||
|
||||
StringBuilder sb = new StringBuilder(); |
||||
List<Criteria> oredCriteria = example.getOredCriteria(); |
||||
boolean firstCriteria = true; |
||||
for (int i = 0; i < oredCriteria.size(); i++) { |
||||
Criteria criteria = oredCriteria.get(i); |
||||
if (criteria.isValid()) { |
||||
if (firstCriteria) { |
||||
firstCriteria = false; |
||||
} else { |
||||
sb.append(" or "); |
||||
} |
||||
|
||||
sb.append('('); |
||||
List<Criterion> criterions = criteria.getAllCriteria(); |
||||
boolean firstCriterion = true; |
||||
for (int j = 0; j < criterions.size(); j++) { |
||||
Criterion criterion = criterions.get(j); |
||||
if (firstCriterion) { |
||||
firstCriterion = false; |
||||
} else { |
||||
sb.append(" and "); |
||||
} |
||||
|
||||
if (criterion.isNoValue()) { |
||||
sb.append(criterion.getCondition()); |
||||
} else if (criterion.isSingleValue()) { |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase1, criterion.getCondition(), i, j)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase1_th, criterion.getCondition(), i, j,criterion.getTypeHandler())); |
||||
} |
||||
} else if (criterion.isBetweenValue()) { |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase2, criterion.getCondition(), i, j, i, j)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase2_th, criterion.getCondition(), i, j, criterion.getTypeHandler(), i, j, criterion.getTypeHandler())); |
||||
} |
||||
} else if (criterion.isListValue()) { |
||||
sb.append(criterion.getCondition()); |
||||
sb.append(" ("); |
||||
List<?> listItems = (List<?>) criterion.getValue(); |
||||
boolean comma = false; |
||||
for (int k = 0; k < listItems.size(); k++) { |
||||
if (comma) { |
||||
sb.append(", "); |
||||
} else { |
||||
comma = true; |
||||
} |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase3, i, j, k)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase3_th, i, j, k, criterion.getTypeHandler())); |
||||
} |
||||
} |
||||
sb.append(')'); |
||||
} |
||||
} |
||||
sb.append(')'); |
||||
} |
||||
} |
||||
|
||||
if (sb.length() > 0) { |
||||
sql.WHERE(sb.toString()); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,200 @@ |
||||
package com.hfkj.entity; |
||||
|
||||
import java.io.Serializable; |
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* bs_merchant_chain_brand |
||||
* @author |
||||
*/ |
||||
/** |
||||
* |
||||
* 代码由工具生成 |
||||
* |
||||
**/ |
||||
public class BsMerchantChainBrand implements Serializable { |
||||
/** |
||||
* 主键 |
||||
*/ |
||||
private Long id; |
||||
|
||||
/** |
||||
* 连锁品牌名称 |
||||
*/ |
||||
private String name; |
||||
|
||||
/** |
||||
* 负责人名称 |
||||
*/ |
||||
private String contactsName; |
||||
|
||||
/** |
||||
* 负责人电话 |
||||
*/ |
||||
private String contactsTelephone; |
||||
|
||||
/** |
||||
* 状态 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 String getName() { |
||||
return name; |
||||
} |
||||
|
||||
public void setName(String name) { |
||||
this.name = name; |
||||
} |
||||
|
||||
public String getContactsName() { |
||||
return contactsName; |
||||
} |
||||
|
||||
public void setContactsName(String contactsName) { |
||||
this.contactsName = contactsName; |
||||
} |
||||
|
||||
public String getContactsTelephone() { |
||||
return contactsTelephone; |
||||
} |
||||
|
||||
public void setContactsTelephone(String contactsTelephone) { |
||||
this.contactsTelephone = contactsTelephone; |
||||
} |
||||
|
||||
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; |
||||
} |
||||
BsMerchantChainBrand other = (BsMerchantChainBrand) that; |
||||
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) |
||||
&& (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName())) |
||||
&& (this.getContactsName() == null ? other.getContactsName() == null : this.getContactsName().equals(other.getContactsName())) |
||||
&& (this.getContactsTelephone() == null ? other.getContactsTelephone() == null : this.getContactsTelephone().equals(other.getContactsTelephone())) |
||||
&& (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 + ((getName() == null) ? 0 : getName().hashCode()); |
||||
result = prime * result + ((getContactsName() == null) ? 0 : getContactsName().hashCode()); |
||||
result = prime * result + ((getContactsTelephone() == null) ? 0 : getContactsTelephone().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(", name=").append(name); |
||||
sb.append(", contactsName=").append(contactsName); |
||||
sb.append(", contactsTelephone=").append(contactsTelephone); |
||||
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(); |
||||
} |
||||
} |
@ -0,0 +1,198 @@ |
||||
package com.hfkj.entity; |
||||
|
||||
import java.io.Serializable; |
||||
import java.math.BigDecimal; |
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* bs_merchant_chain_brand_account |
||||
* @author |
||||
*/ |
||||
/** |
||||
* |
||||
* 代码由工具生成 |
||||
* |
||||
**/ |
||||
public class BsMerchantChainBrandAccount implements Serializable { |
||||
private Long id; |
||||
|
||||
/** |
||||
* 商户连锁品牌id |
||||
*/ |
||||
private Long merChainBrandId; |
||||
|
||||
/** |
||||
* 余额 |
||||
*/ |
||||
private BigDecimal amount; |
||||
|
||||
/** |
||||
* 消费金额 |
||||
*/ |
||||
private BigDecimal amountConsume; |
||||
|
||||
/** |
||||
* 状态 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 getMerChainBrandId() { |
||||
return merChainBrandId; |
||||
} |
||||
|
||||
public void setMerChainBrandId(Long merChainBrandId) { |
||||
this.merChainBrandId = merChainBrandId; |
||||
} |
||||
|
||||
public BigDecimal getAmount() { |
||||
return amount; |
||||
} |
||||
|
||||
public void setAmount(BigDecimal amount) { |
||||
this.amount = amount; |
||||
} |
||||
|
||||
public BigDecimal getAmountConsume() { |
||||
return amountConsume; |
||||
} |
||||
|
||||
public void setAmountConsume(BigDecimal amountConsume) { |
||||
this.amountConsume = amountConsume; |
||||
} |
||||
|
||||
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; |
||||
} |
||||
BsMerchantChainBrandAccount other = (BsMerchantChainBrandAccount) that; |
||||
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) |
||||
&& (this.getMerChainBrandId() == null ? other.getMerChainBrandId() == null : this.getMerChainBrandId().equals(other.getMerChainBrandId())) |
||||
&& (this.getAmount() == null ? other.getAmount() == null : this.getAmount().equals(other.getAmount())) |
||||
&& (this.getAmountConsume() == null ? other.getAmountConsume() == null : this.getAmountConsume().equals(other.getAmountConsume())) |
||||
&& (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 + ((getMerChainBrandId() == null) ? 0 : getMerChainBrandId().hashCode()); |
||||
result = prime * result + ((getAmount() == null) ? 0 : getAmount().hashCode()); |
||||
result = prime * result + ((getAmountConsume() == null) ? 0 : getAmountConsume().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(", merChainBrandId=").append(merChainBrandId); |
||||
sb.append(", amount=").append(amount); |
||||
sb.append(", amountConsume=").append(amountConsume); |
||||
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(); |
||||
} |
||||
} |
@ -0,0 +1,854 @@ |
||||
package com.hfkj.entity; |
||||
|
||||
import java.math.BigDecimal; |
||||
import java.util.ArrayList; |
||||
import java.util.Date; |
||||
import java.util.List; |
||||
|
||||
public class BsMerchantChainBrandAccountExample { |
||||
protected String orderByClause; |
||||
|
||||
protected boolean distinct; |
||||
|
||||
protected List<Criteria> oredCriteria; |
||||
|
||||
private Integer limit; |
||||
|
||||
private Long offset; |
||||
|
||||
public BsMerchantChainBrandAccountExample() { |
||||
oredCriteria = new ArrayList<Criteria>(); |
||||
} |
||||
|
||||
public void setOrderByClause(String orderByClause) { |
||||
this.orderByClause = orderByClause; |
||||
} |
||||
|
||||
public String getOrderByClause() { |
||||
return orderByClause; |
||||
} |
||||
|
||||
public void setDistinct(boolean distinct) { |
||||
this.distinct = distinct; |
||||
} |
||||
|
||||
public boolean isDistinct() { |
||||
return distinct; |
||||
} |
||||
|
||||
public List<Criteria> getOredCriteria() { |
||||
return oredCriteria; |
||||
} |
||||
|
||||
public void or(Criteria criteria) { |
||||
oredCriteria.add(criteria); |
||||
} |
||||
|
||||
public Criteria or() { |
||||
Criteria criteria = createCriteriaInternal(); |
||||
oredCriteria.add(criteria); |
||||
return criteria; |
||||
} |
||||
|
||||
public Criteria createCriteria() { |
||||
Criteria criteria = createCriteriaInternal(); |
||||
if (oredCriteria.size() == 0) { |
||||
oredCriteria.add(criteria); |
||||
} |
||||
return criteria; |
||||
} |
||||
|
||||
protected Criteria createCriteriaInternal() { |
||||
Criteria criteria = new Criteria(); |
||||
return criteria; |
||||
} |
||||
|
||||
public void clear() { |
||||
oredCriteria.clear(); |
||||
orderByClause = null; |
||||
distinct = false; |
||||
} |
||||
|
||||
public void setLimit(Integer limit) { |
||||
this.limit = limit; |
||||
} |
||||
|
||||
public Integer getLimit() { |
||||
return limit; |
||||
} |
||||
|
||||
public void setOffset(Long offset) { |
||||
this.offset = offset; |
||||
} |
||||
|
||||
public Long getOffset() { |
||||
return offset; |
||||
} |
||||
|
||||
protected abstract static class GeneratedCriteria { |
||||
protected List<Criterion> criteria; |
||||
|
||||
protected GeneratedCriteria() { |
||||
super(); |
||||
criteria = new ArrayList<Criterion>(); |
||||
} |
||||
|
||||
public boolean isValid() { |
||||
return criteria.size() > 0; |
||||
} |
||||
|
||||
public List<Criterion> getAllCriteria() { |
||||
return criteria; |
||||
} |
||||
|
||||
public List<Criterion> getCriteria() { |
||||
return criteria; |
||||
} |
||||
|
||||
protected void addCriterion(String condition) { |
||||
if (condition == null) { |
||||
throw new RuntimeException("Value for condition cannot be null"); |
||||
} |
||||
criteria.add(new Criterion(condition)); |
||||
} |
||||
|
||||
protected void addCriterion(String condition, Object value, String property) { |
||||
if (value == null) { |
||||
throw new RuntimeException("Value for " + property + " cannot be null"); |
||||
} |
||||
criteria.add(new Criterion(condition, value)); |
||||
} |
||||
|
||||
protected void addCriterion(String condition, Object value1, Object value2, String property) { |
||||
if (value1 == null || value2 == null) { |
||||
throw new RuntimeException("Between values for " + property + " cannot be null"); |
||||
} |
||||
criteria.add(new Criterion(condition, value1, value2)); |
||||
} |
||||
|
||||
public Criteria andIdIsNull() { |
||||
addCriterion("id is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdIsNotNull() { |
||||
addCriterion("id is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdEqualTo(Long value) { |
||||
addCriterion("id =", value, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdNotEqualTo(Long value) { |
||||
addCriterion("id <>", value, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdGreaterThan(Long value) { |
||||
addCriterion("id >", value, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdGreaterThanOrEqualTo(Long value) { |
||||
addCriterion("id >=", value, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdLessThan(Long value) { |
||||
addCriterion("id <", value, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdLessThanOrEqualTo(Long value) { |
||||
addCriterion("id <=", value, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdIn(List<Long> values) { |
||||
addCriterion("id in", values, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdNotIn(List<Long> values) { |
||||
addCriterion("id not in", values, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdBetween(Long value1, Long value2) { |
||||
addCriterion("id between", value1, value2, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdNotBetween(Long value1, Long value2) { |
||||
addCriterion("id not between", value1, value2, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andMerChainBrandIdIsNull() { |
||||
addCriterion("mer_chain_brand_id is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andMerChainBrandIdIsNotNull() { |
||||
addCriterion("mer_chain_brand_id is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andMerChainBrandIdEqualTo(Long value) { |
||||
addCriterion("mer_chain_brand_id =", value, "merChainBrandId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andMerChainBrandIdNotEqualTo(Long value) { |
||||
addCriterion("mer_chain_brand_id <>", value, "merChainBrandId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andMerChainBrandIdGreaterThan(Long value) { |
||||
addCriterion("mer_chain_brand_id >", value, "merChainBrandId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andMerChainBrandIdGreaterThanOrEqualTo(Long value) { |
||||
addCriterion("mer_chain_brand_id >=", value, "merChainBrandId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andMerChainBrandIdLessThan(Long value) { |
||||
addCriterion("mer_chain_brand_id <", value, "merChainBrandId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andMerChainBrandIdLessThanOrEqualTo(Long value) { |
||||
addCriterion("mer_chain_brand_id <=", value, "merChainBrandId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andMerChainBrandIdIn(List<Long> values) { |
||||
addCriterion("mer_chain_brand_id in", values, "merChainBrandId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andMerChainBrandIdNotIn(List<Long> values) { |
||||
addCriterion("mer_chain_brand_id not in", values, "merChainBrandId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andMerChainBrandIdBetween(Long value1, Long value2) { |
||||
addCriterion("mer_chain_brand_id between", value1, value2, "merChainBrandId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andMerChainBrandIdNotBetween(Long value1, Long value2) { |
||||
addCriterion("mer_chain_brand_id not between", value1, value2, "merChainBrandId"); |
||||
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<BigDecimal> values) { |
||||
addCriterion("amount in", values, "amount"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andAmountNotIn(List<BigDecimal> 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 andAmountConsumeIsNull() { |
||||
addCriterion("amount_consume is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andAmountConsumeIsNotNull() { |
||||
addCriterion("amount_consume is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andAmountConsumeEqualTo(BigDecimal value) { |
||||
addCriterion("amount_consume =", value, "amountConsume"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andAmountConsumeNotEqualTo(BigDecimal value) { |
||||
addCriterion("amount_consume <>", value, "amountConsume"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andAmountConsumeGreaterThan(BigDecimal value) { |
||||
addCriterion("amount_consume >", value, "amountConsume"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andAmountConsumeGreaterThanOrEqualTo(BigDecimal value) { |
||||
addCriterion("amount_consume >=", value, "amountConsume"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andAmountConsumeLessThan(BigDecimal value) { |
||||
addCriterion("amount_consume <", value, "amountConsume"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andAmountConsumeLessThanOrEqualTo(BigDecimal value) { |
||||
addCriterion("amount_consume <=", value, "amountConsume"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andAmountConsumeIn(List<BigDecimal> values) { |
||||
addCriterion("amount_consume in", values, "amountConsume"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andAmountConsumeNotIn(List<BigDecimal> values) { |
||||
addCriterion("amount_consume not in", values, "amountConsume"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andAmountConsumeBetween(BigDecimal value1, BigDecimal value2) { |
||||
addCriterion("amount_consume between", value1, value2, "amountConsume"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andAmountConsumeNotBetween(BigDecimal value1, BigDecimal value2) { |
||||
addCriterion("amount_consume not between", value1, value2, "amountConsume"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusIsNull() { |
||||
addCriterion("`status` is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusIsNotNull() { |
||||
addCriterion("`status` is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusEqualTo(Integer value) { |
||||
addCriterion("`status` =", value, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusNotEqualTo(Integer value) { |
||||
addCriterion("`status` <>", value, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusGreaterThan(Integer value) { |
||||
addCriterion("`status` >", value, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusGreaterThanOrEqualTo(Integer value) { |
||||
addCriterion("`status` >=", value, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusLessThan(Integer value) { |
||||
addCriterion("`status` <", value, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusLessThanOrEqualTo(Integer value) { |
||||
addCriterion("`status` <=", value, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusIn(List<Integer> values) { |
||||
addCriterion("`status` in", values, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusNotIn(List<Integer> values) { |
||||
addCriterion("`status` not in", values, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusBetween(Integer value1, Integer value2) { |
||||
addCriterion("`status` between", value1, value2, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusNotBetween(Integer value1, Integer value2) { |
||||
addCriterion("`status` not between", value1, value2, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeIsNull() { |
||||
addCriterion("create_time is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeIsNotNull() { |
||||
addCriterion("create_time is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeEqualTo(Date value) { |
||||
addCriterion("create_time =", value, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeNotEqualTo(Date value) { |
||||
addCriterion("create_time <>", value, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeGreaterThan(Date value) { |
||||
addCriterion("create_time >", value, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { |
||||
addCriterion("create_time >=", value, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeLessThan(Date value) { |
||||
addCriterion("create_time <", value, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeLessThanOrEqualTo(Date value) { |
||||
addCriterion("create_time <=", value, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeIn(List<Date> values) { |
||||
addCriterion("create_time in", values, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeNotIn(List<Date> values) { |
||||
addCriterion("create_time not in", values, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeBetween(Date value1, Date value2) { |
||||
addCriterion("create_time between", value1, value2, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeNotBetween(Date value1, Date value2) { |
||||
addCriterion("create_time not between", value1, value2, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria 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<Date> values) { |
||||
addCriterion("update_time in", values, "updateTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andUpdateTimeNotIn(List<Date> 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<String> values) { |
||||
addCriterion("ext_1 in", values, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1NotIn(List<String> values) { |
||||
addCriterion("ext_1 not in", values, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1Between(String value1, String value2) { |
||||
addCriterion("ext_1 between", value1, value2, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1NotBetween(String value1, String value2) { |
||||
addCriterion("ext_1 not between", value1, value2, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2IsNull() { |
||||
addCriterion("ext_2 is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2IsNotNull() { |
||||
addCriterion("ext_2 is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2EqualTo(String value) { |
||||
addCriterion("ext_2 =", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2NotEqualTo(String value) { |
||||
addCriterion("ext_2 <>", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2GreaterThan(String value) { |
||||
addCriterion("ext_2 >", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2GreaterThanOrEqualTo(String value) { |
||||
addCriterion("ext_2 >=", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2LessThan(String value) { |
||||
addCriterion("ext_2 <", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2LessThanOrEqualTo(String value) { |
||||
addCriterion("ext_2 <=", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2Like(String value) { |
||||
addCriterion("ext_2 like", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2NotLike(String value) { |
||||
addCriterion("ext_2 not like", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2In(List<String> values) { |
||||
addCriterion("ext_2 in", values, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2NotIn(List<String> values) { |
||||
addCriterion("ext_2 not in", values, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2Between(String value1, String value2) { |
||||
addCriterion("ext_2 between", value1, value2, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2NotBetween(String value1, String value2) { |
||||
addCriterion("ext_2 not between", value1, value2, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3IsNull() { |
||||
addCriterion("ext_3 is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3IsNotNull() { |
||||
addCriterion("ext_3 is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3EqualTo(String value) { |
||||
addCriterion("ext_3 =", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3NotEqualTo(String value) { |
||||
addCriterion("ext_3 <>", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3GreaterThan(String value) { |
||||
addCriterion("ext_3 >", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3GreaterThanOrEqualTo(String value) { |
||||
addCriterion("ext_3 >=", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3LessThan(String value) { |
||||
addCriterion("ext_3 <", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3LessThanOrEqualTo(String value) { |
||||
addCriterion("ext_3 <=", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3Like(String value) { |
||||
addCriterion("ext_3 like", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3NotLike(String value) { |
||||
addCriterion("ext_3 not like", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3In(List<String> values) { |
||||
addCriterion("ext_3 in", values, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3NotIn(List<String> values) { |
||||
addCriterion("ext_3 not in", values, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3Between(String value1, String value2) { |
||||
addCriterion("ext_3 between", value1, value2, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3NotBetween(String value1, String value2) { |
||||
addCriterion("ext_3 not between", value1, value2, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
} |
||||
|
||||
/** |
||||
*/ |
||||
public static class Criteria extends GeneratedCriteria { |
||||
|
||||
protected Criteria() { |
||||
super(); |
||||
} |
||||
} |
||||
|
||||
public static class Criterion { |
||||
private String condition; |
||||
|
||||
private Object value; |
||||
|
||||
private Object secondValue; |
||||
|
||||
private boolean noValue; |
||||
|
||||
private boolean singleValue; |
||||
|
||||
private boolean betweenValue; |
||||
|
||||
private boolean listValue; |
||||
|
||||
private String typeHandler; |
||||
|
||||
public String getCondition() { |
||||
return condition; |
||||
} |
||||
|
||||
public Object getValue() { |
||||
return value; |
||||
} |
||||
|
||||
public Object getSecondValue() { |
||||
return secondValue; |
||||
} |
||||
|
||||
public boolean isNoValue() { |
||||
return noValue; |
||||
} |
||||
|
||||
public boolean isSingleValue() { |
||||
return singleValue; |
||||
} |
||||
|
||||
public boolean isBetweenValue() { |
||||
return betweenValue; |
||||
} |
||||
|
||||
public boolean isListValue() { |
||||
return listValue; |
||||
} |
||||
|
||||
public String getTypeHandler() { |
||||
return typeHandler; |
||||
} |
||||
|
||||
protected Criterion(String condition) { |
||||
super(); |
||||
this.condition = condition; |
||||
this.typeHandler = null; |
||||
this.noValue = true; |
||||
} |
||||
|
||||
protected Criterion(String condition, Object value, String typeHandler) { |
||||
super(); |
||||
this.condition = condition; |
||||
this.value = value; |
||||
this.typeHandler = typeHandler; |
||||
if (value instanceof List<?>) { |
||||
this.listValue = true; |
||||
} else { |
||||
this.singleValue = true; |
||||
} |
||||
} |
||||
|
||||
protected Criterion(String condition, Object value) { |
||||
this(condition, value, null); |
||||
} |
||||
|
||||
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { |
||||
super(); |
||||
this.condition = condition; |
||||
this.value = value; |
||||
this.secondValue = secondValue; |
||||
this.typeHandler = typeHandler; |
||||
this.betweenValue = true; |
||||
} |
||||
|
||||
protected Criterion(String condition, Object value, Object secondValue) { |
||||
this(condition, value, secondValue, null); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,390 @@ |
||||
package com.hfkj.entity; |
||||
|
||||
import java.io.Serializable; |
||||
import java.math.BigDecimal; |
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* bs_merchant_chain_brand_account_record |
||||
* @author |
||||
*/ |
||||
/** |
||||
* |
||||
* 代码由工具生成 |
||||
* |
||||
**/ |
||||
public class BsMerchantChainBrandAccountRecord implements Serializable { |
||||
private Long id; |
||||
|
||||
/** |
||||
* 商户连锁品牌账户id |
||||
*/ |
||||
private Long merChainBrandAccountId; |
||||
|
||||
/** |
||||
* 商户id |
||||
*/ |
||||
private Long merId; |
||||
|
||||
/** |
||||
* 商户编号 |
||||
*/ |
||||
private String merNo; |
||||
|
||||
/** |
||||
* 商户名称 |
||||
*/ |
||||
private String merName; |
||||
|
||||
/** |
||||
* 类型 1:进账 2:出账 |
||||
*/ |
||||
private Integer type; |
||||
|
||||
/** |
||||
* 交易金额 |
||||
*/ |
||||
private BigDecimal transactionAmount; |
||||
|
||||
/** |
||||
* 变更前金额 |
||||
*/ |
||||
private BigDecimal beforeAmount; |
||||
|
||||
/** |
||||
* 变更后金额 |
||||
*/ |
||||
private BigDecimal afterAmount; |
||||
|
||||
/** |
||||
* 来源类型 1. 充值金额 2. 订单扣除 |
||||
*/ |
||||
private Integer sourceType; |
||||
|
||||
/** |
||||
* 来源id |
||||
*/ |
||||
private Long sourceId; |
||||
|
||||
/** |
||||
* 来源订单号 |
||||
*/ |
||||
private String sourceOrderNo; |
||||
|
||||
/** |
||||
* 来源内容 |
||||
*/ |
||||
private String sourceContent; |
||||
|
||||
/** |
||||
* 状态 0:删除 1:正常 |
||||
*/ |
||||
private Integer status; |
||||
|
||||
/** |
||||
* 创建时间 |
||||
*/ |
||||
private Date createTime; |
||||
|
||||
/** |
||||
* 操作人类型 1:管理员 2:客户 |
||||
*/ |
||||
private Integer opUserType; |
||||
|
||||
/** |
||||
* 操作人id |
||||
*/ |
||||
private Long opUserId; |
||||
|
||||
/** |
||||
* 操作人名称 |
||||
*/ |
||||
private String opUserName; |
||||
|
||||
/** |
||||
* 操作人电话 |
||||
*/ |
||||
private String opUserPhone; |
||||
|
||||
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 getMerChainBrandAccountId() { |
||||
return merChainBrandAccountId; |
||||
} |
||||
|
||||
public void setMerChainBrandAccountId(Long merChainBrandAccountId) { |
||||
this.merChainBrandAccountId = merChainBrandAccountId; |
||||
} |
||||
|
||||
public Long getMerId() { |
||||
return merId; |
||||
} |
||||
|
||||
public void setMerId(Long merId) { |
||||
this.merId = merId; |
||||
} |
||||
|
||||
public String getMerNo() { |
||||
return merNo; |
||||
} |
||||
|
||||
public void setMerNo(String merNo) { |
||||
this.merNo = merNo; |
||||
} |
||||
|
||||
public String getMerName() { |
||||
return merName; |
||||
} |
||||
|
||||
public void setMerName(String merName) { |
||||
this.merName = merName; |
||||
} |
||||
|
||||
public Integer getType() { |
||||
return type; |
||||
} |
||||
|
||||
public void setType(Integer type) { |
||||
this.type = type; |
||||
} |
||||
|
||||
public BigDecimal getTransactionAmount() { |
||||
return transactionAmount; |
||||
} |
||||
|
||||
public void setTransactionAmount(BigDecimal transactionAmount) { |
||||
this.transactionAmount = transactionAmount; |
||||
} |
||||
|
||||
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 getSourceOrderNo() { |
||||
return sourceOrderNo; |
||||
} |
||||
|
||||
public void setSourceOrderNo(String sourceOrderNo) { |
||||
this.sourceOrderNo = sourceOrderNo; |
||||
} |
||||
|
||||
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 Integer getOpUserType() { |
||||
return opUserType; |
||||
} |
||||
|
||||
public void setOpUserType(Integer opUserType) { |
||||
this.opUserType = opUserType; |
||||
} |
||||
|
||||
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 getOpUserPhone() { |
||||
return opUserPhone; |
||||
} |
||||
|
||||
public void setOpUserPhone(String opUserPhone) { |
||||
this.opUserPhone = opUserPhone; |
||||
} |
||||
|
||||
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; |
||||
} |
||||
BsMerchantChainBrandAccountRecord other = (BsMerchantChainBrandAccountRecord) that; |
||||
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) |
||||
&& (this.getMerChainBrandAccountId() == null ? other.getMerChainBrandAccountId() == null : this.getMerChainBrandAccountId().equals(other.getMerChainBrandAccountId())) |
||||
&& (this.getMerId() == null ? other.getMerId() == null : this.getMerId().equals(other.getMerId())) |
||||
&& (this.getMerNo() == null ? other.getMerNo() == null : this.getMerNo().equals(other.getMerNo())) |
||||
&& (this.getMerName() == null ? other.getMerName() == null : this.getMerName().equals(other.getMerName())) |
||||
&& (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType())) |
||||
&& (this.getTransactionAmount() == null ? other.getTransactionAmount() == null : this.getTransactionAmount().equals(other.getTransactionAmount())) |
||||
&& (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.getSourceOrderNo() == null ? other.getSourceOrderNo() == null : this.getSourceOrderNo().equals(other.getSourceOrderNo())) |
||||
&& (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.getOpUserType() == null ? other.getOpUserType() == null : this.getOpUserType().equals(other.getOpUserType())) |
||||
&& (this.getOpUserId() == null ? other.getOpUserId() == null : this.getOpUserId().equals(other.getOpUserId())) |
||||
&& (this.getOpUserName() == null ? other.getOpUserName() == null : this.getOpUserName().equals(other.getOpUserName())) |
||||
&& (this.getOpUserPhone() == null ? other.getOpUserPhone() == null : this.getOpUserPhone().equals(other.getOpUserPhone())) |
||||
&& (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 + ((getMerChainBrandAccountId() == null) ? 0 : getMerChainBrandAccountId().hashCode()); |
||||
result = prime * result + ((getMerId() == null) ? 0 : getMerId().hashCode()); |
||||
result = prime * result + ((getMerNo() == null) ? 0 : getMerNo().hashCode()); |
||||
result = prime * result + ((getMerName() == null) ? 0 : getMerName().hashCode()); |
||||
result = prime * result + ((getType() == null) ? 0 : getType().hashCode()); |
||||
result = prime * result + ((getTransactionAmount() == null) ? 0 : getTransactionAmount().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 + ((getSourceOrderNo() == null) ? 0 : getSourceOrderNo().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 + ((getOpUserType() == null) ? 0 : getOpUserType().hashCode()); |
||||
result = prime * result + ((getOpUserId() == null) ? 0 : getOpUserId().hashCode()); |
||||
result = prime * result + ((getOpUserName() == null) ? 0 : getOpUserName().hashCode()); |
||||
result = prime * result + ((getOpUserPhone() == null) ? 0 : getOpUserPhone().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(", merChainBrandAccountId=").append(merChainBrandAccountId); |
||||
sb.append(", merId=").append(merId); |
||||
sb.append(", merNo=").append(merNo); |
||||
sb.append(", merName=").append(merName); |
||||
sb.append(", type=").append(type); |
||||
sb.append(", transactionAmount=").append(transactionAmount); |
||||
sb.append(", beforeAmount=").append(beforeAmount); |
||||
sb.append(", afterAmount=").append(afterAmount); |
||||
sb.append(", sourceType=").append(sourceType); |
||||
sb.append(", sourceId=").append(sourceId); |
||||
sb.append(", sourceOrderNo=").append(sourceOrderNo); |
||||
sb.append(", sourceContent=").append(sourceContent); |
||||
sb.append(", status=").append(status); |
||||
sb.append(", createTime=").append(createTime); |
||||
sb.append(", opUserType=").append(opUserType); |
||||
sb.append(", opUserId=").append(opUserId); |
||||
sb.append(", opUserName=").append(opUserName); |
||||
sb.append(", opUserPhone=").append(opUserPhone); |
||||
sb.append(", ext1=").append(ext1); |
||||
sb.append(", ext2=").append(ext2); |
||||
sb.append(", ext3=").append(ext3); |
||||
sb.append(", serialVersionUID=").append(serialVersionUID); |
||||
sb.append("]"); |
||||
return sb.toString(); |
||||
} |
||||
} |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,883 @@ |
||||
package com.hfkj.entity; |
||||
|
||||
import java.util.ArrayList; |
||||
import java.util.Date; |
||||
import java.util.List; |
||||
|
||||
public class BsMerchantChainBrandExample { |
||||
protected String orderByClause; |
||||
|
||||
protected boolean distinct; |
||||
|
||||
protected List<Criteria> oredCriteria; |
||||
|
||||
private Integer limit; |
||||
|
||||
private Long offset; |
||||
|
||||
public BsMerchantChainBrandExample() { |
||||
oredCriteria = new ArrayList<Criteria>(); |
||||
} |
||||
|
||||
public void setOrderByClause(String orderByClause) { |
||||
this.orderByClause = orderByClause; |
||||
} |
||||
|
||||
public String getOrderByClause() { |
||||
return orderByClause; |
||||
} |
||||
|
||||
public void setDistinct(boolean distinct) { |
||||
this.distinct = distinct; |
||||
} |
||||
|
||||
public boolean isDistinct() { |
||||
return distinct; |
||||
} |
||||
|
||||
public List<Criteria> getOredCriteria() { |
||||
return oredCriteria; |
||||
} |
||||
|
||||
public void or(Criteria criteria) { |
||||
oredCriteria.add(criteria); |
||||
} |
||||
|
||||
public Criteria or() { |
||||
Criteria criteria = createCriteriaInternal(); |
||||
oredCriteria.add(criteria); |
||||
return criteria; |
||||
} |
||||
|
||||
public Criteria createCriteria() { |
||||
Criteria criteria = createCriteriaInternal(); |
||||
if (oredCriteria.size() == 0) { |
||||
oredCriteria.add(criteria); |
||||
} |
||||
return criteria; |
||||
} |
||||
|
||||
protected Criteria createCriteriaInternal() { |
||||
Criteria criteria = new Criteria(); |
||||
return criteria; |
||||
} |
||||
|
||||
public void clear() { |
||||
oredCriteria.clear(); |
||||
orderByClause = null; |
||||
distinct = false; |
||||
} |
||||
|
||||
public void setLimit(Integer limit) { |
||||
this.limit = limit; |
||||
} |
||||
|
||||
public Integer getLimit() { |
||||
return limit; |
||||
} |
||||
|
||||
public void setOffset(Long offset) { |
||||
this.offset = offset; |
||||
} |
||||
|
||||
public Long getOffset() { |
||||
return offset; |
||||
} |
||||
|
||||
protected abstract static class GeneratedCriteria { |
||||
protected List<Criterion> criteria; |
||||
|
||||
protected GeneratedCriteria() { |
||||
super(); |
||||
criteria = new ArrayList<Criterion>(); |
||||
} |
||||
|
||||
public boolean isValid() { |
||||
return criteria.size() > 0; |
||||
} |
||||
|
||||
public List<Criterion> getAllCriteria() { |
||||
return criteria; |
||||
} |
||||
|
||||
public List<Criterion> getCriteria() { |
||||
return criteria; |
||||
} |
||||
|
||||
protected void addCriterion(String condition) { |
||||
if (condition == null) { |
||||
throw new RuntimeException("Value for condition cannot be null"); |
||||
} |
||||
criteria.add(new Criterion(condition)); |
||||
} |
||||
|
||||
protected void addCriterion(String condition, Object value, String property) { |
||||
if (value == null) { |
||||
throw new RuntimeException("Value for " + property + " cannot be null"); |
||||
} |
||||
criteria.add(new Criterion(condition, value)); |
||||
} |
||||
|
||||
protected void addCriterion(String condition, Object value1, Object value2, String property) { |
||||
if (value1 == null || value2 == null) { |
||||
throw new RuntimeException("Between values for " + property + " cannot be null"); |
||||
} |
||||
criteria.add(new Criterion(condition, value1, value2)); |
||||
} |
||||
|
||||
public Criteria andIdIsNull() { |
||||
addCriterion("id is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdIsNotNull() { |
||||
addCriterion("id is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdEqualTo(Long value) { |
||||
addCriterion("id =", value, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdNotEqualTo(Long value) { |
||||
addCriterion("id <>", value, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdGreaterThan(Long value) { |
||||
addCriterion("id >", value, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdGreaterThanOrEqualTo(Long value) { |
||||
addCriterion("id >=", value, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdLessThan(Long value) { |
||||
addCriterion("id <", value, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdLessThanOrEqualTo(Long value) { |
||||
addCriterion("id <=", value, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdIn(List<Long> values) { |
||||
addCriterion("id in", values, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdNotIn(List<Long> values) { |
||||
addCriterion("id not in", values, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdBetween(Long value1, Long value2) { |
||||
addCriterion("id between", value1, value2, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdNotBetween(Long value1, Long value2) { |
||||
addCriterion("id not between", value1, value2, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andNameIsNull() { |
||||
addCriterion("`name` is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andNameIsNotNull() { |
||||
addCriterion("`name` is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andNameEqualTo(String value) { |
||||
addCriterion("`name` =", value, "name"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andNameNotEqualTo(String value) { |
||||
addCriterion("`name` <>", value, "name"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andNameGreaterThan(String value) { |
||||
addCriterion("`name` >", value, "name"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andNameGreaterThanOrEqualTo(String value) { |
||||
addCriterion("`name` >=", value, "name"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andNameLessThan(String value) { |
||||
addCriterion("`name` <", value, "name"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andNameLessThanOrEqualTo(String value) { |
||||
addCriterion("`name` <=", value, "name"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andNameLike(String value) { |
||||
addCriterion("`name` like", value, "name"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andNameNotLike(String value) { |
||||
addCriterion("`name` not like", value, "name"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andNameIn(List<String> values) { |
||||
addCriterion("`name` in", values, "name"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andNameNotIn(List<String> values) { |
||||
addCriterion("`name` not in", values, "name"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andNameBetween(String value1, String value2) { |
||||
addCriterion("`name` between", value1, value2, "name"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andNameNotBetween(String value1, String value2) { |
||||
addCriterion("`name` not between", value1, value2, "name"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andContactsNameIsNull() { |
||||
addCriterion("contacts_name is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andContactsNameIsNotNull() { |
||||
addCriterion("contacts_name is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andContactsNameEqualTo(String value) { |
||||
addCriterion("contacts_name =", value, "contactsName"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andContactsNameNotEqualTo(String value) { |
||||
addCriterion("contacts_name <>", value, "contactsName"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andContactsNameGreaterThan(String value) { |
||||
addCriterion("contacts_name >", value, "contactsName"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andContactsNameGreaterThanOrEqualTo(String value) { |
||||
addCriterion("contacts_name >=", value, "contactsName"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andContactsNameLessThan(String value) { |
||||
addCriterion("contacts_name <", value, "contactsName"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andContactsNameLessThanOrEqualTo(String value) { |
||||
addCriterion("contacts_name <=", value, "contactsName"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andContactsNameLike(String value) { |
||||
addCriterion("contacts_name like", value, "contactsName"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andContactsNameNotLike(String value) { |
||||
addCriterion("contacts_name not like", value, "contactsName"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andContactsNameIn(List<String> values) { |
||||
addCriterion("contacts_name in", values, "contactsName"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andContactsNameNotIn(List<String> values) { |
||||
addCriterion("contacts_name not in", values, "contactsName"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andContactsNameBetween(String value1, String value2) { |
||||
addCriterion("contacts_name between", value1, value2, "contactsName"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andContactsNameNotBetween(String value1, String value2) { |
||||
addCriterion("contacts_name not between", value1, value2, "contactsName"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andContactsTelephoneIsNull() { |
||||
addCriterion("contacts_telephone is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andContactsTelephoneIsNotNull() { |
||||
addCriterion("contacts_telephone is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andContactsTelephoneEqualTo(String value) { |
||||
addCriterion("contacts_telephone =", value, "contactsTelephone"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andContactsTelephoneNotEqualTo(String value) { |
||||
addCriterion("contacts_telephone <>", value, "contactsTelephone"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andContactsTelephoneGreaterThan(String value) { |
||||
addCriterion("contacts_telephone >", value, "contactsTelephone"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andContactsTelephoneGreaterThanOrEqualTo(String value) { |
||||
addCriterion("contacts_telephone >=", value, "contactsTelephone"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andContactsTelephoneLessThan(String value) { |
||||
addCriterion("contacts_telephone <", value, "contactsTelephone"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andContactsTelephoneLessThanOrEqualTo(String value) { |
||||
addCriterion("contacts_telephone <=", value, "contactsTelephone"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andContactsTelephoneLike(String value) { |
||||
addCriterion("contacts_telephone like", value, "contactsTelephone"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andContactsTelephoneNotLike(String value) { |
||||
addCriterion("contacts_telephone not like", value, "contactsTelephone"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andContactsTelephoneIn(List<String> values) { |
||||
addCriterion("contacts_telephone in", values, "contactsTelephone"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andContactsTelephoneNotIn(List<String> values) { |
||||
addCriterion("contacts_telephone not in", values, "contactsTelephone"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andContactsTelephoneBetween(String value1, String value2) { |
||||
addCriterion("contacts_telephone between", value1, value2, "contactsTelephone"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andContactsTelephoneNotBetween(String value1, String value2) { |
||||
addCriterion("contacts_telephone not between", value1, value2, "contactsTelephone"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusIsNull() { |
||||
addCriterion("`status` is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusIsNotNull() { |
||||
addCriterion("`status` is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusEqualTo(Integer value) { |
||||
addCriterion("`status` =", value, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusNotEqualTo(Integer value) { |
||||
addCriterion("`status` <>", value, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusGreaterThan(Integer value) { |
||||
addCriterion("`status` >", value, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusGreaterThanOrEqualTo(Integer value) { |
||||
addCriterion("`status` >=", value, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusLessThan(Integer value) { |
||||
addCriterion("`status` <", value, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusLessThanOrEqualTo(Integer value) { |
||||
addCriterion("`status` <=", value, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusIn(List<Integer> values) { |
||||
addCriterion("`status` in", values, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusNotIn(List<Integer> values) { |
||||
addCriterion("`status` not in", values, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusBetween(Integer value1, Integer value2) { |
||||
addCriterion("`status` between", value1, value2, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusNotBetween(Integer value1, Integer value2) { |
||||
addCriterion("`status` not between", value1, value2, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeIsNull() { |
||||
addCriterion("create_time is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeIsNotNull() { |
||||
addCriterion("create_time is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeEqualTo(Date value) { |
||||
addCriterion("create_time =", value, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeNotEqualTo(Date value) { |
||||
addCriterion("create_time <>", value, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeGreaterThan(Date value) { |
||||
addCriterion("create_time >", value, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { |
||||
addCriterion("create_time >=", value, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeLessThan(Date value) { |
||||
addCriterion("create_time <", value, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeLessThanOrEqualTo(Date value) { |
||||
addCriterion("create_time <=", value, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeIn(List<Date> values) { |
||||
addCriterion("create_time in", values, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeNotIn(List<Date> values) { |
||||
addCriterion("create_time not in", values, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeBetween(Date value1, Date value2) { |
||||
addCriterion("create_time between", value1, value2, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeNotBetween(Date value1, Date value2) { |
||||
addCriterion("create_time not between", value1, value2, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria 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<Date> values) { |
||||
addCriterion("update_time in", values, "updateTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andUpdateTimeNotIn(List<Date> 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<String> values) { |
||||
addCriterion("ext_1 in", values, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1NotIn(List<String> values) { |
||||
addCriterion("ext_1 not in", values, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1Between(String value1, String value2) { |
||||
addCriterion("ext_1 between", value1, value2, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1NotBetween(String value1, String value2) { |
||||
addCriterion("ext_1 not between", value1, value2, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2IsNull() { |
||||
addCriterion("ext_2 is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2IsNotNull() { |
||||
addCriterion("ext_2 is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2EqualTo(String value) { |
||||
addCriterion("ext_2 =", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2NotEqualTo(String value) { |
||||
addCriterion("ext_2 <>", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2GreaterThan(String value) { |
||||
addCriterion("ext_2 >", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2GreaterThanOrEqualTo(String value) { |
||||
addCriterion("ext_2 >=", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2LessThan(String value) { |
||||
addCriterion("ext_2 <", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2LessThanOrEqualTo(String value) { |
||||
addCriterion("ext_2 <=", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2Like(String value) { |
||||
addCriterion("ext_2 like", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2NotLike(String value) { |
||||
addCriterion("ext_2 not like", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2In(List<String> values) { |
||||
addCriterion("ext_2 in", values, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2NotIn(List<String> values) { |
||||
addCriterion("ext_2 not in", values, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2Between(String value1, String value2) { |
||||
addCriterion("ext_2 between", value1, value2, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2NotBetween(String value1, String value2) { |
||||
addCriterion("ext_2 not between", value1, value2, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3IsNull() { |
||||
addCriterion("ext_3 is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3IsNotNull() { |
||||
addCriterion("ext_3 is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3EqualTo(String value) { |
||||
addCriterion("ext_3 =", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3NotEqualTo(String value) { |
||||
addCriterion("ext_3 <>", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3GreaterThan(String value) { |
||||
addCriterion("ext_3 >", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3GreaterThanOrEqualTo(String value) { |
||||
addCriterion("ext_3 >=", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3LessThan(String value) { |
||||
addCriterion("ext_3 <", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3LessThanOrEqualTo(String value) { |
||||
addCriterion("ext_3 <=", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3Like(String value) { |
||||
addCriterion("ext_3 like", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3NotLike(String value) { |
||||
addCriterion("ext_3 not like", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3In(List<String> values) { |
||||
addCriterion("ext_3 in", values, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3NotIn(List<String> values) { |
||||
addCriterion("ext_3 not in", values, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3Between(String value1, String value2) { |
||||
addCriterion("ext_3 between", value1, value2, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3NotBetween(String value1, String value2) { |
||||
addCriterion("ext_3 not between", value1, value2, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
} |
||||
|
||||
/** |
||||
*/ |
||||
public static class Criteria extends GeneratedCriteria { |
||||
|
||||
protected Criteria() { |
||||
super(); |
||||
} |
||||
} |
||||
|
||||
public static class Criterion { |
||||
private String condition; |
||||
|
||||
private Object value; |
||||
|
||||
private Object secondValue; |
||||
|
||||
private boolean noValue; |
||||
|
||||
private boolean singleValue; |
||||
|
||||
private boolean betweenValue; |
||||
|
||||
private boolean listValue; |
||||
|
||||
private String typeHandler; |
||||
|
||||
public String getCondition() { |
||||
return condition; |
||||
} |
||||
|
||||
public Object getValue() { |
||||
return value; |
||||
} |
||||
|
||||
public Object getSecondValue() { |
||||
return secondValue; |
||||
} |
||||
|
||||
public boolean isNoValue() { |
||||
return noValue; |
||||
} |
||||
|
||||
public boolean isSingleValue() { |
||||
return singleValue; |
||||
} |
||||
|
||||
public boolean isBetweenValue() { |
||||
return betweenValue; |
||||
} |
||||
|
||||
public boolean isListValue() { |
||||
return listValue; |
||||
} |
||||
|
||||
public String getTypeHandler() { |
||||
return typeHandler; |
||||
} |
||||
|
||||
protected Criterion(String condition) { |
||||
super(); |
||||
this.condition = condition; |
||||
this.typeHandler = null; |
||||
this.noValue = true; |
||||
} |
||||
|
||||
protected Criterion(String condition, Object value, String typeHandler) { |
||||
super(); |
||||
this.condition = condition; |
||||
this.value = value; |
||||
this.typeHandler = typeHandler; |
||||
if (value instanceof List<?>) { |
||||
this.listValue = true; |
||||
} else { |
||||
this.singleValue = true; |
||||
} |
||||
} |
||||
|
||||
protected Criterion(String condition, Object value) { |
||||
this(condition, value, null); |
||||
} |
||||
|
||||
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { |
||||
super(); |
||||
this.condition = condition; |
||||
this.value = value; |
||||
this.secondValue = secondValue; |
||||
this.typeHandler = typeHandler; |
||||
this.betweenValue = true; |
||||
} |
||||
|
||||
protected Criterion(String condition, Object value, Object secondValue) { |
||||
this(condition, value, secondValue, null); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,35 @@ |
||||
package com.hfkj.service.merchant; |
||||
|
||||
import com.hfkj.entity.BsMerchantAccountRecord; |
||||
import com.hfkj.entity.BsMerchantChainBrandAccountRecord; |
||||
|
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* @className: BsMerchantChainBrandAccountRecordService |
||||
* @author: HuRui |
||||
* @date: 2024/8/14 |
||||
**/ |
||||
public interface BsMerchantChainBrandAccountRecordService { |
||||
|
||||
/** |
||||
* 创建 |
||||
* @param data |
||||
*/ |
||||
void create(BsMerchantChainBrandAccountRecord data); |
||||
|
||||
/** |
||||
* 查询详情 |
||||
* @param id |
||||
* @return |
||||
*/ |
||||
BsMerchantChainBrandAccountRecord getDetail(Long id); |
||||
|
||||
/** |
||||
* 查询列表 |
||||
* @param param |
||||
* @return |
||||
*/ |
||||
List<BsMerchantChainBrandAccountRecord> getList(Map<String,Object> param); |
||||
} |
@ -0,0 +1,54 @@ |
||||
package com.hfkj.service.merchant; |
||||
|
||||
import com.hfkj.entity.BsMerchantChainBrandAccount; |
||||
import com.hfkj.entity.BsOrderRefund; |
||||
|
||||
import java.math.BigDecimal; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* @className: BsMerchantChainBrandAccountService |
||||
* @author: HuRui |
||||
* @date: 2024/8/14 |
||||
**/ |
||||
public interface BsMerchantChainBrandAccountService { |
||||
|
||||
/** |
||||
* 编辑数据 |
||||
* @param data |
||||
*/ |
||||
void editData(BsMerchantChainBrandAccount data); |
||||
|
||||
/** |
||||
* 查询账户 |
||||
* @param chainBrandId 连锁品牌id |
||||
* @return |
||||
*/ |
||||
BsMerchantChainBrandAccount getAccount(Long chainBrandId); |
||||
|
||||
/** |
||||
* 充值 |
||||
* @param chainBrandId 连锁品牌id |
||||
* @param amount 金额 |
||||
*/ |
||||
void recharge(Long chainBrandId, BigDecimal amount) throws Exception; |
||||
|
||||
/** |
||||
* 扣除 |
||||
* @param chainBrandId 连锁品牌id |
||||
* @param merNo 商户 |
||||
* @param amount 金额 |
||||
* @param otherParam 其他参数 |
||||
*/ |
||||
void consume(Long chainBrandId,String merNo, BigDecimal amount, Map<String, Object> otherParam) throws Exception; |
||||
|
||||
/** |
||||
* 退款 |
||||
* @param chainBrandId |
||||
* @param merNo |
||||
* @param amount |
||||
* @param orderRefund |
||||
*/ |
||||
void refund(Long chainBrandId,String merNo, BigDecimal amount, BsOrderRefund orderRefund) throws Exception; |
||||
|
||||
} |
@ -0,0 +1,45 @@ |
||||
package com.hfkj.service.merchant; |
||||
|
||||
import com.hfkj.entity.BsMerchantChainBrand; |
||||
|
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* @className: BsMerchantChainBrandService |
||||
* @author: HuRui |
||||
* @date: 2024/8/14 |
||||
**/ |
||||
public interface BsMerchantChainBrandService { |
||||
|
||||
/** |
||||
* 编辑数据 |
||||
* @param data |
||||
*/ |
||||
void editData(BsMerchantChainBrand data); |
||||
|
||||
/** |
||||
* 创建 |
||||
* @param chainBrand |
||||
*/ |
||||
void create(BsMerchantChainBrand chainBrand) throws Exception; |
||||
|
||||
/** |
||||
* 修改 |
||||
* @param chainBrand |
||||
*/ |
||||
void update(BsMerchantChainBrand chainBrand); |
||||
|
||||
/** |
||||
* 查询详情 |
||||
* @param id |
||||
*/ |
||||
BsMerchantChainBrand getDetail(Long id); |
||||
|
||||
/** |
||||
* 查询列表 |
||||
* @param param |
||||
* @return |
||||
*/ |
||||
List<Map<String,Object>> getList(Map<String,Object> param); |
||||
} |
@ -0,0 +1,91 @@ |
||||
package com.hfkj.service.merchant.impl; |
||||
|
||||
import com.hfkj.common.security.UserCenter; |
||||
import com.hfkj.dao.BsMerchantChainBrandAccountRecordMapper; |
||||
import com.hfkj.entity.BsMerchantChainBrandAccountRecord; |
||||
import com.hfkj.entity.BsMerchantChainBrandAccountRecordExample; |
||||
import com.hfkj.model.SecUserSessionObject; |
||||
import com.hfkj.model.UserSessionObject; |
||||
import com.hfkj.service.merchant.BsMerchantChainBrandAccountRecordService; |
||||
import org.apache.commons.collections4.MapUtils; |
||||
import org.apache.commons.lang3.StringUtils; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import javax.annotation.Resource; |
||||
import java.util.Date; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* @className: BsMerchantChainBrandAccountRecordServiceImpl |
||||
* @author: HuRui |
||||
* @date: 2024/8/14 |
||||
**/ |
||||
@Service("merchantChainBrandAccountRecordService") |
||||
public class BsMerchantChainBrandAccountRecordServiceImpl implements BsMerchantChainBrandAccountRecordService { |
||||
@Resource |
||||
private BsMerchantChainBrandAccountRecordMapper merchantChainBrandAccountRecordMapper; |
||||
@Resource |
||||
private UserCenter userCenter; |
||||
@Override |
||||
public void create(BsMerchantChainBrandAccountRecord data) { |
||||
data.setOpUserType(0); |
||||
data.setOpUserId(0L); |
||||
data.setOpUserName("未知"); |
||||
data.setOpUserPhone("未知"); |
||||
|
||||
try { |
||||
SecUserSessionObject secUserSessionObject = userCenter.getSessionModel(SecUserSessionObject.class); |
||||
if (secUserSessionObject != null) { |
||||
data.setOpUserType(1); |
||||
data.setOpUserId(secUserSessionObject.getAccount().getId()); |
||||
data.setOpUserName(secUserSessionObject.getAccount().getUserName()); |
||||
data.setOpUserPhone(secUserSessionObject.getAccount().getTelephone()); |
||||
} |
||||
} catch (Exception e) { |
||||
System.out.println("获取管理员信息失败"); |
||||
} |
||||
|
||||
try { |
||||
UserSessionObject userModel = userCenter.getSessionModel(UserSessionObject.class); |
||||
if (userModel != null) { |
||||
data.setOpUserType(2); |
||||
data.setOpUserId(userModel.getUser().getId()); |
||||
data.setOpUserName(userModel.getUser().getUserName()); |
||||
data.setOpUserPhone(userModel.getUser().getPhone()); |
||||
} |
||||
} catch (Exception e) { |
||||
System.out.println("获取客户信息失败"); |
||||
} |
||||
|
||||
data.setStatus(1); |
||||
data.setCreateTime(new Date()); |
||||
merchantChainBrandAccountRecordMapper.insert(data); |
||||
} |
||||
|
||||
@Override |
||||
public BsMerchantChainBrandAccountRecord getDetail(Long id) { |
||||
return merchantChainBrandAccountRecordMapper.selectByPrimaryKey(id); |
||||
} |
||||
|
||||
@Override |
||||
public List<BsMerchantChainBrandAccountRecord> getList(Map<String, Object> param) { |
||||
BsMerchantChainBrandAccountRecordExample example = new BsMerchantChainBrandAccountRecordExample(); |
||||
BsMerchantChainBrandAccountRecordExample.Criteria criteria = example.createCriteria().andStatusNotEqualTo(0); |
||||
|
||||
if (MapUtils.getLong(param, "merChainBrandAccountId") != null) { |
||||
criteria.andMerChainBrandAccountIdEqualTo(MapUtils.getLong(param, "merChainBrandAccountId")); |
||||
} |
||||
|
||||
if (MapUtils.getLong(param, "merId") != null) { |
||||
criteria.andMerIdEqualTo(MapUtils.getLong(param, "merId")); |
||||
} |
||||
|
||||
if (StringUtils.isNotBlank(MapUtils.getString(param, "merNo"))) { |
||||
criteria.andMerNoEqualTo(MapUtils.getString(param, "merNo")); |
||||
} |
||||
|
||||
example.setOrderByClause("create_time desc"); |
||||
return merchantChainBrandAccountRecordMapper.selectByExample(example); |
||||
} |
||||
} |
@ -0,0 +1,202 @@ |
||||
package com.hfkj.service.merchant.impl; |
||||
|
||||
import com.hfkj.common.exception.ErrorCode; |
||||
import com.hfkj.common.exception.ErrorHelp; |
||||
import com.hfkj.common.exception.SysCode; |
||||
import com.hfkj.common.utils.DateUtil; |
||||
import com.hfkj.dao.BsMerchantChainBrandAccountMapper; |
||||
import com.hfkj.entity.*; |
||||
import com.hfkj.service.merchant.BsMerchantChainBrandAccountRecordService; |
||||
import com.hfkj.service.merchant.BsMerchantChainBrandAccountService; |
||||
import com.hfkj.sysenum.merchant.MerchantAccountRecordSourceTypeEnum; |
||||
import com.hfkj.sysenum.merchant.MerchantAccountRecordTypeEnum; |
||||
import org.apache.commons.collections4.MapUtils; |
||||
import org.springframework.data.redis.core.RedisTemplate; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import javax.annotation.Resource; |
||||
import java.math.BigDecimal; |
||||
import java.util.Date; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* @className: BsMerchantChainBrandAccountServiceImpl |
||||
* @author: HuRui |
||||
* @date: 2024/8/14 |
||||
**/ |
||||
@Service("merchantChainBrandAccountService ") |
||||
public class BsMerchantChainBrandAccountServiceImpl implements BsMerchantChainBrandAccountService { |
||||
@Resource |
||||
private BsMerchantChainBrandAccountMapper merchantChainBrandAccountMapper; |
||||
@Resource |
||||
private BsMerchantChainBrandAccountRecordService merchantChainBrandAccountRecordService; |
||||
@Resource |
||||
private RedisTemplate<String, Object> redisTemplate; |
||||
private final String LOCK_KEY = "MER_CHAIN_BRAND_ACCOUNT_LOCK_"; |
||||
@Override |
||||
public void editData(BsMerchantChainBrandAccount data) { |
||||
data.setUpdateTime(new Date()); |
||||
if (data.getId() == null) { |
||||
data.setCreateTime(new Date()); |
||||
merchantChainBrandAccountMapper.insert(data); |
||||
} else { |
||||
merchantChainBrandAccountMapper.updateByPrimaryKey(data); |
||||
} |
||||
} |
||||
|
||||
@Override |
||||
public BsMerchantChainBrandAccount getAccount(Long chainBrandId) { |
||||
BsMerchantChainBrandAccountExample example = new BsMerchantChainBrandAccountExample(); |
||||
example.createCriteria().andMerChainBrandIdEqualTo(chainBrandId).andStatusNotEqualTo(0); |
||||
List<BsMerchantChainBrandAccount> list = merchantChainBrandAccountMapper.selectByExample(example); |
||||
if (list.isEmpty()) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到账户"); |
||||
} |
||||
return list.get(0); |
||||
} |
||||
|
||||
@Override |
||||
public void recharge(Long chainBrandId, BigDecimal amount) throws Exception { |
||||
// 锁编号
|
||||
String lockKey = LOCK_KEY+chainBrandId; |
||||
// 获取锁
|
||||
Boolean lock = redisTemplate.opsForValue().setIfAbsent(lockKey, ""); |
||||
if (Boolean.TRUE.equals(lock)) { |
||||
try { |
||||
// 获取锁成功
|
||||
// 查询账户
|
||||
BsMerchantChainBrandAccount account = getAccount(chainBrandId); |
||||
// 变更前金额
|
||||
BigDecimal beforeAmount = account.getAmount(); |
||||
// 计算金额
|
||||
account.setAmount(account.getAmount().add(amount)); |
||||
editData(account); |
||||
// 变更后金额
|
||||
BigDecimal afterAmount = account.getAmount(); |
||||
|
||||
BsMerchantChainBrandAccountRecord record = new BsMerchantChainBrandAccountRecord(); |
||||
record.setMerChainBrandAccountId(account.getId()); |
||||
record.setType(MerchantAccountRecordTypeEnum.type1.getType()); |
||||
record.setTransactionAmount(amount); |
||||
record.setBeforeAmount(beforeAmount); |
||||
record.setAfterAmount(afterAmount); |
||||
record.setSourceType(MerchantAccountRecordSourceTypeEnum.type1.getType()); |
||||
try { |
||||
record.setSourceOrderNo(DateUtil.date2String(new Date(), "yyyyMMddHHmmss")); |
||||
} catch (Exception e) { |
||||
e.printStackTrace(); |
||||
} |
||||
record.setSourceContent("充值金额:" + record.getTransactionAmount()); |
||||
merchantChainBrandAccountRecordService.create(record); |
||||
// 释放锁
|
||||
redisTemplate.delete(lockKey); |
||||
|
||||
} catch (Exception e) { |
||||
e.printStackTrace(); |
||||
// 释放锁
|
||||
redisTemplate.delete(lockKey); |
||||
} |
||||
} else { |
||||
Thread.sleep(100); |
||||
recharge(chainBrandId, amount); |
||||
} |
||||
} |
||||
|
||||
@Override |
||||
public void consume(Long chainBrandId,String merNo, BigDecimal amount, Map<String, Object> otherParam) throws Exception { |
||||
// 锁编号
|
||||
String lockKey = LOCK_KEY+chainBrandId; |
||||
// 获取锁
|
||||
Boolean lock = redisTemplate.opsForValue().setIfAbsent(lockKey, ""); |
||||
if (Boolean.TRUE.equals(lock)) { |
||||
try { |
||||
// 获取锁成功
|
||||
/* // 余额 是否小于 消费余额
|
||||
if (merAccount.getAmount().compareTo(amount) == -1) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "余额不足"); |
||||
}*/ |
||||
// 查询账户
|
||||
BsMerchantChainBrandAccount account = getAccount(chainBrandId); |
||||
// 变更前金额
|
||||
BigDecimal beforeAmount = account.getAmount(); |
||||
// 计算消费后金额
|
||||
account.setAmount(account.getAmount().subtract(amount)); |
||||
// 累积消费金额
|
||||
account.setAmountConsume(account.getAmountConsume().add(amount)); |
||||
editData(account); |
||||
// 变更后金额
|
||||
BigDecimal afterAmount = account.getAmount(); |
||||
|
||||
BsMerchantChainBrandAccountRecord record = new BsMerchantChainBrandAccountRecord(); |
||||
record.setMerChainBrandAccountId(account.getId()); |
||||
record.setMerNo(merNo); |
||||
record.setType(MerchantAccountRecordTypeEnum.type2.getType()); |
||||
record.setTransactionAmount(amount); |
||||
record.setBeforeAmount(beforeAmount); |
||||
record.setAfterAmount(afterAmount); |
||||
record.setSourceType(MapUtils.getInteger(otherParam, "sourceType")); |
||||
record.setSourceId(MapUtils.getLong(otherParam, "sourceId")); |
||||
record.setSourceOrderNo(MapUtils.getString(otherParam, "sourceOrderNo")); |
||||
record.setSourceContent(MapUtils.getString(otherParam, "sourceContent")); |
||||
merchantChainBrandAccountRecordService.create(record); |
||||
// 释放锁
|
||||
redisTemplate.delete(lockKey); |
||||
|
||||
} catch (Exception e) { |
||||
e.printStackTrace(); |
||||
// 释放锁
|
||||
redisTemplate.delete(lockKey); |
||||
} |
||||
} else { |
||||
Thread.sleep(100); |
||||
consume(chainBrandId, merNo, amount, otherParam); |
||||
} |
||||
} |
||||
|
||||
@Override |
||||
public void refund(Long chainBrandId,String merNo, BigDecimal amount, BsOrderRefund orderRefund) throws Exception { |
||||
// 锁编号
|
||||
String lockKey = LOCK_KEY+chainBrandId; |
||||
// 获取锁
|
||||
Boolean lock = redisTemplate.opsForValue().setIfAbsent(lockKey, ""); |
||||
if (Boolean.TRUE.equals(lock)) { |
||||
try { |
||||
// 获取锁成功
|
||||
// 查询账户
|
||||
BsMerchantChainBrandAccount account = getAccount(chainBrandId); |
||||
// 变更前金额
|
||||
BigDecimal beforeAmount = account.getAmount(); |
||||
// 计算退款后的金额
|
||||
account.setAmount(account.getAmount().add(amount)); |
||||
// 累积消费金额
|
||||
account.setAmountConsume(account.getAmountConsume().subtract(amount)); |
||||
editData(account); |
||||
// 变更后金额
|
||||
BigDecimal afterAmount = account.getAmount(); |
||||
|
||||
BsMerchantChainBrandAccountRecord record = new BsMerchantChainBrandAccountRecord(); |
||||
record.setMerChainBrandAccountId(account.getId()); |
||||
record.setMerNo(merNo); |
||||
record.setType(MerchantAccountRecordTypeEnum.type1.getType()); |
||||
record.setTransactionAmount(amount); |
||||
record.setBeforeAmount(beforeAmount); |
||||
record.setAfterAmount(afterAmount); |
||||
record.setSourceType(MerchantAccountRecordSourceTypeEnum.type3.getType()); |
||||
record.setSourceId(orderRefund.getId()); |
||||
record.setSourceOrderNo(orderRefund.getRefundOrderNo()); |
||||
merchantChainBrandAccountRecordService.create(record); |
||||
// 释放锁
|
||||
redisTemplate.delete(lockKey); |
||||
|
||||
} catch (Exception e) { |
||||
e.printStackTrace(); |
||||
// 释放锁
|
||||
redisTemplate.delete(lockKey); |
||||
} |
||||
} else { |
||||
Thread.sleep(100); |
||||
refund(chainBrandId, merNo, amount, orderRefund); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,95 @@ |
||||
package com.hfkj.service.merchant.impl; |
||||
|
||||
import com.hfkj.common.exception.ErrorCode; |
||||
import com.hfkj.common.exception.ErrorHelp; |
||||
import com.hfkj.common.exception.SysCode; |
||||
import com.hfkj.common.utils.MD5Util; |
||||
import com.hfkj.dao.BsMerchantChainBrandMapper; |
||||
import com.hfkj.entity.BsMerchantChainBrand; |
||||
import com.hfkj.entity.BsMerchantChainBrandAccount; |
||||
import com.hfkj.entity.BsMerchantChainBrandAccountExample; |
||||
import com.hfkj.entity.SecUser; |
||||
import com.hfkj.service.merchant.BsMerchantChainBrandAccountService; |
||||
import com.hfkj.service.merchant.BsMerchantChainBrandService; |
||||
import com.hfkj.service.sec.SecUserService; |
||||
import com.hfkj.sysenum.SecUserObjectTypeEnum; |
||||
import org.springframework.stereotype.Service; |
||||
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; |
||||
|
||||
/** |
||||
* @className: BsMerchantChainBrandServiceImpl |
||||
* @author: HuRui |
||||
* @date: 2024/8/14 |
||||
**/ |
||||
@Service("merchantChainBrandService") |
||||
public class BsMerchantChainBrandServiceImpl implements BsMerchantChainBrandService { |
||||
@Resource |
||||
private BsMerchantChainBrandMapper merchantChainBrandMapper; |
||||
@Resource |
||||
private BsMerchantChainBrandAccountService merchantChainBrandAccountService; |
||||
@Resource |
||||
private SecUserService secUserService; |
||||
@Override |
||||
public void editData(BsMerchantChainBrand data) { |
||||
data.setUpdateTime(new Date()); |
||||
if (data.getId() == null) { |
||||
data.setCreateTime(new Date()); |
||||
merchantChainBrandMapper.insert(data); |
||||
} else { |
||||
merchantChainBrandMapper.updateByPrimaryKey(data); |
||||
} |
||||
} |
||||
|
||||
@Override |
||||
@Transactional(propagation= Propagation.REQUIRES_NEW,rollbackFor= {RuntimeException.class}) |
||||
public void create(BsMerchantChainBrand chainBrand) throws Exception { |
||||
editData(chainBrand); |
||||
|
||||
// 余额账户
|
||||
BsMerchantChainBrandAccount account = new BsMerchantChainBrandAccount(); |
||||
account.setMerChainBrandId(chainBrand.getId()); |
||||
account.setAmount(new BigDecimal("0")); |
||||
account.setAmountConsume(new BigDecimal("0")); |
||||
account.setStatus(1); |
||||
merchantChainBrandAccountService.editData(account); |
||||
|
||||
if (secUserService.getDetailByLoginName(chainBrand.getContactsTelephone()) != null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "手机号已存在,请更换"); |
||||
} |
||||
|
||||
// 登录账户
|
||||
SecUser secUser = new SecUser(); |
||||
secUser.setUserName(chainBrand.getName()); |
||||
secUser.setLoginName(chainBrand.getContactsTelephone()); |
||||
secUser.setPassword(MD5Util.encode("123654".getBytes())); |
||||
secUser.setObjectType(SecUserObjectTypeEnum.type6.getCode()); |
||||
secUser.setObjectId(chainBrand.getId()); |
||||
secUser.setRoleId(7L); |
||||
secUser.setStatus(1); |
||||
secUser.setCreateTime(new Date()); |
||||
secUser.setUpdateTime(new Date()); |
||||
secUserService.editUser(secUser); |
||||
} |
||||
|
||||
@Override |
||||
public void update(BsMerchantChainBrand chainBrand) { |
||||
editData(chainBrand); |
||||
} |
||||
|
||||
@Override |
||||
public BsMerchantChainBrand getDetail(Long id) { |
||||
return merchantChainBrandMapper.selectByPrimaryKey(id); |
||||
} |
||||
|
||||
@Override |
||||
public List<Map<String, Object>> getList(Map<String, Object> param) { |
||||
return merchantChainBrandMapper.selectChainBrand(param); |
||||
} |
||||
} |
@ -0,0 +1,51 @@ |
||||
package com.hfkj.sysenum.merchant; |
||||
|
||||
import lombok.Getter; |
||||
|
||||
import java.util.Objects; |
||||
|
||||
/** |
||||
* @className: MerchantChainBrandSettleTypeEnum |
||||
* @author: HuRui |
||||
* @date: 2024/8/14 |
||||
**/ |
||||
@Getter |
||||
public enum MerchantChainBrandSettleTypeEnum { |
||||
/** |
||||
* 连锁额度 |
||||
*/ |
||||
type1(1, "连锁额度"), |
||||
/** |
||||
* 商户额度 |
||||
*/ |
||||
type2(2, "商户额度"), |
||||
; |
||||
|
||||
private Integer number; |
||||
|
||||
private String name; |
||||
|
||||
MerchantChainBrandSettleTypeEnum(int number, String name) { |
||||
this.number = number; |
||||
this.name = name; |
||||
} |
||||
|
||||
public static MerchantChainBrandSettleTypeEnum getDataByType(Integer type) { |
||||
for (MerchantChainBrandSettleTypeEnum ele : values()) { |
||||
if (Objects.equals(type,ele.getNumber())) { |
||||
return ele; |
||||
} |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
public static String getNameByType(Integer type) { |
||||
for (MerchantChainBrandSettleTypeEnum ele : values()) { |
||||
if (Objects.equals(type,ele.getNumber())) { |
||||
return ele.getName(); |
||||
} |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
} |
@ -1,4 +1,4 @@ |
||||
package com.hfkj.sysenum; |
||||
package com.hfkj.sysenum.merchant; |
||||
|
||||
import java.util.Objects; |
||||
|
@ -1,4 +1,4 @@ |
||||
package com.hfkj.sysenum; |
||||
package com.hfkj.sysenum.merchant; |
||||
|
||||
import java.util.Objects; |
||||
|
@ -1,4 +1,4 @@ |
||||
package com.hfkj.sysenum; |
||||
package com.hfkj.sysenum.merchant; |
||||
|
||||
import lombok.Getter; |
||||
|
@ -1,4 +1,4 @@ |
||||
package com.hfkj.sysenum; |
||||
package com.hfkj.sysenum.merchant; |
||||
|
||||
import java.util.Objects; |
||||
|
Loading…
Reference in new issue