| | |
| | | // 官方账户余额不足 |
| | | public static final int CODE_TLJ_NO_MONEY = 102; |
| | | |
| | | //每日创建的商品数量超限 |
| | | public static final int CODE_TLJ_NO_GOODS = 103; |
| | | |
| | | |
| | | public LiJinAccountException(int code, String msg) { |
| | | super(code, msg); |
| | |
| | | // 官方账户余额不足 |
| | | public static final int CODE_TLJ_NO_MONEY = 102; |
| | | |
| | | public static final int CODE_SERVER_BUSY = 400001; |
| | | |
| | | |
| | | public LiJinException(int code, String msg) { |
| | | super(code, msg); |
| | | } |
| | |
| | | public final static int CODE_GOODS_OFFLINE = 2001; |
| | | //商品不支持创建淘礼金 |
| | | public final static int CODE_GOODS_NOT_SUPPORT = 1001; |
| | | //商品今日创建淘礼金的次数已满 |
| | | public final static int CODE_GOODS_CREATED_NUM_FULL = 1002; |
| | | |
| | | |
| | | |
| | | public LiJinGoodsException(int code, String msg) { |
| | |
| | | |
| | | @Table("tlj_provider_account") |
| | | public class LiJinProviderTaoKeAccount implements Serializable { |
| | | //正常 |
| | | public final static int ERROR_CODE_NORMAL = 0; |
| | | //资金不足 |
| | | public final static int ERROR_CODE_MONEY_NOT_ENOUGH = 10; |
| | | //商品数量不足 |
| | | public final static int ERROR_CODE_GOODS_NOT_ENOUGH = 20; |
| | | |
| | | //其他错误 |
| | | public final static int ERROR_CODE_OTHER=30; |
| | | |
| | | |
| | | @Column(name = "ac_id") |
| | | private Long id; |
| | | |
| | |
| | | |
| | | @Column(name = "ac_state") |
| | | private Integer state; |
| | | |
| | | //错误码 0-无错误 |
| | | @Column(name = "ac_error_code") |
| | | private Integer errorCode; |
| | | @Column(name = "ac_error_msg") |
| | | private String errorMsg; |
| | | |
| | | @Column(name = "ac_creator_id") |
| | | private Long creatorId; |
| | |
| | | public void setUpdateTime(Date updateTime) { |
| | | this.updateTime = updateTime; |
| | | } |
| | | |
| | | public Integer getErrorCode() { |
| | | return errorCode; |
| | | } |
| | | |
| | | public void setErrorCode(Integer errorCode) { |
| | | this.errorCode = errorCode; |
| | | } |
| | | |
| | | public String getErrorMsg() { |
| | | return errorMsg; |
| | | } |
| | | |
| | | public void setErrorMsg(String errorMsg) { |
| | | this.errorMsg = errorMsg; |
| | | } |
| | | } |
| | |
| | | * @param providerId |
| | | * @return |
| | | */ |
| | | public List<LiJinProviderTaoKeAccount> listByProviderId(Long providerId); |
| | | public List<LiJinProviderTaoKeAccount> listValidByProviderId(Long providerId,Integer errorCode); |
| | | |
| | | public void insertSelective(LiJinProviderTaoKeAccount provider); |
| | | |
| | |
| | | case "ASSET_ACCOUNT_BALANCE_NOT_ENOUGH": |
| | | throw new LiJinAccountException(LiJinAccountException.CODE_TLJ_NO_MONEY, "账户预算不足"); |
| | | case "FAIL_CHECK_ITEM_DAILY_SEND_NUM_CHECK_ERROR": |
| | | throw new LiJinGoodsException(LiJinGoodsException.CODE_GOODS_CREATED_NUM_FULL, "今日该商品淘礼金创建数已超上限,请您明日再试"); |
| | | throw new LiJinAccountException(LiJinAccountException.CODE_TLJ_NO_GOODS, "今日该商品淘礼金创建数已超上限,请您明日再试"); |
| | | default: |
| | | throw new LiJinException(Integer.parseInt(msgCode), root.toString()); |
| | | } |
New file |
| | |
| | | package com.ks.lijin.job; |
| | | |
| | | import com.ks.lijin.pojo.DO.LiJinProviderTaoKeAccount; |
| | | import com.ks.lijin.service.LiJinProviderAccountService; |
| | | import com.ks.lijin.service.manager.LiJinProviderTaoKeAccountManager; |
| | | import com.xxl.job.core.biz.model.ReturnT; |
| | | import com.xxl.job.core.handler.annotation.XxlJob; |
| | | import org.springframework.stereotype.Component; |
| | | import org.yeshi.utils.DateUtil; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Component |
| | | public class LijinAccountJob { |
| | | |
| | | |
| | | @Resource |
| | | private LiJinProviderAccountService liJinProviderAccountService; |
| | | |
| | | @Resource |
| | | private LiJinProviderTaoKeAccountManager liJinProviderTaoKeAccountManager; |
| | | |
| | | /** |
| | | * 初始化淘客账号(每天凌晨过2分执行) |
| | | * |
| | | * @param param |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @XxlJob("account-initTodayTaoKeAccount") |
| | | public ReturnT<String> initTodayTaoKeAccount(String param) throws Exception { |
| | | List<LiJinProviderTaoKeAccount> list = liJinProviderAccountService.listValidByProviderId(null, null); |
| | | for (LiJinProviderTaoKeAccount account : list) { |
| | | liJinProviderTaoKeAccountManager.initTodayData(account.getId()); |
| | | } |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 删除redis中过期的淘客账号信息 |
| | | * |
| | | * @param param |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @XxlJob("account-deleteOutDateAccountInRedis") |
| | | public ReturnT<String> deleteOutDateAccountInRedis(String param) throws Exception { |
| | | //删除1-5天前的 |
| | | Date now = new Date(); |
| | | for (int i = 1; i < 5; i++) { |
| | | Date date = DateUtil.plusDayDate(0 - i, now); |
| | | liJinProviderTaoKeAccountManager.deleteInfoInRedis(date); |
| | | } |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | } |
| | |
| | | package com.ks.lijin.query; |
| | | |
| | | |
| | | |
| | | public class ProviderAccountQuery extends BaseDaoQuery { |
| | | |
| | | //状态 |
| | |
| | | // 名称 |
| | | public String name; |
| | | |
| | | //错误码 |
| | | public Integer errorCode; |
| | | |
| | | public Long providerId; |
| | | public String appKey; |
| | | public String appSecret; |
| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void createLijinSuccess(Long accountId, Long auctionId, BigDecimal money, Date createTime) { |
| | | String day = TimeUtil.getGernalTime(createTime.getTime(), "yyyyMMdd"); |
| | | String goodsKeyPrefix = String.format("lijingoodsnum-%s-%s-", day, accountId); |
| | | String goodsKey = goodsKeyPrefix + auctionId; |
| | | String goodsKey = String.format("lijingoodsnum-%s-%s", day, accountId); |
| | | String accountMoneyKey = String.format("lijinaccountmoney-%s-%s", day, accountId); |
| | | //保存账号当日的商品数量消耗 |
| | | redisTemplate.opsForValue().increment(goodsKey, 1); |
| | | redisTemplate.opsForSet().add(goodsKey, auctionId); |
| | | //保存当日账号的资金消耗 |
| | | redisTemplate.opsForValue().increment(accountMoneyKey, money.multiply(new BigDecimal(100)).intValue()); |
| | | |
| | | //获取账号当日的商品数量 |
| | | int goodsNum = redisTemplate.keys(goodsKeyPrefix + "*").size(); |
| | | long goodsNum = redisTemplate.opsForSet().size(goodsKey); |
| | | //获取账号当日的资金消耗 |
| | | Long todayMoney = Long.parseLong(redisTemplate.opsForValue().get(accountMoneyKey) + ""); |
| | | |
| | | //同步到数据库 |
| | | |
| | | LiJinProviderTaoKeAccount account = liJinProviderAccountMapper.selectByPrimaryKeyForUpdate(accountId); |
| | | if (account != null) { |
| | | LiJinProviderTaoKeAccount update = new LiJinProviderTaoKeAccount(); |
| | | update.setTodayConsumeMoney(new BigDecimal(todayMoney).divide(new BigDecimal(100), 2, RoundingMode.FLOOR)); |
| | | update.setTodayConsumeNumber(goodsNum); |
| | | update.setTodayConsumeNumber((int) goodsNum); |
| | | update.setUpdateTime(new Date()); |
| | | update.setErrorCode(LiJinProviderTaoKeAccount.ERROR_CODE_NORMAL); |
| | | liJinProviderAccountMapper.updateByPrimaryKeySelective(update); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 初始化当天的数据 |
| | | * |
| | | * @param accountId |
| | | */ |
| | | public void initTodayData(Long accountId) { |
| | | createLijinSuccess(accountId, 1L, new BigDecimal(0), new Date()); |
| | | } |
| | | |
| | | |
| | | //删除redis中的信息 |
| | | public void deleteInfoInRedis(Date date) { |
| | | String day = TimeUtil.getGernalTime(date.getTime(), "yyyyMMdd"); |
| | | String goodsKey = String.format("lijingoodsnum-%s-*", day); |
| | | String accountMoneyKey = String.format("lijinaccountmoney-%s-%s", day); |
| | | redisTemplate.delete(goodsKey); |
| | | redisTemplate.delete(accountMoneyKey); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | query.id = obj.getId(); |
| | | query.state = obj.getState(); |
| | | query.providerId = obj.getProviderId(); |
| | | query.appKey = obj.getAppKey(); |
| | | query.appSecret = obj.getAppSecret(); |
| | | query.appKey = obj.getAppKey(); |
| | | query.appSecret = obj.getAppSecret(); |
| | | return liJinProviderAccountMapper.count(query); |
| | | } |
| | | |
| | |
| | | query.id = obj.getId(); |
| | | query.state = obj.getState(); |
| | | query.providerId = obj.getProviderId(); |
| | | query.appKey = obj.getAppKey(); |
| | | query.appSecret = obj.getAppSecret(); |
| | | query.appKey = obj.getAppKey(); |
| | | query.appSecret = obj.getAppSecret(); |
| | | query.start = (page - 1) * pageSize; |
| | | query.count = pageSize; |
| | | return liJinProviderAccountMapper.listByPage(query); |
| | |
| | | |
| | | |
| | | @Override |
| | | public List<LiJinProviderTaoKeAccount> listByProviderId(Long providerId) { |
| | | public List<LiJinProviderTaoKeAccount> listValidByProviderId(Long providerId, Integer errorCode) { |
| | | ProviderAccountQuery query = new ProviderAccountQuery(); |
| | | query.state =1; |
| | | query.state = 1; |
| | | query.providerId = providerId; |
| | | query.start = 0; |
| | | query.count = 1000; |
| | | query.errorCode = errorCode; |
| | | return liJinProviderAccountMapper.listByPage(query); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void insertSelective(LiJinProviderTaoKeAccount t){ |
| | | public void insertSelective(LiJinProviderTaoKeAccount t) { |
| | | liJinProviderAccountMapper.insertSelective(t); |
| | | } |
| | | |
| | | @Override |
| | | public void updateByPrimaryKeySelective(LiJinProviderTaoKeAccount t){ |
| | | public void updateByPrimaryKeySelective(LiJinProviderTaoKeAccount t) { |
| | | liJinProviderAccountMapper.updateByPrimaryKeySelective(t); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | public LiJinProviderTaoKeAccount getByAppInfo(String appKey, String appSecret){ |
| | | public LiJinProviderTaoKeAccount getByAppInfo(String appKey, String appSecret) { |
| | | LiJinProviderTaoKeAccount obj = new LiJinProviderTaoKeAccount(); |
| | | obj.setAppKey(appKey); |
| | | obj.setAppSecret(appSecret); |
| | | obj.setState(1); |
| | | List<LiJinProviderTaoKeAccount> list = listByPage(0, 100, obj); |
| | | if (list ==null && list.size() == 0) { |
| | | if (list == null && list.size() == 0) { |
| | | return null; |
| | | } |
| | | return list.get(0); |
| | |
| | | import org.apache.dubbo.config.annotation.Reference; |
| | | import org.apache.dubbo.config.annotation.Service; |
| | | import org.springframework.core.task.TaskExecutor; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.yeshi.utils.MoneyBigDecimalUtil; |
| | | import org.yeshi.utils.StringUtil; |
| | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | |
| | | @Service(version = "1.0") |
| | |
| | | @Resource |
| | | private LiJinExpendRecordService liJinExpendRecordService; |
| | | |
| | | |
| | | @Resource |
| | | private LiJinProviderTaoKeAccountManager liJinProviderTaoKeAccountManager; |
| | | |
| | | @Resource |
| | | private RedisTemplate redisTemplate; |
| | | |
| | | @Override |
| | | public List<MoneyInfo> getMoneyInfo(String uid, List<TaoBaoGoodsBrief> goodsBriefList) { |
| | |
| | | // 执行创建淘礼金 |
| | | LiJinCreateParam params = getLiJinCreateBaseParam(); |
| | | |
| | | |
| | | TaoLijinCreateResultDTO taoLiJinDTO = executeTaoLiJin(goodsId, lijinAmount, params); |
| | | if (taoLiJinDTO == null) { |
| | | throw new LiJinException(1, "淘宝API推广红包创建失败"); |
| | | //用户创建淘礼金为单线程操作 |
| | | String key = "createtblijin-" + uid; |
| | | if (redisTemplate.opsForValue().setIfAbsent(key, "1", 120, TimeUnit.SECONDS)) { |
| | | try { |
| | | TaoLijinCreateResultDTO taoLiJinDTO = executeTaoLiJin(goodsId, lijinAmount, params); |
| | | if (taoLiJinDTO == null) { |
| | | throw new LiJinException(1, "淘宝API推广红包创建失败"); |
| | | } |
| | | //添加账号的 |
| | | return addCreateSuccessRecord(uid, goodsId, lijinAmount, params.getTitle(), params.getNum(), taoLiJinDTO); |
| | | } finally { |
| | | redisTemplate.delete(key); |
| | | } |
| | | } else { |
| | | throw new LiJinException(LiJinException.CODE_SERVER_BUSY, "服务器繁忙,请稍后再试"); |
| | | } |
| | | |
| | | //添加账号的 |
| | | return addCreateSuccessRecord(uid, goodsId, lijinAmount, params.getTitle(), params.getNum(), taoLiJinDTO); |
| | | } |
| | | |
| | | |
| | |
| | | */ |
| | | private TaoLijinCreateResultDTO executeTaoLiJin(Long goodsId, BigDecimal lijinAmount, LiJinCreateParam params) throws LiJinGoodsException, LiJinException { |
| | | // 查询供应商账号信息 |
| | | List<LiJinProviderTaoKeAccount> listAccount = liJinProviderAccountService.listByProviderId(Constant.PROVIDER_DEFAULT_ID); |
| | | List<LiJinProviderTaoKeAccount> listAccount = liJinProviderAccountService.listValidByProviderId(Constant.PROVIDER_DEFAULT_ID, LiJinProviderTaoKeAccount.ERROR_CODE_NORMAL); |
| | | if (listAccount == null || listAccount.size() == 0) { |
| | | throw new LiJinException(1, "没有可用的供应商账号"); |
| | | } |
| | |
| | | //创建礼金 |
| | | return new TaoLijinCreateResultDTO(account, executeTaoLiJinAPI(goodsId, lijinAmount, params)); |
| | | } catch (LiJinAccountException e) {// 账号问题 |
| | | //更新账号的错误信息 |
| | | LiJinProviderTaoKeAccount update = new LiJinProviderTaoKeAccount(); |
| | | update.setId(account.getId()); |
| | | if (e.getCode() == LiJinAccountException.CODE_TLJ_NO_MONEY) { |
| | | //资金不足 |
| | | update.setErrorCode(LiJinProviderTaoKeAccount.ERROR_CODE_MONEY_NOT_ENOUGH); |
| | | } else if (e.getCode() == LiJinAccountException.CODE_TLJ_NO_GOODS) { |
| | | //商品数量不足 |
| | | update.setErrorCode(LiJinProviderTaoKeAccount.ERROR_CODE_GOODS_NOT_ENOUGH); |
| | | } else { |
| | | //账号异常 |
| | | update.setErrorCode(LiJinProviderTaoKeAccount.ERROR_CODE_OTHER); |
| | | } |
| | | update.setErrorMsg(e.getMsg()); |
| | | update.setUpdateTime(new Date()); |
| | | liJinProviderAccountService.updateByPrimaryKeySelective(update); |
| | | |
| | | // 通知相应供应商 TODO |
| | | executor.execute(new Runnable() { |
| | | @Override |
| | |
| | | <result column="ac_create_time" property="createTime" jdbcType="TIMESTAMP"/> |
| | | <result column="ac_updator_id" property="updatorId" jdbcType="BIGINT"/> |
| | | <result column="ac_update_time" property="updateTime" jdbcType="TIMESTAMP"/> |
| | | <result column="ac_error_code" property="errorCode" jdbcType="INTEGER"/> |
| | | <result column="ac_error_msg" property="errorMsg" jdbcType="VARCHAR"/> |
| | | </resultMap> |
| | | <sql id="Base_Column_List">ac_id,ac_provider_id,ac_account_name,ac_app_key,ac_app_secret,ac_pid,ac_max_money,ac_max_number,ac_today_consume_money,ac_today_consume_number,ac_state,ac_creator_id,ac_create_time,ac_updator_id,ac_update_time</sql> |
| | | <sql id="Base_Column_List">ac_id,ac_provider_id,ac_account_name,ac_app_key,ac_app_secret,ac_pid,ac_max_money,ac_max_number,ac_today_consume_money,ac_today_consume_number,ac_state,ac_creator_id,ac_create_time,ac_updator_id,ac_update_time,ac_error_code,ac_error_msg</sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select |
| | | <include refid="Base_Column_List"/>from tlj_provider_account where ac_id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | |
| | | |
| | | <select id="selectByPrimaryKeyForUpdate" resultMap="BaseResultMap" parameterType="java.lang.Long">select |
| | | <include refid="Base_Column_List"/>from tlj_provider_account where ac_id = #{0} for update |
| | | </select> |
| | | |
| | | |
| | | <delete id="deleteByPrimaryKey" |
| | | parameterType="java.lang.Long">delete from tlj_provider_account where ac_id = #{id,jdbcType=BIGINT}</delete> |
| | | <insert id="insert" parameterType="com.ks.lijin.pojo.DO.LiJinProviderTaoKeAccount" useGeneratedKeys="true" |
| | | keyProperty="id">insert into tlj_provider_account (ac_id, ac_provider_id, ac_account_name, ac_app_key, ac_app_secret,ac_pid, ac_max_money, ac_max_number, ac_today_consume_money, ac_today_consume_number, ac_state, ac_creator_id, ac_create_time, ac_updator_id, ac_update_time)values (#{id,jdbcType=BIGINT}, #{providerId,jdbcType=BIGINT}, #{accountName,jdbcType=VARCHAR}, #{appKey,jdbcType=VARCHAR}, #{appSecret,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{maxMoney,jdbcType=DECIMAL}, #{maxNumber,jdbcType=INTEGER}, #{todayConsumeMoney,jdbcType=DECIMAL}, #{todayConsumeNumber,jdbcType=INTEGER}, #{state,jdbcType=INTEGER}, #{creatorId,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP}, #{updatorId,jdbcType=BIGINT}, #{updateTime,jdbcType=TIMESTAMP})</insert> |
| | | keyProperty="id">insert into tlj_provider_account (ac_id, ac_provider_id, ac_account_name, ac_app_key, ac_app_secret,ac_pid, ac_max_money, ac_max_number, ac_today_consume_money, ac_today_consume_number, ac_state, ac_creator_id, ac_create_time, ac_updator_id, ac_update_time,ac_error_code,ac_error_msg) values (#{id,jdbcType=BIGINT}, #{providerId,jdbcType=BIGINT}, #{accountName,jdbcType=VARCHAR}, #{appKey,jdbcType=VARCHAR}, #{appSecret,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{maxMoney,jdbcType=DECIMAL}, #{maxNumber,jdbcType=INTEGER}, #{todayConsumeMoney,jdbcType=DECIMAL}, #{todayConsumeNumber,jdbcType=INTEGER}, #{state,jdbcType=INTEGER}, #{creatorId,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP}, #{updatorId,jdbcType=BIGINT}, #{updateTime,jdbcType=TIMESTAMP},#{errorCode,jdbcType=INTEGER},#{errorMsg,jdbcType=VARCHAR})</insert> |
| | | <insert id="insertSelective" parameterType="com.ks.lijin.pojo.DO.LiJinProviderTaoKeAccount" useGeneratedKeys="true" |
| | | keyProperty="id">insert into tlj_provider_account |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | |
| | | <if test="createTime != null">ac_create_time,</if> |
| | | <if test="updatorId != null">ac_updator_id,</if> |
| | | <if test="updateTime != null">ac_update_time,</if> |
| | | <if test="errorCode != null">ac_error_code,</if> |
| | | <if test="errorMsg != null">ac_error_msg,</if> |
| | | </trim> |
| | | values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | |
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updatorId != null">#{updatorId,jdbcType=BIGINT},</if> |
| | | <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="errorCode != null">#{errorCode,jdbcType=INTEGER},</if> |
| | | <if test="errorMsg != null">#{errorMsg,jdbcType=VARCHAR},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" |
| | | parameterType="com.ks.lijin.pojo.DO.LiJinProviderTaoKeAccount">update tlj_provider_account set ac_provider_id = #{providerId,jdbcType=BIGINT},ac_account_name = #{accountName,jdbcType=VARCHAR},ac_app_key = #{appKey,jdbcType=VARCHAR},ac_app_secret = #{appSecret,jdbcType=VARCHAR},ac_pid = #{pid,jdbcType=VARCHAR},ac_max_money = #{maxMoney,jdbcType=DECIMAL},ac_max_number = #{maxNumber,jdbcType=INTEGER},ac_today_consume_money = #{todayConsumeMoney,jdbcType=DECIMAL},ac_today_consume_number = #{todayConsumeNumber,jdbcType=INTEGER},ac_state = #{state,jdbcType=INTEGER},ac_creator_id = #{creatorId,jdbcType=BIGINT},ac_create_time = #{createTime,jdbcType=TIMESTAMP},ac_updator_id = #{updatorId,jdbcType=BIGINT},ac_update_time = #{updateTime,jdbcType=TIMESTAMP}where ac_id = #{id,jdbcType=BIGINT}</update> |
| | | parameterType="com.ks.lijin.pojo.DO.LiJinProviderTaoKeAccount">update tlj_provider_account set ac_provider_id = #{providerId,jdbcType=BIGINT},ac_account_name = #{accountName,jdbcType=VARCHAR},ac_app_key = #{appKey,jdbcType=VARCHAR},ac_app_secret = #{appSecret,jdbcType=VARCHAR},ac_pid = #{pid,jdbcType=VARCHAR},ac_max_money = #{maxMoney,jdbcType=DECIMAL},ac_max_number = #{maxNumber,jdbcType=INTEGER},ac_today_consume_money = #{todayConsumeMoney,jdbcType=DECIMAL},ac_today_consume_number = #{todayConsumeNumber,jdbcType=INTEGER},ac_state = #{state,jdbcType=INTEGER},ac_creator_id = #{creatorId,jdbcType=BIGINT},ac_create_time = #{createTime,jdbcType=TIMESTAMP},ac_updator_id = #{updatorId,jdbcType=BIGINT},ac_update_time = #{updateTime,jdbcType=TIMESTAMP},ac_error_code =#{errorCode,jdbcType=INTEGER} ,ac_error_msg =#{errorMsg,jdbcType=VARCHAR} where ac_id = #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.ks.lijin.pojo.DO.LiJinProviderTaoKeAccount">update |
| | | tlj_provider_account |
| | | <set> |
| | |
| | | <if test="createTime != null">ac_create_time=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updatorId != null">ac_updator_id=#{updatorId,jdbcType=BIGINT},</if> |
| | | <if test="updateTime != null">ac_update_time=#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="errorCode !=null">ac_error_code =#{errorCode,jdbcType=INTEGER},</if> |
| | | <if test="errorMsg !=null">ac_error_msg =#{errorMsg,jdbcType=VARCHAR},</if> |
| | | </set> |
| | | where ac_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | |
| | | <!-- 非模板 --> |
| | | <sql id="listWhere"> |
| | | <if test="query.id!=null">and ac_id=#{query.id}</if> |
| | |
| | | <if test="query.state!=null">and ac_state=#{query.state}</if> |
| | | <if test="query.appKey!=null">and ac_app_key=#{query.appKey}</if> |
| | | <if test="query.appSecret!=null">and ac_app_secret=#{query.appSecret}</if> |
| | | <if test="query.errorCode!=null">and ac_error_code=#{query.errorCode}</if> |
| | | </sql> |
| | | |
| | | |
| | | <select id="listByPage" resultMap="BaseResultMap"> |
| | | select |
| | | <select id="listByPage" resultMap="BaseResultMap">select |
| | | <include refid="Base_Column_List"/> |
| | | from tlj_provider_account |
| | | where 1=1 |
| | | from tlj_provider_account where 1=1 |
| | | <include refid="listWhere"/> |
| | | limit #{query.start},#{query.count} |
| | | </select> |
| | | |
| | | <select id="count" resultType="java.lang.Long"> |
| | | select count(*) from tlj_provider_account |
| | | where 1=1 |
| | | <select id="count" resultType="java.lang.Long">select count(*) from tlj_provider_account where 1=1 |
| | | <include refid="listWhere"/> |
| | | </select> |
| | | |
| | | </mapper> |