parent
5f4f05cb6a
commit
8d156bc7bd
@ -0,0 +1,321 @@ |
||||
package com.bweb.controller; |
||||
|
||||
import com.alibaba.fastjson.JSONArray; |
||||
import com.alibaba.fastjson.JSONObject; |
||||
import com.hfkj.channel.weixin.utils.WxOrderConfig; |
||||
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.DateUtil; |
||||
import com.hfkj.common.utils.IDGenerator; |
||||
import com.hfkj.common.utils.ResponseMsgUtil; |
||||
import com.hfkj.entity.*; |
||||
import com.hfkj.model.ResponseData; |
||||
import com.hfkj.model.UserInfoModel; |
||||
import com.hfkj.service.*; |
||||
import com.hfkj.sysenum.PlatformTypeEnum; |
||||
import com.hfkj.sysenum.ProfitSharingReceiverRoleEnum; |
||||
import com.hfkj.sysenum.TradeOrderRefundStatusEnum; |
||||
import com.hfkj.sysenum.TradeOrderStatusEnum; |
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
import io.swagger.models.auth.In; |
||||
import org.apache.commons.collections4.MapUtils; |
||||
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.*; |
||||
|
||||
/** |
||||
* @className: BsTradeTakeConfigController |
||||
* @author: HuRui |
||||
* @date: 2023/2/27 |
||||
**/ |
||||
@Controller |
||||
@Api(value = "交易订单退款") |
||||
@RequestMapping(value = "/tradeTakeConfig") |
||||
public class BsTradeTakeConfigController { |
||||
|
||||
private static Logger log = LoggerFactory.getLogger(BsTradeTakeConfigController.class); |
||||
|
||||
@Resource |
||||
private BsCompanyService companyService; |
||||
@Resource |
||||
private BsTradeTakeConfigService tradeTakeConfigService; |
||||
@Resource |
||||
private BsAgentService agentService; |
||||
@Resource |
||||
private BsMerPlatformNoService merPlatformNoService; |
||||
@Resource |
||||
private UserCenter userCenter; |
||||
|
||||
@RequestMapping(value="/editParentCompanyConfig",method = RequestMethod.POST) |
||||
@ResponseBody |
||||
@ApiOperation(value = "编辑母公司抽成配置") |
||||
public ResponseData editParentCompanyConfig(@RequestBody JSONObject body) { |
||||
try { |
||||
UserInfoModel userInfoModel = userCenter.getSessionModel(UserInfoModel.class); |
||||
if (userInfoModel.getBsCompany() == null) { |
||||
log.error("configAccount error!","权限不足"); |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, ""); |
||||
} |
||||
|
||||
if (body == null |
||||
|| body.getLong("companyId") == null |
||||
|| body.getInteger("platformType") == null |
||||
|| StringUtils.isBlank(body.getString("receiverAccount")) |
||||
|| StringUtils.isBlank(body.getString("receiverName")) |
||||
|| body.getBigDecimal("receiverRatio") == null) { |
||||
log.error("configStore error!", "参数错误"); |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); |
||||
} |
||||
// 公司
|
||||
BsCompany company = companyService.getCompanyById(body.getLong("companyId")); |
||||
if (company == null) { |
||||
log.error("configStore error!", "参数错误"); |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知公司"); |
||||
} |
||||
// 平台类型
|
||||
PlatformTypeEnum platformType = PlatformTypeEnum.getDataByNumber(body.getInteger("platformType")); |
||||
if (platformType == null) { |
||||
log.error("configStore error!", "参数错误"); |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的平台"); |
||||
} |
||||
// 接收方角色
|
||||
ProfitSharingReceiverRoleEnum receiverRoleEnum = ProfitSharingReceiverRoleEnum.role1; |
||||
|
||||
// 查询配置
|
||||
BsTradeTakeConfig tradeTakeConfig = tradeTakeConfigService.getTradeTakeConfig( |
||||
company.getId(), |
||||
platformType, |
||||
receiverRoleEnum, |
||||
userInfoModel.getBsCompany().getId(), |
||||
null); |
||||
if (tradeTakeConfig == null) { |
||||
tradeTakeConfig = new BsTradeTakeConfig(); |
||||
} |
||||
tradeTakeConfig.setCompanyId(company.getId()); |
||||
tradeTakeConfig.setCompanyName(company.getName()); |
||||
tradeTakeConfig.setPlatformType(platformType.getNumber()); |
||||
tradeTakeConfig.setPlatformTypeName(platformType.getName()); |
||||
tradeTakeConfig.setReceiverRole(receiverRoleEnum.getNumber()); |
||||
tradeTakeConfig.setReceiverRoleName(receiverRoleEnum.getName()); |
||||
tradeTakeConfig.setReceiverAccount(body.getString("receiverAccount")); |
||||
tradeTakeConfig.setReceiverName(body.getString("receiverName")); |
||||
tradeTakeConfig.setReceiverRatio(body.getBigDecimal("receiverRatio")); |
||||
tradeTakeConfig.setReceiverObjectId(userInfoModel.getBsCompany().getId()); |
||||
tradeTakeConfig.setReceiverObjectName(userInfoModel.getBsCompany().getName()); |
||||
tradeTakeConfig.setOpUserId(userInfoModel.getSecUser().getId()); |
||||
tradeTakeConfig.setOpUserName(userInfoModel.getSecUser().getUserName()); |
||||
tradeTakeConfigService.editData(tradeTakeConfig); |
||||
|
||||
|
||||
BsTradeTakeConfig finalTradeTakeConfig = tradeTakeConfig; |
||||
new Thread(() -> { |
||||
Map<String,Object> param = new HashMap<>(); |
||||
param.put("platformType", PlatformTypeEnum.type4.getNumber()); |
||||
List<BsMerPlatformNo> merPlatformNoList = merPlatformNoService.getMerPlatformNoList(param); |
||||
for (BsMerPlatformNo platformNo : merPlatformNoList) { |
||||
try { |
||||
TreeMap<String, String> response = WxOrderConfig.profitsharingAddReceiver(platformNo.getPlatformNo(), finalTradeTakeConfig.getReceiverName(), finalTradeTakeConfig.getReceiverAccount()); |
||||
if(!"SUCCESS".equals(MapUtils.getString(response, "return_code")) || !"SUCCESS".equals(MapUtils.getString(response, "result_code"))) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "与商户号:"+platformNo.getPlatformNo()+"创建分账关系失败!原因:" + MapUtils.getString(response,"err_code_des")); |
||||
} |
||||
} catch (Exception e) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "与商户号:"+platformNo.getPlatformNo()+"创建分账关系失败!原因:" + e); |
||||
} |
||||
|
||||
} |
||||
}); |
||||
|
||||
return ResponseMsgUtil.success("配置成功"); |
||||
|
||||
} catch (Exception e) { |
||||
log.error(e.getMessage(), e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
@RequestMapping(value="/editAgentConfig",method = RequestMethod.POST) |
||||
@ResponseBody |
||||
@ApiOperation(value = "编辑代理商抽成配置") |
||||
public ResponseData editAgentConfig(@RequestBody JSONObject body) { |
||||
try { |
||||
UserInfoModel userInfoModel = userCenter.getSessionModel(UserInfoModel.class); |
||||
if (userInfoModel.getBsCompany() == null) { |
||||
log.error("configAccount error!","权限不足"); |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, ""); |
||||
} |
||||
if (body == null |
||||
|| body.getInteger("platformType") == null |
||||
|
||||
|| StringUtils.isBlank(body.getString("receiverName")) |
||||
|| StringUtils.isBlank(body.getString("receiverAccount")) |
||||
|| body.getBigDecimal("receiverRatio") == null |
||||
|
||||
|| StringUtils.isBlank(body.getString("subReceiverName")) |
||||
|| StringUtils.isBlank(body.getString("subReceiverAccount")) |
||||
|| body.getBigDecimal("subReceiverRatio") == null |
||||
|| body.getLong("subReceiverObjectId") == null |
||||
) { |
||||
log.error("configStore error!", "参数错误"); |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); |
||||
} |
||||
// 平台类型
|
||||
PlatformTypeEnum platformType = PlatformTypeEnum.getDataByNumber(body.getInteger("platformType")); |
||||
if (platformType == null) { |
||||
log.error("configStore error!", "参数错误"); |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的平台"); |
||||
} |
||||
// 公司
|
||||
BsCompany company = companyService.getCompanyById(userInfoModel.getBsCompany().getId()); |
||||
if (company == null) { |
||||
log.error("configStore error!", "参数错误"); |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知公司"); |
||||
} |
||||
// 代理商
|
||||
BsAgent agent = agentService.getAgent(body.getLong("subReceiverObjectId")); |
||||
if (agent == null) { |
||||
log.error("configStore error!", "参数错误"); |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知代理商"); |
||||
} |
||||
// 公司角色
|
||||
ProfitSharingReceiverRoleEnum receiverRoleEnum = ProfitSharingReceiverRoleEnum.role2; |
||||
// 代理商角色
|
||||
ProfitSharingReceiverRoleEnum subReceiverRoleEnum = ProfitSharingReceiverRoleEnum.role3; |
||||
// 查询配置
|
||||
BsTradeTakeConfig tradeTakeConfig = tradeTakeConfigService.getTradeTakeConfig( |
||||
company.getId(), |
||||
platformType, |
||||
receiverRoleEnum, |
||||
company.getId(), |
||||
body.getLong("subReceiverObjectId")); |
||||
|
||||
if (tradeTakeConfig == null) { |
||||
tradeTakeConfig = new BsTradeTakeConfig(); |
||||
} |
||||
tradeTakeConfig.setCompanyId(company.getId()); |
||||
tradeTakeConfig.setCompanyName(company.getName()); |
||||
tradeTakeConfig.setPlatformType(platformType.getNumber()); |
||||
tradeTakeConfig.setPlatformTypeName(platformType.getName()); |
||||
tradeTakeConfig.setReceiverRole(receiverRoleEnum.getNumber()); |
||||
tradeTakeConfig.setReceiverRoleName(receiverRoleEnum.getName()); |
||||
tradeTakeConfig.setReceiverAccount(body.getString("receiverAccount")); |
||||
tradeTakeConfig.setReceiverName(body.getString("receiverName")); |
||||
tradeTakeConfig.setReceiverRatio(body.getBigDecimal("receiverRatio")); |
||||
tradeTakeConfig.setReceiverObjectId(company.getId()); |
||||
tradeTakeConfig.setReceiverObjectName(company.getName()); |
||||
|
||||
tradeTakeConfig.setSubReceiverRole(subReceiverRoleEnum.getNumber()); |
||||
tradeTakeConfig.setSubReceiverRoleName(subReceiverRoleEnum.getName()); |
||||
tradeTakeConfig.setSubReceiverName(body.getString("subReceiverName")); |
||||
tradeTakeConfig.setSubReceiverAccount(body.getString("subReceiverAccount")); |
||||
tradeTakeConfig.setSubReceiverRatio(body.getBigDecimal("subReceiverRatio")); |
||||
tradeTakeConfig.setSubReceiverObjectId(agent.getId()); |
||||
tradeTakeConfig.setSubReceiverObjectName(agent.getName()); |
||||
tradeTakeConfig.setOpUserId(agent.getId()); |
||||
tradeTakeConfig.setOpUserName(agent.getName()); |
||||
tradeTakeConfigService.editData(tradeTakeConfig); |
||||
|
||||
BsTradeTakeConfig finalTradeTakeConfig = tradeTakeConfig; |
||||
new Thread(() -> { |
||||
Map<String,Object> param = new HashMap<>(); |
||||
param.put("companyId", finalTradeTakeConfig.getReceiverObjectId()); |
||||
param.put("agentId", finalTradeTakeConfig.getSubReceiverObjectId()); |
||||
param.put("platformType", PlatformTypeEnum.type4.getNumber()); |
||||
List<BsMerPlatformNo> merPlatformNoList = merPlatformNoService.getMerPlatformNoList(param); |
||||
for (BsMerPlatformNo platformNo : merPlatformNoList) { |
||||
try { |
||||
TreeMap<String, String> response = WxOrderConfig.profitsharingAddReceiver(platformNo.getPlatformNo(), finalTradeTakeConfig.getReceiverName(), finalTradeTakeConfig.getReceiverAccount()); |
||||
if(!"SUCCESS".equals(MapUtils.getString(response, "return_code")) || !"SUCCESS".equals(MapUtils.getString(response, "result_code"))) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "分公司与商户号:"+platformNo.getPlatformNo()+"创建分账关系失败!原因:" + MapUtils.getString(response,"err_code_des")); |
||||
} |
||||
|
||||
TreeMap<String, String> subResponse = WxOrderConfig.profitsharingAddReceiver(platformNo.getPlatformNo(), finalTradeTakeConfig.getSubReceiverName(), finalTradeTakeConfig.getSubReceiverAccount()); |
||||
if(!"SUCCESS".equals(MapUtils.getString(subResponse, "return_code")) || !"SUCCESS".equals(MapUtils.getString(subResponse, "result_code"))) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "代理商与商户号:"+platformNo.getPlatformNo()+"创建分账关系失败!原因:" + MapUtils.getString(subResponse,"err_code_des")); |
||||
} |
||||
} catch (Exception e) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "与商户号:"+platformNo.getPlatformNo()+"创建分账关系失败!原因:" + e); |
||||
} |
||||
} |
||||
}); |
||||
|
||||
return ResponseMsgUtil.success("配置成功"); |
||||
|
||||
} catch (Exception e) { |
||||
log.error(e.getMessage(), e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
@RequestMapping(value="/getTradeTakeConfig",method = RequestMethod.GET) |
||||
@ResponseBody |
||||
@ApiOperation(value = "查询交易配置") |
||||
public ResponseData getTradeTakeConfig(@RequestParam(value = "companyId", required = true) Long companyId, |
||||
@RequestParam(value = "platformType", required = true) Integer platformType, |
||||
@RequestParam(value = "profitSharingReceiverRole", required = true) Integer profitSharingReceiverRole, |
||||
@RequestParam(value = "receiverObjectId", required = false) Long receiverObjectId, |
||||
@RequestParam(value = "subReceiverObjectId", required = false) Long subReceiverObjectId) { |
||||
try { |
||||
|
||||
// 平台类型
|
||||
PlatformTypeEnum platform = PlatformTypeEnum.getDataByNumber(platformType); |
||||
if (platformType == null) { |
||||
log.error("configStore error!", "参数错误"); |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的平台"); |
||||
} |
||||
|
||||
ProfitSharingReceiverRoleEnum receiverRoleEnum = ProfitSharingReceiverRoleEnum.getDataByNumber(profitSharingReceiverRole); |
||||
if (receiverRoleEnum == null) { |
||||
log.error("getTradeTakeConfig error!","权限不足"); |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, ""); |
||||
} |
||||
|
||||
return ResponseMsgUtil.success(tradeTakeConfigService.getTradeTakeConfig(companyId, platform, receiverRoleEnum, receiverObjectId, subReceiverObjectId)); |
||||
|
||||
} catch (Exception e) { |
||||
log.error(e.getMessage(), e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
@RequestMapping(value="/getAgentTradeTakeConfig",method = RequestMethod.GET) |
||||
@ResponseBody |
||||
@ApiOperation(value = "查代理商交易配置") |
||||
public ResponseData getAgentTradeTakeConfig(@RequestParam(value = "platformType", required = true) Integer platformType, |
||||
@RequestParam(value = "agentId", required = true) Long agentId) { |
||||
try { |
||||
UserInfoModel userInfoModel = userCenter.getSessionModel(UserInfoModel.class); |
||||
if (userInfoModel.getBsCompany() == null) { |
||||
log.error("configAccount error!","权限不足"); |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, ""); |
||||
} |
||||
|
||||
// 代理商
|
||||
BsAgent agent = agentService.getAgent(agentId); |
||||
if (agent == null) { |
||||
log.error("BsTradeTakeConfigController --> getAgentTradeTakeConfig() error!", "参数错误"); |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); |
||||
} |
||||
// 平台类型
|
||||
PlatformTypeEnum platform = PlatformTypeEnum.getDataByNumber(platformType); |
||||
if (platformType == null) { |
||||
log.error("configStore error!", "参数错误"); |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的平台"); |
||||
} |
||||
|
||||
return ResponseMsgUtil.success(tradeTakeConfigService.getTradeTakeConfig(agent.getCompanyId(), platform, ProfitSharingReceiverRoleEnum.role2, null, agent.getId())); |
||||
|
||||
} catch (Exception e) { |
||||
log.error(e.getMessage(), e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,190 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
import com.hfkj.entity.BsTradeTakeConfig; |
||||
import com.hfkj.entity.BsTradeTakeConfigExample; |
||||
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 BsTradeTakeConfigMapper extends BsTradeTakeConfigMapperExt { |
||||
@SelectProvider(type=BsTradeTakeConfigSqlProvider.class, method="countByExample") |
||||
long countByExample(BsTradeTakeConfigExample example); |
||||
|
||||
@DeleteProvider(type=BsTradeTakeConfigSqlProvider.class, method="deleteByExample") |
||||
int deleteByExample(BsTradeTakeConfigExample example); |
||||
|
||||
@Delete({ |
||||
"delete from bs_trade_take_config", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
int deleteByPrimaryKey(Long id); |
||||
|
||||
@Insert({ |
||||
"insert into bs_trade_take_config (company_id, company_name, ", |
||||
"platform_type, platform_type_name, ", |
||||
"receiver_role, receiver_role_name, ", |
||||
"receiver_account, receiver_name, ", |
||||
"receiver_ratio, receiver_object_id, ", |
||||
"receiver_object_name, sub_receiver_role, ", |
||||
"sub_receiver_role_name, sub_receiver_account, ", |
||||
"sub_receiver_name, sub_receiver_ratio, ", |
||||
"sub_receiver_object_id, sub_receiver_object_name, ", |
||||
"`status`, op_user_id, ", |
||||
"op_user_name, create_time, ", |
||||
"update_time, ext_1, ", |
||||
"ext_2, ext_3)", |
||||
"values (#{companyId,jdbcType=BIGINT}, #{companyName,jdbcType=VARCHAR}, ", |
||||
"#{platformType,jdbcType=INTEGER}, #{platformTypeName,jdbcType=VARCHAR}, ", |
||||
"#{receiverRole,jdbcType=INTEGER}, #{receiverRoleName,jdbcType=VARCHAR}, ", |
||||
"#{receiverAccount,jdbcType=VARCHAR}, #{receiverName,jdbcType=VARCHAR}, ", |
||||
"#{receiverRatio,jdbcType=DECIMAL}, #{receiverObjectId,jdbcType=BIGINT}, ", |
||||
"#{receiverObjectName,jdbcType=VARCHAR}, #{subReceiverRole,jdbcType=INTEGER}, ", |
||||
"#{subReceiverRoleName,jdbcType=VARCHAR}, #{subReceiverAccount,jdbcType=VARCHAR}, ", |
||||
"#{subReceiverName,jdbcType=VARCHAR}, #{subReceiverRatio,jdbcType=DECIMAL}, ", |
||||
"#{subReceiverObjectId,jdbcType=BIGINT}, #{subReceiverObjectName,jdbcType=VARCHAR}, ", |
||||
"#{status,jdbcType=INTEGER}, #{opUserId,jdbcType=BIGINT}, ", |
||||
"#{opUserName,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, ", |
||||
"#{updateTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ", |
||||
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" |
||||
}) |
||||
@Options(useGeneratedKeys=true,keyProperty="id") |
||||
int insert(BsTradeTakeConfig record); |
||||
|
||||
@InsertProvider(type=BsTradeTakeConfigSqlProvider.class, method="insertSelective") |
||||
@Options(useGeneratedKeys=true,keyProperty="id") |
||||
int insertSelective(BsTradeTakeConfig record); |
||||
|
||||
@SelectProvider(type=BsTradeTakeConfigSqlProvider.class, method="selectByExample") |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), |
||||
@Result(column="company_id", property="companyId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="company_name", property="companyName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="platform_type", property="platformType", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="platform_type_name", property="platformTypeName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="receiver_role", property="receiverRole", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="receiver_role_name", property="receiverRoleName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="receiver_account", property="receiverAccount", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="receiver_name", property="receiverName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="receiver_ratio", property="receiverRatio", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="receiver_object_id", property="receiverObjectId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="receiver_object_name", property="receiverObjectName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="sub_receiver_role", property="subReceiverRole", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="sub_receiver_role_name", property="subReceiverRoleName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="sub_receiver_account", property="subReceiverAccount", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="sub_receiver_name", property="subReceiverName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="sub_receiver_ratio", property="subReceiverRatio", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="sub_receiver_object_id", property="subReceiverObjectId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="sub_receiver_object_name", property="subReceiverObjectName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="status", property="status", 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="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<BsTradeTakeConfig> selectByExample(BsTradeTakeConfigExample example); |
||||
|
||||
@Select({ |
||||
"select", |
||||
"id, company_id, company_name, platform_type, platform_type_name, receiver_role, ", |
||||
"receiver_role_name, receiver_account, receiver_name, receiver_ratio, receiver_object_id, ", |
||||
"receiver_object_name, sub_receiver_role, sub_receiver_role_name, sub_receiver_account, ", |
||||
"sub_receiver_name, sub_receiver_ratio, sub_receiver_object_id, sub_receiver_object_name, ", |
||||
"`status`, op_user_id, op_user_name, create_time, update_time, ext_1, ext_2, ", |
||||
"ext_3", |
||||
"from bs_trade_take_config", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), |
||||
@Result(column="company_id", property="companyId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="company_name", property="companyName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="platform_type", property="platformType", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="platform_type_name", property="platformTypeName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="receiver_role", property="receiverRole", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="receiver_role_name", property="receiverRoleName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="receiver_account", property="receiverAccount", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="receiver_name", property="receiverName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="receiver_ratio", property="receiverRatio", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="receiver_object_id", property="receiverObjectId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="receiver_object_name", property="receiverObjectName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="sub_receiver_role", property="subReceiverRole", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="sub_receiver_role_name", property="subReceiverRoleName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="sub_receiver_account", property="subReceiverAccount", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="sub_receiver_name", property="subReceiverName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="sub_receiver_ratio", property="subReceiverRatio", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="sub_receiver_object_id", property="subReceiverObjectId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="sub_receiver_object_name", property="subReceiverObjectName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="status", property="status", 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="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) |
||||
}) |
||||
BsTradeTakeConfig selectByPrimaryKey(Long id); |
||||
|
||||
@UpdateProvider(type=BsTradeTakeConfigSqlProvider.class, method="updateByExampleSelective") |
||||
int updateByExampleSelective(@Param("record") BsTradeTakeConfig record, @Param("example") BsTradeTakeConfigExample example); |
||||
|
||||
@UpdateProvider(type=BsTradeTakeConfigSqlProvider.class, method="updateByExample") |
||||
int updateByExample(@Param("record") BsTradeTakeConfig record, @Param("example") BsTradeTakeConfigExample example); |
||||
|
||||
@UpdateProvider(type=BsTradeTakeConfigSqlProvider.class, method="updateByPrimaryKeySelective") |
||||
int updateByPrimaryKeySelective(BsTradeTakeConfig record); |
||||
|
||||
@Update({ |
||||
"update bs_trade_take_config", |
||||
"set company_id = #{companyId,jdbcType=BIGINT},", |
||||
"company_name = #{companyName,jdbcType=VARCHAR},", |
||||
"platform_type = #{platformType,jdbcType=INTEGER},", |
||||
"platform_type_name = #{platformTypeName,jdbcType=VARCHAR},", |
||||
"receiver_role = #{receiverRole,jdbcType=INTEGER},", |
||||
"receiver_role_name = #{receiverRoleName,jdbcType=VARCHAR},", |
||||
"receiver_account = #{receiverAccount,jdbcType=VARCHAR},", |
||||
"receiver_name = #{receiverName,jdbcType=VARCHAR},", |
||||
"receiver_ratio = #{receiverRatio,jdbcType=DECIMAL},", |
||||
"receiver_object_id = #{receiverObjectId,jdbcType=BIGINT},", |
||||
"receiver_object_name = #{receiverObjectName,jdbcType=VARCHAR},", |
||||
"sub_receiver_role = #{subReceiverRole,jdbcType=INTEGER},", |
||||
"sub_receiver_role_name = #{subReceiverRoleName,jdbcType=VARCHAR},", |
||||
"sub_receiver_account = #{subReceiverAccount,jdbcType=VARCHAR},", |
||||
"sub_receiver_name = #{subReceiverName,jdbcType=VARCHAR},", |
||||
"sub_receiver_ratio = #{subReceiverRatio,jdbcType=DECIMAL},", |
||||
"sub_receiver_object_id = #{subReceiverObjectId,jdbcType=BIGINT},", |
||||
"sub_receiver_object_name = #{subReceiverObjectName,jdbcType=VARCHAR},", |
||||
"`status` = #{status,jdbcType=INTEGER},", |
||||
"op_user_id = #{opUserId,jdbcType=BIGINT},", |
||||
"op_user_name = #{opUserName,jdbcType=VARCHAR},", |
||||
"create_time = #{createTime,jdbcType=TIMESTAMP},", |
||||
"update_time = #{updateTime,jdbcType=TIMESTAMP},", |
||||
"ext_1 = #{ext1,jdbcType=VARCHAR},", |
||||
"ext_2 = #{ext2,jdbcType=VARCHAR},", |
||||
"ext_3 = #{ext3,jdbcType=VARCHAR}", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
int updateByPrimaryKey(BsTradeTakeConfig record); |
||||
} |
@ -0,0 +1,7 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
/** |
||||
* mapper扩展类 |
||||
*/ |
||||
public interface BsTradeTakeConfigMapperExt { |
||||
} |
@ -0,0 +1,542 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
import com.hfkj.entity.BsTradeTakeConfig; |
||||
import com.hfkj.entity.BsTradeTakeConfigExample.Criteria; |
||||
import com.hfkj.entity.BsTradeTakeConfigExample.Criterion; |
||||
import com.hfkj.entity.BsTradeTakeConfigExample; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import org.apache.ibatis.jdbc.SQL; |
||||
|
||||
public class BsTradeTakeConfigSqlProvider { |
||||
|
||||
public String countByExample(BsTradeTakeConfigExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.SELECT("count(*)").FROM("bs_trade_take_config"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String deleteByExample(BsTradeTakeConfigExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.DELETE_FROM("bs_trade_take_config"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String insertSelective(BsTradeTakeConfig record) { |
||||
SQL sql = new SQL(); |
||||
sql.INSERT_INTO("bs_trade_take_config"); |
||||
|
||||
if (record.getCompanyId() != null) { |
||||
sql.VALUES("company_id", "#{companyId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getCompanyName() != null) { |
||||
sql.VALUES("company_name", "#{companyName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getPlatformType() != null) { |
||||
sql.VALUES("platform_type", "#{platformType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getPlatformTypeName() != null) { |
||||
sql.VALUES("platform_type_name", "#{platformTypeName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getReceiverRole() != null) { |
||||
sql.VALUES("receiver_role", "#{receiverRole,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getReceiverRoleName() != null) { |
||||
sql.VALUES("receiver_role_name", "#{receiverRoleName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getReceiverAccount() != null) { |
||||
sql.VALUES("receiver_account", "#{receiverAccount,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getReceiverName() != null) { |
||||
sql.VALUES("receiver_name", "#{receiverName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getReceiverRatio() != null) { |
||||
sql.VALUES("receiver_ratio", "#{receiverRatio,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getReceiverObjectId() != null) { |
||||
sql.VALUES("receiver_object_id", "#{receiverObjectId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getReceiverObjectName() != null) { |
||||
sql.VALUES("receiver_object_name", "#{receiverObjectName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getSubReceiverRole() != null) { |
||||
sql.VALUES("sub_receiver_role", "#{subReceiverRole,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getSubReceiverRoleName() != null) { |
||||
sql.VALUES("sub_receiver_role_name", "#{subReceiverRoleName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getSubReceiverAccount() != null) { |
||||
sql.VALUES("sub_receiver_account", "#{subReceiverAccount,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getSubReceiverName() != null) { |
||||
sql.VALUES("sub_receiver_name", "#{subReceiverName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getSubReceiverRatio() != null) { |
||||
sql.VALUES("sub_receiver_ratio", "#{subReceiverRatio,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getSubReceiverObjectId() != null) { |
||||
sql.VALUES("sub_receiver_object_id", "#{subReceiverObjectId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getSubReceiverObjectName() != null) { |
||||
sql.VALUES("sub_receiver_object_name", "#{subReceiverObjectName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.VALUES("`status`", "#{status,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.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(BsTradeTakeConfigExample example) { |
||||
SQL sql = new SQL(); |
||||
if (example != null && example.isDistinct()) { |
||||
sql.SELECT_DISTINCT("id"); |
||||
} else { |
||||
sql.SELECT("id"); |
||||
} |
||||
sql.SELECT("company_id"); |
||||
sql.SELECT("company_name"); |
||||
sql.SELECT("platform_type"); |
||||
sql.SELECT("platform_type_name"); |
||||
sql.SELECT("receiver_role"); |
||||
sql.SELECT("receiver_role_name"); |
||||
sql.SELECT("receiver_account"); |
||||
sql.SELECT("receiver_name"); |
||||
sql.SELECT("receiver_ratio"); |
||||
sql.SELECT("receiver_object_id"); |
||||
sql.SELECT("receiver_object_name"); |
||||
sql.SELECT("sub_receiver_role"); |
||||
sql.SELECT("sub_receiver_role_name"); |
||||
sql.SELECT("sub_receiver_account"); |
||||
sql.SELECT("sub_receiver_name"); |
||||
sql.SELECT("sub_receiver_ratio"); |
||||
sql.SELECT("sub_receiver_object_id"); |
||||
sql.SELECT("sub_receiver_object_name"); |
||||
sql.SELECT("`status`"); |
||||
sql.SELECT("op_user_id"); |
||||
sql.SELECT("op_user_name"); |
||||
sql.SELECT("create_time"); |
||||
sql.SELECT("update_time"); |
||||
sql.SELECT("ext_1"); |
||||
sql.SELECT("ext_2"); |
||||
sql.SELECT("ext_3"); |
||||
sql.FROM("bs_trade_take_config"); |
||||
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) { |
||||
BsTradeTakeConfig record = (BsTradeTakeConfig) parameter.get("record"); |
||||
BsTradeTakeConfigExample example = (BsTradeTakeConfigExample) parameter.get("example"); |
||||
|
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("bs_trade_take_config"); |
||||
|
||||
if (record.getId() != null) { |
||||
sql.SET("id = #{record.id,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getCompanyId() != null) { |
||||
sql.SET("company_id = #{record.companyId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getCompanyName() != null) { |
||||
sql.SET("company_name = #{record.companyName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getPlatformType() != null) { |
||||
sql.SET("platform_type = #{record.platformType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getPlatformTypeName() != null) { |
||||
sql.SET("platform_type_name = #{record.platformTypeName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getReceiverRole() != null) { |
||||
sql.SET("receiver_role = #{record.receiverRole,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getReceiverRoleName() != null) { |
||||
sql.SET("receiver_role_name = #{record.receiverRoleName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getReceiverAccount() != null) { |
||||
sql.SET("receiver_account = #{record.receiverAccount,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getReceiverName() != null) { |
||||
sql.SET("receiver_name = #{record.receiverName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getReceiverRatio() != null) { |
||||
sql.SET("receiver_ratio = #{record.receiverRatio,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getReceiverObjectId() != null) { |
||||
sql.SET("receiver_object_id = #{record.receiverObjectId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getReceiverObjectName() != null) { |
||||
sql.SET("receiver_object_name = #{record.receiverObjectName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getSubReceiverRole() != null) { |
||||
sql.SET("sub_receiver_role = #{record.subReceiverRole,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getSubReceiverRoleName() != null) { |
||||
sql.SET("sub_receiver_role_name = #{record.subReceiverRoleName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getSubReceiverAccount() != null) { |
||||
sql.SET("sub_receiver_account = #{record.subReceiverAccount,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getSubReceiverName() != null) { |
||||
sql.SET("sub_receiver_name = #{record.subReceiverName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getSubReceiverRatio() != null) { |
||||
sql.SET("sub_receiver_ratio = #{record.subReceiverRatio,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getSubReceiverObjectId() != null) { |
||||
sql.SET("sub_receiver_object_id = #{record.subReceiverObjectId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getSubReceiverObjectName() != null) { |
||||
sql.SET("sub_receiver_object_name = #{record.subReceiverObjectName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.SET("`status` = #{record.status,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.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_trade_take_config"); |
||||
|
||||
sql.SET("id = #{record.id,jdbcType=BIGINT}"); |
||||
sql.SET("company_id = #{record.companyId,jdbcType=BIGINT}"); |
||||
sql.SET("company_name = #{record.companyName,jdbcType=VARCHAR}"); |
||||
sql.SET("platform_type = #{record.platformType,jdbcType=INTEGER}"); |
||||
sql.SET("platform_type_name = #{record.platformTypeName,jdbcType=VARCHAR}"); |
||||
sql.SET("receiver_role = #{record.receiverRole,jdbcType=INTEGER}"); |
||||
sql.SET("receiver_role_name = #{record.receiverRoleName,jdbcType=VARCHAR}"); |
||||
sql.SET("receiver_account = #{record.receiverAccount,jdbcType=VARCHAR}"); |
||||
sql.SET("receiver_name = #{record.receiverName,jdbcType=VARCHAR}"); |
||||
sql.SET("receiver_ratio = #{record.receiverRatio,jdbcType=DECIMAL}"); |
||||
sql.SET("receiver_object_id = #{record.receiverObjectId,jdbcType=BIGINT}"); |
||||
sql.SET("receiver_object_name = #{record.receiverObjectName,jdbcType=VARCHAR}"); |
||||
sql.SET("sub_receiver_role = #{record.subReceiverRole,jdbcType=INTEGER}"); |
||||
sql.SET("sub_receiver_role_name = #{record.subReceiverRoleName,jdbcType=VARCHAR}"); |
||||
sql.SET("sub_receiver_account = #{record.subReceiverAccount,jdbcType=VARCHAR}"); |
||||
sql.SET("sub_receiver_name = #{record.subReceiverName,jdbcType=VARCHAR}"); |
||||
sql.SET("sub_receiver_ratio = #{record.subReceiverRatio,jdbcType=DECIMAL}"); |
||||
sql.SET("sub_receiver_object_id = #{record.subReceiverObjectId,jdbcType=BIGINT}"); |
||||
sql.SET("sub_receiver_object_name = #{record.subReceiverObjectName,jdbcType=VARCHAR}"); |
||||
sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); |
||||
sql.SET("op_user_id = #{record.opUserId,jdbcType=BIGINT}"); |
||||
sql.SET("op_user_name = #{record.opUserName,jdbcType=VARCHAR}"); |
||||
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); |
||||
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); |
||||
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); |
||||
|
||||
BsTradeTakeConfigExample example = (BsTradeTakeConfigExample) parameter.get("example"); |
||||
applyWhere(sql, example, true); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByPrimaryKeySelective(BsTradeTakeConfig record) { |
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("bs_trade_take_config"); |
||||
|
||||
if (record.getCompanyId() != null) { |
||||
sql.SET("company_id = #{companyId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getCompanyName() != null) { |
||||
sql.SET("company_name = #{companyName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getPlatformType() != null) { |
||||
sql.SET("platform_type = #{platformType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getPlatformTypeName() != null) { |
||||
sql.SET("platform_type_name = #{platformTypeName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getReceiverRole() != null) { |
||||
sql.SET("receiver_role = #{receiverRole,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getReceiverRoleName() != null) { |
||||
sql.SET("receiver_role_name = #{receiverRoleName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getReceiverAccount() != null) { |
||||
sql.SET("receiver_account = #{receiverAccount,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getReceiverName() != null) { |
||||
sql.SET("receiver_name = #{receiverName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getReceiverRatio() != null) { |
||||
sql.SET("receiver_ratio = #{receiverRatio,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getReceiverObjectId() != null) { |
||||
sql.SET("receiver_object_id = #{receiverObjectId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getReceiverObjectName() != null) { |
||||
sql.SET("receiver_object_name = #{receiverObjectName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getSubReceiverRole() != null) { |
||||
sql.SET("sub_receiver_role = #{subReceiverRole,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getSubReceiverRoleName() != null) { |
||||
sql.SET("sub_receiver_role_name = #{subReceiverRoleName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getSubReceiverAccount() != null) { |
||||
sql.SET("sub_receiver_account = #{subReceiverAccount,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getSubReceiverName() != null) { |
||||
sql.SET("sub_receiver_name = #{subReceiverName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getSubReceiverRatio() != null) { |
||||
sql.SET("sub_receiver_ratio = #{subReceiverRatio,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getSubReceiverObjectId() != null) { |
||||
sql.SET("sub_receiver_object_id = #{subReceiverObjectId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getSubReceiverObjectName() != null) { |
||||
sql.SET("sub_receiver_object_name = #{subReceiverObjectName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.SET("`status` = #{status,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.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, BsTradeTakeConfigExample 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,473 @@ |
||||
package com.hfkj.entity; |
||||
|
||||
import java.io.Serializable; |
||||
import java.math.BigDecimal; |
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* bs_trade_take_config |
||||
* @author |
||||
*/ |
||||
/** |
||||
* |
||||
* 代码由工具生成 |
||||
* |
||||
**/ |
||||
public class BsTradeTakeConfig implements Serializable { |
||||
/** |
||||
* 主键 |
||||
*/ |
||||
private Long id; |
||||
|
||||
/** |
||||
* 公司id |
||||
*/ |
||||
private Long companyId; |
||||
|
||||
/** |
||||
* 公司名称 |
||||
*/ |
||||
private String companyName; |
||||
|
||||
/** |
||||
* 平台类型 |
||||
*/ |
||||
private Integer platformType; |
||||
|
||||
/** |
||||
* 平台类型名称 |
||||
*/ |
||||
private String platformTypeName; |
||||
|
||||
/** |
||||
* 【父】接收方角色 |
||||
*/ |
||||
private Integer receiverRole; |
||||
|
||||
/** |
||||
* 【父】接收方角色名称 |
||||
*/ |
||||
private String receiverRoleName; |
||||
|
||||
/** |
||||
* 【父】分账接收方账户 |
||||
*/ |
||||
private String receiverAccount; |
||||
|
||||
/** |
||||
* 【父】分账接收方姓名 |
||||
*/ |
||||
private String receiverName; |
||||
|
||||
/** |
||||
* 【父】抽成比例 单位:% |
||||
*/ |
||||
private BigDecimal receiverRatio; |
||||
|
||||
/** |
||||
* 【父】接收方角色id |
||||
*/ |
||||
private Long receiverObjectId; |
||||
|
||||
/** |
||||
* 【父】接收方角色名称 |
||||
*/ |
||||
private String receiverObjectName; |
||||
|
||||
/** |
||||
* 【子】接收方角色 |
||||
*/ |
||||
private Integer subReceiverRole; |
||||
|
||||
/** |
||||
* 【子】子接收方角色名称 |
||||
*/ |
||||
private String subReceiverRoleName; |
||||
|
||||
/** |
||||
* 【子】子分账接收方账户 |
||||
*/ |
||||
private String subReceiverAccount; |
||||
|
||||
/** |
||||
* 【子】分账接收方姓名 |
||||
*/ |
||||
private String subReceiverName; |
||||
|
||||
/** |
||||
* 【子】抽成比例 单位:% |
||||
*/ |
||||
private BigDecimal subReceiverRatio; |
||||
|
||||
/** |
||||
* 【子】接收方角色id |
||||
*/ |
||||
private Long subReceiverObjectId; |
||||
|
||||
/** |
||||
* 【子】接收方角色名称 |
||||
*/ |
||||
private String subReceiverObjectName; |
||||
|
||||
/** |
||||
* 状态 0:不可用 1:可用 |
||||
*/ |
||||
private Integer status; |
||||
|
||||
/** |
||||
* 操作人 |
||||
*/ |
||||
private Long opUserId; |
||||
|
||||
/** |
||||
* 操作名称 |
||||
*/ |
||||
private String opUserName; |
||||
|
||||
/** |
||||
* 创建时间 |
||||
*/ |
||||
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 getCompanyId() { |
||||
return companyId; |
||||
} |
||||
|
||||
public void setCompanyId(Long companyId) { |
||||
this.companyId = companyId; |
||||
} |
||||
|
||||
public String getCompanyName() { |
||||
return companyName; |
||||
} |
||||
|
||||
public void setCompanyName(String companyName) { |
||||
this.companyName = companyName; |
||||
} |
||||
|
||||
public Integer getPlatformType() { |
||||
return platformType; |
||||
} |
||||
|
||||
public void setPlatformType(Integer platformType) { |
||||
this.platformType = platformType; |
||||
} |
||||
|
||||
public String getPlatformTypeName() { |
||||
return platformTypeName; |
||||
} |
||||
|
||||
public void setPlatformTypeName(String platformTypeName) { |
||||
this.platformTypeName = platformTypeName; |
||||
} |
||||
|
||||
public Integer getReceiverRole() { |
||||
return receiverRole; |
||||
} |
||||
|
||||
public void setReceiverRole(Integer receiverRole) { |
||||
this.receiverRole = receiverRole; |
||||
} |
||||
|
||||
public String getReceiverRoleName() { |
||||
return receiverRoleName; |
||||
} |
||||
|
||||
public void setReceiverRoleName(String receiverRoleName) { |
||||
this.receiverRoleName = receiverRoleName; |
||||
} |
||||
|
||||
public String getReceiverAccount() { |
||||
return receiverAccount; |
||||
} |
||||
|
||||
public void setReceiverAccount(String receiverAccount) { |
||||
this.receiverAccount = receiverAccount; |
||||
} |
||||
|
||||
public String getReceiverName() { |
||||
return receiverName; |
||||
} |
||||
|
||||
public void setReceiverName(String receiverName) { |
||||
this.receiverName = receiverName; |
||||
} |
||||
|
||||
public BigDecimal getReceiverRatio() { |
||||
return receiverRatio; |
||||
} |
||||
|
||||
public void setReceiverRatio(BigDecimal receiverRatio) { |
||||
this.receiverRatio = receiverRatio; |
||||
} |
||||
|
||||
public Long getReceiverObjectId() { |
||||
return receiverObjectId; |
||||
} |
||||
|
||||
public void setReceiverObjectId(Long receiverObjectId) { |
||||
this.receiverObjectId = receiverObjectId; |
||||
} |
||||
|
||||
public String getReceiverObjectName() { |
||||
return receiverObjectName; |
||||
} |
||||
|
||||
public void setReceiverObjectName(String receiverObjectName) { |
||||
this.receiverObjectName = receiverObjectName; |
||||
} |
||||
|
||||
public Integer getSubReceiverRole() { |
||||
return subReceiverRole; |
||||
} |
||||
|
||||
public void setSubReceiverRole(Integer subReceiverRole) { |
||||
this.subReceiverRole = subReceiverRole; |
||||
} |
||||
|
||||
public String getSubReceiverRoleName() { |
||||
return subReceiverRoleName; |
||||
} |
||||
|
||||
public void setSubReceiverRoleName(String subReceiverRoleName) { |
||||
this.subReceiverRoleName = subReceiverRoleName; |
||||
} |
||||
|
||||
public String getSubReceiverAccount() { |
||||
return subReceiverAccount; |
||||
} |
||||
|
||||
public void setSubReceiverAccount(String subReceiverAccount) { |
||||
this.subReceiverAccount = subReceiverAccount; |
||||
} |
||||
|
||||
public String getSubReceiverName() { |
||||
return subReceiverName; |
||||
} |
||||
|
||||
public void setSubReceiverName(String subReceiverName) { |
||||
this.subReceiverName = subReceiverName; |
||||
} |
||||
|
||||
public BigDecimal getSubReceiverRatio() { |
||||
return subReceiverRatio; |
||||
} |
||||
|
||||
public void setSubReceiverRatio(BigDecimal subReceiverRatio) { |
||||
this.subReceiverRatio = subReceiverRatio; |
||||
} |
||||
|
||||
public Long getSubReceiverObjectId() { |
||||
return subReceiverObjectId; |
||||
} |
||||
|
||||
public void setSubReceiverObjectId(Long subReceiverObjectId) { |
||||
this.subReceiverObjectId = subReceiverObjectId; |
||||
} |
||||
|
||||
public String getSubReceiverObjectName() { |
||||
return subReceiverObjectName; |
||||
} |
||||
|
||||
public void setSubReceiverObjectName(String subReceiverObjectName) { |
||||
this.subReceiverObjectName = subReceiverObjectName; |
||||
} |
||||
|
||||
public Integer getStatus() { |
||||
return status; |
||||
} |
||||
|
||||
public void setStatus(Integer status) { |
||||
this.status = status; |
||||
} |
||||
|
||||
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 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; |
||||
} |
||||
BsTradeTakeConfig other = (BsTradeTakeConfig) that; |
||||
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) |
||||
&& (this.getCompanyId() == null ? other.getCompanyId() == null : this.getCompanyId().equals(other.getCompanyId())) |
||||
&& (this.getCompanyName() == null ? other.getCompanyName() == null : this.getCompanyName().equals(other.getCompanyName())) |
||||
&& (this.getPlatformType() == null ? other.getPlatformType() == null : this.getPlatformType().equals(other.getPlatformType())) |
||||
&& (this.getPlatformTypeName() == null ? other.getPlatformTypeName() == null : this.getPlatformTypeName().equals(other.getPlatformTypeName())) |
||||
&& (this.getReceiverRole() == null ? other.getReceiverRole() == null : this.getReceiverRole().equals(other.getReceiverRole())) |
||||
&& (this.getReceiverRoleName() == null ? other.getReceiverRoleName() == null : this.getReceiverRoleName().equals(other.getReceiverRoleName())) |
||||
&& (this.getReceiverAccount() == null ? other.getReceiverAccount() == null : this.getReceiverAccount().equals(other.getReceiverAccount())) |
||||
&& (this.getReceiverName() == null ? other.getReceiverName() == null : this.getReceiverName().equals(other.getReceiverName())) |
||||
&& (this.getReceiverRatio() == null ? other.getReceiverRatio() == null : this.getReceiverRatio().equals(other.getReceiverRatio())) |
||||
&& (this.getReceiverObjectId() == null ? other.getReceiverObjectId() == null : this.getReceiverObjectId().equals(other.getReceiverObjectId())) |
||||
&& (this.getReceiverObjectName() == null ? other.getReceiverObjectName() == null : this.getReceiverObjectName().equals(other.getReceiverObjectName())) |
||||
&& (this.getSubReceiverRole() == null ? other.getSubReceiverRole() == null : this.getSubReceiverRole().equals(other.getSubReceiverRole())) |
||||
&& (this.getSubReceiverRoleName() == null ? other.getSubReceiverRoleName() == null : this.getSubReceiverRoleName().equals(other.getSubReceiverRoleName())) |
||||
&& (this.getSubReceiverAccount() == null ? other.getSubReceiverAccount() == null : this.getSubReceiverAccount().equals(other.getSubReceiverAccount())) |
||||
&& (this.getSubReceiverName() == null ? other.getSubReceiverName() == null : this.getSubReceiverName().equals(other.getSubReceiverName())) |
||||
&& (this.getSubReceiverRatio() == null ? other.getSubReceiverRatio() == null : this.getSubReceiverRatio().equals(other.getSubReceiverRatio())) |
||||
&& (this.getSubReceiverObjectId() == null ? other.getSubReceiverObjectId() == null : this.getSubReceiverObjectId().equals(other.getSubReceiverObjectId())) |
||||
&& (this.getSubReceiverObjectName() == null ? other.getSubReceiverObjectName() == null : this.getSubReceiverObjectName().equals(other.getSubReceiverObjectName())) |
||||
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) |
||||
&& (this.getOpUserId() == null ? other.getOpUserId() == null : this.getOpUserId().equals(other.getOpUserId())) |
||||
&& (this.getOpUserName() == null ? other.getOpUserName() == null : this.getOpUserName().equals(other.getOpUserName())) |
||||
&& (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 + ((getCompanyId() == null) ? 0 : getCompanyId().hashCode()); |
||||
result = prime * result + ((getCompanyName() == null) ? 0 : getCompanyName().hashCode()); |
||||
result = prime * result + ((getPlatformType() == null) ? 0 : getPlatformType().hashCode()); |
||||
result = prime * result + ((getPlatformTypeName() == null) ? 0 : getPlatformTypeName().hashCode()); |
||||
result = prime * result + ((getReceiverRole() == null) ? 0 : getReceiverRole().hashCode()); |
||||
result = prime * result + ((getReceiverRoleName() == null) ? 0 : getReceiverRoleName().hashCode()); |
||||
result = prime * result + ((getReceiverAccount() == null) ? 0 : getReceiverAccount().hashCode()); |
||||
result = prime * result + ((getReceiverName() == null) ? 0 : getReceiverName().hashCode()); |
||||
result = prime * result + ((getReceiverRatio() == null) ? 0 : getReceiverRatio().hashCode()); |
||||
result = prime * result + ((getReceiverObjectId() == null) ? 0 : getReceiverObjectId().hashCode()); |
||||
result = prime * result + ((getReceiverObjectName() == null) ? 0 : getReceiverObjectName().hashCode()); |
||||
result = prime * result + ((getSubReceiverRole() == null) ? 0 : getSubReceiverRole().hashCode()); |
||||
result = prime * result + ((getSubReceiverRoleName() == null) ? 0 : getSubReceiverRoleName().hashCode()); |
||||
result = prime * result + ((getSubReceiverAccount() == null) ? 0 : getSubReceiverAccount().hashCode()); |
||||
result = prime * result + ((getSubReceiverName() == null) ? 0 : getSubReceiverName().hashCode()); |
||||
result = prime * result + ((getSubReceiverRatio() == null) ? 0 : getSubReceiverRatio().hashCode()); |
||||
result = prime * result + ((getSubReceiverObjectId() == null) ? 0 : getSubReceiverObjectId().hashCode()); |
||||
result = prime * result + ((getSubReceiverObjectName() == null) ? 0 : getSubReceiverObjectName().hashCode()); |
||||
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); |
||||
result = prime * result + ((getOpUserId() == null) ? 0 : getOpUserId().hashCode()); |
||||
result = prime * result + ((getOpUserName() == null) ? 0 : getOpUserName().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(", companyId=").append(companyId); |
||||
sb.append(", companyName=").append(companyName); |
||||
sb.append(", platformType=").append(platformType); |
||||
sb.append(", platformTypeName=").append(platformTypeName); |
||||
sb.append(", receiverRole=").append(receiverRole); |
||||
sb.append(", receiverRoleName=").append(receiverRoleName); |
||||
sb.append(", receiverAccount=").append(receiverAccount); |
||||
sb.append(", receiverName=").append(receiverName); |
||||
sb.append(", receiverRatio=").append(receiverRatio); |
||||
sb.append(", receiverObjectId=").append(receiverObjectId); |
||||
sb.append(", receiverObjectName=").append(receiverObjectName); |
||||
sb.append(", subReceiverRole=").append(subReceiverRole); |
||||
sb.append(", subReceiverRoleName=").append(subReceiverRoleName); |
||||
sb.append(", subReceiverAccount=").append(subReceiverAccount); |
||||
sb.append(", subReceiverName=").append(subReceiverName); |
||||
sb.append(", subReceiverRatio=").append(subReceiverRatio); |
||||
sb.append(", subReceiverObjectId=").append(subReceiverObjectId); |
||||
sb.append(", subReceiverObjectName=").append(subReceiverObjectName); |
||||
sb.append(", status=").append(status); |
||||
sb.append(", opUserId=").append(opUserId); |
||||
sb.append(", opUserName=").append(opUserName); |
||||
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(); |
||||
} |
||||
} |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,36 @@ |
||||
package com.hfkj.service; |
||||
|
||||
import com.hfkj.entity.BsTradeTakeConfig; |
||||
import com.hfkj.sysenum.PlatformTypeEnum; |
||||
import com.hfkj.sysenum.ProfitSharingReceiverRoleEnum; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @className: BsTradeTakeConfigService |
||||
* @author: HuRui |
||||
* @date: 2023/2/27 |
||||
**/ |
||||
public interface BsTradeTakeConfigService { |
||||
|
||||
/** |
||||
* 编辑数据 |
||||
* @param tradeTakeConfig |
||||
*/ |
||||
void editData(BsTradeTakeConfig tradeTakeConfig); |
||||
|
||||
/** |
||||
* 批量编辑数据 |
||||
* @param tradeTakeConfigList |
||||
*/ |
||||
void editBatchData(List<BsTradeTakeConfig> tradeTakeConfigList); |
||||
|
||||
/** |
||||
* 查询配置 |
||||
* @param companyId 公司id |
||||
* @param profitSharingReceiverRoleEnum 角色 |
||||
* @return |
||||
*/ |
||||
BsTradeTakeConfig getTradeTakeConfig(Long companyId, PlatformTypeEnum platformType, ProfitSharingReceiverRoleEnum profitSharingReceiverRoleEnum, Long receiverObjectId , Long subReceiverObjectId); |
||||
|
||||
} |
@ -0,0 +1,72 @@ |
||||
package com.hfkj.service.impl; |
||||
|
||||
import com.hfkj.dao.BsTradeTakeConfigMapper; |
||||
import com.hfkj.entity.BsTradeTakeConfig; |
||||
import com.hfkj.entity.BsTradeTakeConfigExample; |
||||
import com.hfkj.service.BsTradeTakeConfigService; |
||||
import com.hfkj.sysenum.PlatformTypeEnum; |
||||
import com.hfkj.sysenum.ProfitSharingReceiverRoleEnum; |
||||
import org.springframework.stereotype.Service; |
||||
import org.springframework.transaction.annotation.Propagation; |
||||
import org.springframework.transaction.annotation.Transactional; |
||||
|
||||
import javax.annotation.Resource; |
||||
import java.util.Date; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @className: BsTradeTakeConfigServiceImpl |
||||
* @author: HuRui |
||||
* @date: 2023/2/27 |
||||
**/ |
||||
@Service("tradeTakeConfigService") |
||||
public class BsTradeTakeConfigServiceImpl implements BsTradeTakeConfigService { |
||||
|
||||
@Resource |
||||
private BsTradeTakeConfigMapper tradeTakeConfigMapper; |
||||
@Override |
||||
public void editData(BsTradeTakeConfig tradeTakeConfig) { |
||||
if (tradeTakeConfig.getId() == null) { |
||||
tradeTakeConfig.setStatus(1); |
||||
tradeTakeConfig.setCreateTime(new Date()); |
||||
tradeTakeConfig.setUpdateTime(new Date()); |
||||
tradeTakeConfigMapper.insert(tradeTakeConfig); |
||||
} else { |
||||
tradeTakeConfig.setUpdateTime(new Date()); |
||||
tradeTakeConfigMapper.updateByPrimaryKey(tradeTakeConfig); |
||||
} |
||||
} |
||||
|
||||
@Override |
||||
@Transactional(propagation= Propagation.REQUIRES_NEW) |
||||
public void editBatchData(List<BsTradeTakeConfig> tradeTakeConfigList) { |
||||
for (BsTradeTakeConfig tradeTakeConfig : tradeTakeConfigList) { |
||||
editData(tradeTakeConfig); |
||||
} |
||||
} |
||||
|
||||
@Override |
||||
public BsTradeTakeConfig getTradeTakeConfig(Long companyId, PlatformTypeEnum platformType, ProfitSharingReceiverRoleEnum profitSharingReceiverRoleEnum, Long receiverObjectId, Long subReceiverObjectId) { |
||||
BsTradeTakeConfigExample example = new BsTradeTakeConfigExample(); |
||||
BsTradeTakeConfigExample.Criteria criteria = example.createCriteria() |
||||
.andCompanyIdEqualTo(companyId) |
||||
.andPlatformTypeEqualTo(platformType.getNumber()) |
||||
.andReceiverRoleEqualTo(profitSharingReceiverRoleEnum.getNumber()) |
||||
.andStatusEqualTo(1); |
||||
|
||||
if (receiverObjectId != null) { |
||||
criteria.andReceiverObjectIdEqualTo(receiverObjectId); |
||||
} |
||||
if (subReceiverObjectId != null) { |
||||
criteria.andSubReceiverObjectIdEqualTo(subReceiverObjectId); |
||||
} |
||||
|
||||
List<BsTradeTakeConfig> list = tradeTakeConfigMapper.selectByExample(example); |
||||
if (list.size() > 0) { |
||||
return list.get(0); |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
|
||||
} |
@ -0,0 +1,51 @@ |
||||
package com.hfkj.sysenum; |
||||
|
||||
import java.util.Objects; |
||||
|
||||
/** |
||||
* @className: ProfitSharingReceiverRole |
||||
* @author: HuRui |
||||
* @date: 2023/2/27 |
||||
**/ |
||||
public enum ProfitSharingReceiverRoleEnum { |
||||
|
||||
role1(1, "运营中心"), |
||||
role2(2, "分公司"), |
||||
role3(3, "代理商"), |
||||
; |
||||
|
||||
private Integer number; |
||||
|
||||
private String name; |
||||
|
||||
ProfitSharingReceiverRoleEnum(int number, String name) { |
||||
this.number = number; |
||||
this.name = name; |
||||
} |
||||
|
||||
public static ProfitSharingReceiverRoleEnum getDataByNumber(Integer number) { |
||||
for (ProfitSharingReceiverRoleEnum ele : values()) { |
||||
if (Objects.equals(number,ele.getNumber())) { |
||||
return ele; |
||||
} |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
|
||||
public Integer getNumber() { |
||||
return number; |
||||
} |
||||
|
||||
public void setNumber(Integer number) { |
||||
this.number = number; |
||||
} |
||||
|
||||
public String getName() { |
||||
return name; |
||||
} |
||||
|
||||
public void setName(String name) { |
||||
this.name = name; |
||||
} |
||||
} |
Loading…
Reference in new issue