This commit is contained in:
2023-06-15 14:40:11 +08:00
parent cdd2a217c3
commit e1b2be97cc
12 changed files with 49 additions and 682 deletions

View File

@@ -129,8 +129,9 @@ public class OrderService {
@Value("${adapay.callback}") @Value("${adapay.callback}")
private String ADAPAY_CALLBACK_URL; private String ADAPAY_CALLBACK_URL;
@Autowired @Autowired
private AdapayMemberInfoService adapayMemberInfoService; private IAdapayMemberAccountService adapayMemberAccountService;
/** /**
* 生成订单 * 生成订单
@@ -295,10 +296,10 @@ public class OrderService {
createAdaPaymentParam.setExpend(JSONObject.toJSONString( ImmutableMap.of("open_id", openId))); createAdaPaymentParam.setExpend(JSONObject.toJSONString( ImmutableMap.of("open_id", openId)));
// 分账对象信息 // 分账对象信息
AdapayMemberInfo adapayMemberInfo = adapayMemberInfoService.selectByStationId(orderInfo.getStationId()); String adapayMemberId = adapayMemberAccountService.selectAdapayMemberIdByStationId(orderInfo.getStationId());
if (adapayMemberInfo != null) { if (StringUtils.isNotBlank(adapayMemberId)) {
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
jsonObject.put("member_id", adapayMemberInfo.getMemberId()); jsonObject.put("member_id", adapayMemberId);
jsonObject.put("amount", amount); jsonObject.put("amount", amount);
jsonObject.put("fee_flag", Constants.Y); jsonObject.put("fee_flag", Constants.Y);

View File

@@ -23,7 +23,7 @@ public class CacheConstants {
public static final int cache_expire_time_1d = 60 * 60 * 24; public static final int cache_expire_time_1d = 60 * 60 * 24;
public static final String ADAPAY_MEMBER_INFO = "adapay_member_info:"; public static final String ADAPAY_MEMBER_ACCOUNT = "adapay_member_account:";
public static final String PILE_PROGRAM_VERSION = "pile_program_version_"; public static final String PILE_PROGRAM_VERSION = "pile_program_version_";

View File

@@ -14,13 +14,8 @@ import com.jsowell.common.exception.BusinessException;
import com.jsowell.common.util.StringUtils; import com.jsowell.common.util.StringUtils;
import com.jsowell.common.util.id.IdUtils; import com.jsowell.common.util.id.IdUtils;
import com.jsowell.pile.domain.AdapayMemberAccount; import com.jsowell.pile.domain.AdapayMemberAccount;
import com.jsowell.pile.domain.AdapayMemberInfo;
import com.jsowell.pile.domain.AdapaySettleAccount;
import com.jsowell.pile.service.AdapayMemberInfoService;
import com.jsowell.pile.service.IAdapayMemberAccountService; import com.jsowell.pile.service.IAdapayMemberAccountService;
import com.jsowell.pile.service.IAdapaySettleAccountService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@@ -37,12 +32,6 @@ public class AdapayMemberService {
@Value("${adapay.appId}") @Value("${adapay.appId}")
private String ADAPAY_APP_ID; private String ADAPAY_APP_ID;
@Autowired
private AdapayMemberInfoService adapayMemberInfoService;
@Autowired
private IAdapaySettleAccountService adapaySettleAccountService;
@Autowired @Autowired
private IAdapayMemberAccountService adapayMemberAccountService; private IAdapayMemberAccountService adapayMemberAccountService;
@@ -127,16 +116,7 @@ public class AdapayMemberService {
*/ */
public AdapayMemberVO selectAdapayMember(String merchantId) { public AdapayMemberVO selectAdapayMember(String merchantId) {
AdapayMemberVO resultVO = new AdapayMemberVO(); AdapayMemberVO resultVO = new AdapayMemberVO();
AdapayMemberInfo adapayMemberInfo = adapayMemberInfoService.selectByMerchantId(merchantId);
if (adapayMemberInfo != null) {
BeanUtils.copyProperties(adapayMemberInfo, resultVO);
}
// 通过merchantId 查询出汇付会员id 和 结算账户id用来查询余额
AdapaySettleAccount adapaySettleAccount = adapaySettleAccountService.selectByMerchantId(merchantId);
if (adapaySettleAccount != null) {
BeanUtils.copyProperties(adapaySettleAccount, resultVO);
}
return resultVO; return resultVO;
} }
@@ -174,12 +154,12 @@ public class AdapayMemberService {
public AdapayAccountBalanceVO queryAdapayAccountBalance(String merchantId) throws BaseAdaPayException { public AdapayAccountBalanceVO queryAdapayAccountBalance(String merchantId) throws BaseAdaPayException {
AdapayAccountBalanceVO vo = AdapayAccountBalanceVO.builder().build(); AdapayAccountBalanceVO vo = AdapayAccountBalanceVO.builder().build();
// 通过merchantId 查询出汇付会员id 和 结算账户id用来查询余额 // 通过merchantId 查询出汇付会员id 和 结算账户id用来查询余额
AdapaySettleAccount adapaySettleAccount = adapaySettleAccountService.selectByMerchantId(merchantId); AdapayMemberAccount adapayMemberAccount = adapayMemberAccountService.selectByMerchantId(merchantId);
if (adapaySettleAccount == null) { if (adapayMemberAccount == null) {
return vo; return vo;
} }
String settle_account_id = adapaySettleAccount.getAdapayMemberId(); String settle_account_id = adapayMemberAccount.getAdapayMemberId();
String member_id = adapaySettleAccount.getAdapayMemberId(); String member_id = adapayMemberAccount.getAdapayMemberId();
Map<String, Object> queryParams = Maps.newHashMap(); Map<String, Object> queryParams = Maps.newHashMap();
queryParams.put("settle_account_id", settle_account_id); queryParams.put("settle_account_id", settle_account_id);
queryParams.put("member_id", member_id); queryParams.put("member_id", member_id);
@@ -197,12 +177,7 @@ public class AdapayMemberService {
public AdapaySettleAccountVO selectSettleAccount(String merchantId) { public AdapaySettleAccountVO selectSettleAccount(String merchantId) {
AdapaySettleAccountVO vo = new AdapaySettleAccountVO(); AdapaySettleAccountVO vo = new AdapaySettleAccountVO();
// 通过merchantId 查询出汇付会员id 和 结算账户id用来查询余额
AdapaySettleAccount adapaySettleAccount = adapaySettleAccountService.selectByMerchantId(merchantId);
if (adapaySettleAccount == null) {
return vo;
}
BeanUtils.copyProperties(adapaySettleAccount, vo);
return vo; return vo;
} }
} }

View File

@@ -1,21 +0,0 @@
package com.jsowell.pile.service;
import com.jsowell.pile.domain.AdapayMemberInfo;
public interface AdapayMemberInfoService {
int deleteByPrimaryKey(Integer id);
int insert(AdapayMemberInfo record);
int insertSelective(AdapayMemberInfo record);
AdapayMemberInfo selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(AdapayMemberInfo record);
int updateByPrimaryKey(AdapayMemberInfo record);
AdapayMemberInfo selectByMerchantId(String merchantId);
AdapayMemberInfo selectByStationId(String stationId);
}

View File

@@ -60,4 +60,6 @@ public interface IAdapayMemberAccountService {
public int deleteAdapayMemberAccountById(Long id); public int deleteAdapayMemberAccountById(Long id);
AdapayMemberAccount selectByMerchantId(String merchantId); AdapayMemberAccount selectByMerchantId(String merchantId);
String selectAdapayMemberIdByStationId(String stationId);
} }

View File

@@ -1,63 +0,0 @@
package com.jsowell.pile.service;
import com.jsowell.pile.domain.AdapaySettleAccount;
import java.util.List;
/**
* 汇付结算账户Service接口
*
* @author jsowell
* @date 2023-06-12
*/
public interface IAdapaySettleAccountService {
/**
* 查询汇付结算账户
*
* @param id 汇付结算账户主键
* @return 汇付结算账户
*/
public AdapaySettleAccount selectAdapaySettleAccountById(Long id);
/**
* 查询汇付结算账户列表
*
* @param adapaySettleAccount 汇付结算账户
* @return 汇付结算账户集合
*/
public List<AdapaySettleAccount> selectAdapaySettleAccountList(AdapaySettleAccount adapaySettleAccount);
/**
* 新增汇付结算账户
*
* @param adapaySettleAccount 汇付结算账户
* @return 结果
*/
public int insertAdapaySettleAccount(AdapaySettleAccount adapaySettleAccount);
/**
* 修改汇付结算账户
*
* @param adapaySettleAccount 汇付结算账户
* @return 结果
*/
public int updateAdapaySettleAccount(AdapaySettleAccount adapaySettleAccount);
/**
* 批量删除汇付结算账户
*
* @param ids 需要删除的汇付结算账户主键集合
* @return 结果
*/
public int deleteAdapaySettleAccountByIds(Long[] ids);
/**
* 删除汇付结算账户信息
*
* @param id 汇付结算账户主键
* @return 结果
*/
public int deleteAdapaySettleAccountById(Long id);
AdapaySettleAccount selectByMerchantId(String merchantId);
}

View File

@@ -1,9 +1,13 @@
package com.jsowell.pile.service.impl; package com.jsowell.pile.service.impl;
import com.jsowell.common.constant.CacheConstants;
import com.jsowell.common.core.redis.RedisCache;
import com.jsowell.common.util.DateUtils; import com.jsowell.common.util.DateUtils;
import com.jsowell.pile.domain.AdapayMemberAccount; import com.jsowell.pile.domain.AdapayMemberAccount;
import com.jsowell.pile.domain.PileStationInfo;
import com.jsowell.pile.mapper.AdapayMemberAccountMapper; import com.jsowell.pile.mapper.AdapayMemberAccountMapper;
import com.jsowell.pile.service.IAdapayMemberAccountService; import com.jsowell.pile.service.IAdapayMemberAccountService;
import com.jsowell.pile.service.IPileStationInfoService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@@ -20,6 +24,12 @@ public class AdapayMemberAccountServiceImpl implements IAdapayMemberAccountServi
@Autowired @Autowired
private AdapayMemberAccountMapper adapayMemberAccountMapper; private AdapayMemberAccountMapper adapayMemberAccountMapper;
@Autowired
private IPileStationInfoService pileStationInfoService;
@Autowired
private RedisCache redisCache;
/** /**
* 查询【请填写功能名称】 * 查询【请填写功能名称】
* *
@@ -90,6 +100,27 @@ public class AdapayMemberAccountServiceImpl implements IAdapayMemberAccountServi
@Override @Override
public AdapayMemberAccount selectByMerchantId(String merchantId) { public AdapayMemberAccount selectByMerchantId(String merchantId) {
return adapayMemberAccountMapper.selectByMerchantId(merchantId); String redisKey = CacheConstants.ADAPAY_MEMBER_ACCOUNT + merchantId;
AdapayMemberAccount adapayMemberAccount = redisCache.getCacheObject(redisKey);
if (adapayMemberAccount == null) {
adapayMemberAccount = adapayMemberAccountMapper.selectByMerchantId(merchantId);
if (adapayMemberAccount != null) {
redisCache.setCacheObject(redisKey, adapayMemberAccount, CacheConstants.cache_expire_time_1h);
}
}
return adapayMemberAccount;
}
@Override
public String selectAdapayMemberIdByStationId(String stationId) {
PileStationInfo pileStationInfo = pileStationInfoService.selectPileStationInfoById(Long.parseLong(stationId));
if (pileStationInfo == null) {
return null;
}
AdapayMemberAccount adapayMemberAccount = selectByMerchantId(pileStationInfo.getMerchantId() + "");
if (adapayMemberAccount == null) {
return null;
}
return adapayMemberAccount.getAdapayMemberId();
} }
} }

View File

@@ -1,78 +0,0 @@
package com.jsowell.pile.service.impl;
import com.jsowell.common.constant.CacheConstants;
import com.jsowell.common.core.redis.RedisCache;
import com.jsowell.pile.domain.AdapayMemberInfo;
import com.jsowell.pile.domain.PileStationInfo;
import com.jsowell.pile.mapper.AdapayMemberInfoMapper;
import com.jsowell.pile.service.AdapayMemberInfoService;
import com.jsowell.pile.service.IPileStationInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@Service
public class AdapayMemberInfoServiceImpl implements AdapayMemberInfoService {
@Resource
private AdapayMemberInfoMapper adapayMemberInfoMapper;
@Autowired
private RedisCache redisCache;
@Autowired
private IPileStationInfoService pileStationInfoService;
@Override
public int deleteByPrimaryKey(Integer id) {
return adapayMemberInfoMapper.deleteByPrimaryKey(id);
}
@Override
public int insert(AdapayMemberInfo record) {
return adapayMemberInfoMapper.insert(record);
}
@Override
public int insertSelective(AdapayMemberInfo record) {
return adapayMemberInfoMapper.insertSelective(record);
}
@Override
public AdapayMemberInfo selectByPrimaryKey(Integer id) {
return adapayMemberInfoMapper.selectByPrimaryKey(id);
}
@Override
public int updateByPrimaryKeySelective(AdapayMemberInfo record) {
return adapayMemberInfoMapper.updateByPrimaryKeySelective(record);
}
@Override
public int updateByPrimaryKey(AdapayMemberInfo record) {
return adapayMemberInfoMapper.updateByPrimaryKey(record);
}
@Override
public AdapayMemberInfo selectByMerchantId(String merchantId) {
String redisKey = CacheConstants.ADAPAY_MEMBER_INFO + merchantId;
AdapayMemberInfo adapayMemberInfo = redisCache.getCacheObject(redisKey);
if (adapayMemberInfo == null) {
adapayMemberInfo = adapayMemberInfoMapper.selectByMerchantId(merchantId);
if (adapayMemberInfo != null) {
redisCache.setCacheObject(redisKey, adapayMemberInfo, CacheConstants.cache_expire_time_1d);
}
}
return adapayMemberInfo;
}
@Override
public AdapayMemberInfo selectByStationId(String stationId) {
PileStationInfo pileStationInfo = pileStationInfoService.selectPileStationInfoById(Long.parseLong(stationId));
if (pileStationInfo != null) {
return selectByMerchantId(pileStationInfo.getMerchantId() + "");
}
return null;
}
}

View File

@@ -1,95 +0,0 @@
package com.jsowell.pile.service.impl;
import com.jsowell.common.util.DateUtils;
import com.jsowell.pile.domain.AdapaySettleAccount;
import com.jsowell.pile.mapper.AdapaySettleAccountMapper;
import com.jsowell.pile.service.IAdapaySettleAccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 汇付结算账户Service业务层处理
*
* @author jsowell
* @date 2023-06-12
*/
@Service
public class AdapaySettleAccountServiceImpl implements IAdapaySettleAccountService {
@Autowired
private AdapaySettleAccountMapper adapaySettleAccountMapper;
/**
* 查询汇付结算账户
*
* @param id 汇付结算账户主键
* @return 汇付结算账户
*/
@Override
public AdapaySettleAccount selectAdapaySettleAccountById(Long id) {
return adapaySettleAccountMapper.selectAdapaySettleAccountById(id);
}
/**
* 查询汇付结算账户列表
*
* @param adapaySettleAccount 汇付结算账户
* @return 汇付结算账户
*/
@Override
public List<AdapaySettleAccount> selectAdapaySettleAccountList(AdapaySettleAccount adapaySettleAccount) {
return adapaySettleAccountMapper.selectAdapaySettleAccountList(adapaySettleAccount);
}
/**
* 新增汇付结算账户
*
* @param adapaySettleAccount 汇付结算账户
* @return 结果
*/
@Override
public int insertAdapaySettleAccount(AdapaySettleAccount adapaySettleAccount) {
adapaySettleAccount.setCreateTime(DateUtils.getNowDate());
return adapaySettleAccountMapper.insertAdapaySettleAccount(adapaySettleAccount);
}
/**
* 修改汇付结算账户
*
* @param adapaySettleAccount 汇付结算账户
* @return 结果
*/
@Override
public int updateAdapaySettleAccount(AdapaySettleAccount adapaySettleAccount) {
adapaySettleAccount.setUpdateTime(DateUtils.getNowDate());
return adapaySettleAccountMapper.updateAdapaySettleAccount(adapaySettleAccount);
}
/**
* 批量删除汇付结算账户
*
* @param ids 需要删除的汇付结算账户主键
* @return 结果
*/
@Override
public int deleteAdapaySettleAccountByIds(Long[] ids) {
return adapaySettleAccountMapper.deleteAdapaySettleAccountByIds(ids);
}
/**
* 删除汇付结算账户信息
*
* @param id 汇付结算账户主键
* @return 结果
*/
@Override
public int deleteAdapaySettleAccountById(Long id) {
return adapaySettleAccountMapper.deleteAdapaySettleAccountById(id);
}
@Override
public AdapaySettleAccount selectByMerchantId(String merchantId) {
return adapaySettleAccountMapper.selectByMerchantId(merchantId);
}
}

View File

@@ -147,8 +147,7 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
private ISettleOrderReportService settleOrderReportService; private ISettleOrderReportService settleOrderReportService;
@Autowired @Autowired
private AdapayMemberInfoService adapayMemberInfoService; private IAdapayMemberAccountService adapayMemberAccountService;
/** /**
* 条件查询订单基本信息 * 条件查询订单基本信息
* *
@@ -1853,10 +1852,10 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
// 分账对象信息 // 分账对象信息
OrderBasicInfo orderBasicInfo = getOrderInfoByOrderCode(dto.getOrderCode()); OrderBasicInfo orderBasicInfo = getOrderInfoByOrderCode(dto.getOrderCode());
if (orderBasicInfo != null) { if (orderBasicInfo != null) {
AdapayMemberInfo adapayMemberInfo = adapayMemberInfoService.selectByStationId(orderBasicInfo.getStationId()); String adapayMemberId = adapayMemberAccountService.selectAdapayMemberIdByStationId(orderBasicInfo.getStationId());
if (adapayMemberInfo != null) { if (StringUtils.isNotBlank(adapayMemberId)) {
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
jsonObject.put("member_id", adapayMemberInfo.getMemberId()); jsonObject.put("member_id", adapayMemberId);
jsonObject.put("amount", amount); jsonObject.put("amount", amount);
jsonObject.put("fee_flag", Constants.Y); jsonObject.put("fee_flag", Constants.Y);

View File

@@ -1,232 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.jsowell.pile.mapper.AdapayMemberInfoMapper">
<resultMap id="BaseResultMap" type="com.jsowell.pile.domain.AdapayMemberInfo">
<!--@mbg.generated-->
<!--@Table adapay_member_info-->
<id column="id" jdbcType="INTEGER" property="id" />
<result column="merchant_id" jdbcType="VARCHAR" property="merchantId" />
<result column="member_id" jdbcType="VARCHAR" property="memberId" />
<result column="gender" jdbcType="VARCHAR" property="gender" />
<result column="identified" jdbcType="VARCHAR" property="identified" />
<result column="tel_no" jdbcType="INTEGER" property="telNo" />
<result column="prod_mode" jdbcType="VARCHAR" property="prodMode" />
<result column="nickname" jdbcType="VARCHAR" property="nickname" />
<result column="disabled" jdbcType="VARCHAR" property="disabled" />
<result column="location" jdbcType="VARCHAR" property="location" />
<result column="app_id" jdbcType="VARCHAR" property="appId" />
<result column="email" jdbcType="VARCHAR" property="email" />
<result column="object" jdbcType="VARCHAR" property="object" />
<result column="status" jdbcType="VARCHAR" property="status" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="del_flag" jdbcType="VARCHAR" property="delFlag" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, merchant_id, member_id, gender, `identified`, tel_no, prod_mode, nickname, disabled, `location`,
app_id, email, `object`, `status`, create_time, del_flag
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
<!--@mbg.generated-->
select
<include refid="Base_Column_List" />
from adapay_member_info
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
<!--@mbg.generated-->
delete from adapay_member_info
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.AdapayMemberInfo" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into adapay_member_info (merchant_id, member_id, gender, `identified`,
tel_no, prod_mode, nickname,
disabled, `location`, app_id,
email, `object`, `status`
)
values (#{merchantId,jdbcType=VARCHAR}, #{memberId,jdbcType=VARCHAR}, #{gender,jdbcType=VARCHAR}, #{identified,jdbcType=VARCHAR},
#{telNo,jdbcType=INTEGER}, #{prodMode,jdbcType=VARCHAR}, #{nickname,jdbcType=VARCHAR},
#{disabled,jdbcType=VARCHAR}, #{location,jdbcType=VARCHAR}, #{appId,jdbcType=VARCHAR},
#{email,jdbcType=VARCHAR}, #{object,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.AdapayMemberInfo" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into adapay_member_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="merchantId != null">
merchant_id,
</if>
<if test="memberId != null">
member_id,
</if>
<if test="gender != null">
gender,
</if>
<if test="identified != null">
`identified`,
</if>
<if test="telNo != null">
tel_no,
</if>
<if test="prodMode != null">
prod_mode,
</if>
<if test="nickname != null">
nickname,
</if>
<if test="disabled != null">
disabled,
</if>
<if test="location != null">
`location`,
</if>
<if test="appId != null">
app_id,
</if>
<if test="email != null">
email,
</if>
<if test="object != null">
`object`,
</if>
<if test="status != null">
`status`,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="delFlag != null">
del_flag,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="merchantId != null">
#{merchantId,jdbcType=VARCHAR},
</if>
<if test="memberId != null">
#{memberId,jdbcType=VARCHAR},
</if>
<if test="gender != null">
#{gender,jdbcType=VARCHAR},
</if>
<if test="identified != null">
#{identified,jdbcType=VARCHAR},
</if>
<if test="telNo != null">
#{telNo,jdbcType=INTEGER},
</if>
<if test="prodMode != null">
#{prodMode,jdbcType=VARCHAR},
</if>
<if test="nickname != null">
#{nickname,jdbcType=VARCHAR},
</if>
<if test="disabled != null">
#{disabled,jdbcType=VARCHAR},
</if>
<if test="location != null">
#{location,jdbcType=VARCHAR},
</if>
<if test="appId != null">
#{appId,jdbcType=VARCHAR},
</if>
<if test="email != null">
#{email,jdbcType=VARCHAR},
</if>
<if test="object != null">
#{object,jdbcType=VARCHAR},
</if>
<if test="status != null">
#{status,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="delFlag != null">
#{delFlag,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.jsowell.pile.domain.AdapayMemberInfo">
<!--@mbg.generated-->
update adapay_member_info
<set>
<if test="merchantId != null">
merchant_id = #{merchantId,jdbcType=VARCHAR},
</if>
<if test="memberId != null">
member_id = #{memberId,jdbcType=VARCHAR},
</if>
<if test="gender != null">
gender = #{gender,jdbcType=VARCHAR},
</if>
<if test="identified != null">
`identified` = #{identified,jdbcType=VARCHAR},
</if>
<if test="telNo != null">
tel_no = #{telNo,jdbcType=INTEGER},
</if>
<if test="prodMode != null">
prod_mode = #{prodMode,jdbcType=VARCHAR},
</if>
<if test="nickname != null">
nickname = #{nickname,jdbcType=VARCHAR},
</if>
<if test="disabled != null">
disabled = #{disabled,jdbcType=VARCHAR},
</if>
<if test="location != null">
`location` = #{location,jdbcType=VARCHAR},
</if>
<if test="appId != null">
app_id = #{appId,jdbcType=VARCHAR},
</if>
<if test="email != null">
email = #{email,jdbcType=VARCHAR},
</if>
<if test="object != null">
`object` = #{object,jdbcType=VARCHAR},
</if>
<if test="status != null">
`status` = #{status,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="delFlag != null">
del_flag = #{delFlag,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.jsowell.pile.domain.AdapayMemberInfo">
<!--@mbg.generated-->
update adapay_member_info
set merchant_id = #{merchantId,jdbcType=VARCHAR},
member_id = #{memberId,jdbcType=VARCHAR},
gender = #{gender,jdbcType=VARCHAR},
`identified` = #{identified,jdbcType=VARCHAR},
tel_no = #{telNo,jdbcType=INTEGER},
prod_mode = #{prodMode,jdbcType=VARCHAR},
nickname = #{nickname,jdbcType=VARCHAR},
disabled = #{disabled,jdbcType=VARCHAR},
`location` = #{location,jdbcType=VARCHAR},
app_id = #{appId,jdbcType=VARCHAR},
email = #{email,jdbcType=VARCHAR},
`object` = #{object,jdbcType=VARCHAR},
`status` = #{status,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
del_flag = #{delFlag,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="selectByMerchantId" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from adapay_member_info
where del_flag = '0'
and merchant_id = #{merchantId,jdbcType=VARCHAR}
</select>
</mapper>

View File

@@ -1,152 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.jsowell.pile.mapper.AdapaySettleAccountMapper">
<resultMap type="com.jsowell.pile.domain.AdapaySettleAccount" id="AdapaySettleAccountResult">
<result property="id" column="id" />
<result property="merchantId" column="merchant_id" />
<result property="adapayMemberId" column="adapay_member_id" />
<result property="settleAccountId" column="settle_account_id" />
<result property="cardId" column="card_id" />
<result property="cardName" column="card_name" />
<result property="certId" column="cert_id" />
<result property="certType" column="cert_type" />
<result property="telNo" column="tel_no" />
<result property="bankCode" column="bank_code" />
<result property="bankName" column="bank_name" />
<result property="bankAcctType" column="bank_acct_type" />
<result property="provCode" column="prov_code" />
<result property="areaCode" column="area_code" />
<result property="createTime" column="create_time" />
<result property="createBy" column="create_by" />
<result property="updateTime" column="update_time" />
<result property="updateBy" column="update_by" />
<result property="delFlag" column="del_flag" />
</resultMap>
<sql id="Base_Column_List">
id, merchant_id, adapay_member_id, settle_account_id, card_id, card_name, cert_id, cert_type, tel_no, bank_code, bank_name, bank_acct_type, prov_code, area_code, create_time, create_by, update_time, update_by, del_flag
</sql>
<sql id="selectAdapaySettleAccountVo">
select
<include refid="Base_Column_List"/>
from adapay_settle_account
</sql>
<select id="selectAdapaySettleAccountList" parameterType="com.jsowell.pile.domain.AdapaySettleAccount" resultMap="AdapaySettleAccountResult">
<include refid="selectAdapaySettleAccountVo"/>
<where>
<if test="merchantId != null and merchantId != ''"> and merchant_id = #{merchantId}</if>
<if test="adapayMemberId != null and adapayMemberId != ''"> and adapay_member_id = #{adapayMemberId}</if>
<if test="settleAccountId != null and settleAccountId != ''"> and settle_account_id = #{settleAccountId}</if>
<if test="cardId != null and cardId != ''"> and card_id = #{cardId}</if>
<if test="cardName != null and cardName != ''"> and card_name like concat('%', #{cardName}, '%')</if>
<if test="certId != null and certId != ''"> and cert_id = #{certId}</if>
<if test="certType != null and certType != ''"> and cert_type = #{certType}</if>
<if test="telNo != null and telNo != ''"> and tel_no = #{telNo}</if>
<if test="bankCode != null and bankCode != ''"> and bank_code = #{bankCode}</if>
<if test="bankName != null and bankName != ''"> and bank_name like concat('%', #{bankName}, '%')</if>
<if test="bankAcctType != null and bankAcctType != ''"> and bank_acct_type = #{bankAcctType}</if>
<if test="provCode != null and provCode != ''"> and prov_code = #{provCode}</if>
<if test="areaCode != null and areaCode != ''"> and area_code = #{areaCode}</if>
</where>
</select>
<select id="selectAdapaySettleAccountById" parameterType="Long" resultMap="AdapaySettleAccountResult">
<include refid="selectAdapaySettleAccountVo"/>
where id = #{id}
</select>
<insert id="insertAdapaySettleAccount" parameterType="com.jsowell.pile.domain.AdapaySettleAccount">
insert into adapay_settle_account
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="merchantId != null">merchant_id,</if>
<if test="adapayMemberId != null">adapay_member_id,</if>
<if test="settleAccountId != null">settle_account_id,</if>
<if test="cardId != null">card_id,</if>
<if test="cardName != null">card_name,</if>
<if test="certId != null">cert_id,</if>
<if test="certType != null">cert_type,</if>
<if test="telNo != null">tel_no,</if>
<if test="bankCode != null">bank_code,</if>
<if test="bankName != null">bank_name,</if>
<if test="bankAcctType != null">bank_acct_type,</if>
<if test="provCode != null">prov_code,</if>
<if test="areaCode != null">area_code,</if>
<if test="createTime != null">create_time,</if>
<if test="createBy != null">create_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="delFlag != null">del_flag,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="merchantId != null">#{merchantId},</if>
<if test="adapayMemberId != null">#{adapayMemberId},</if>
<if test="settleAccountId != null">#{settleAccountId},</if>
<if test="cardId != null">#{cardId},</if>
<if test="cardName != null">#{cardName},</if>
<if test="certId != null">#{certId},</if>
<if test="certType != null">#{certType},</if>
<if test="telNo != null">#{telNo},</if>
<if test="bankCode != null">#{bankCode},</if>
<if test="bankName != null">#{bankName},</if>
<if test="bankAcctType != null">#{bankAcctType},</if>
<if test="provCode != null">#{provCode},</if>
<if test="areaCode != null">#{areaCode},</if>
<if test="createTime != null">#{createTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="delFlag != null">#{delFlag},</if>
</trim>
</insert>
<update id="updateAdapaySettleAccount" parameterType="com.jsowell.pile.domain.AdapaySettleAccount">
update adapay_settle_account
<trim prefix="SET" suffixOverrides=",">
<if test="merchantId != null">merchant_id = #{merchantId},</if>
<if test="adapayMemberId != null">adapay_member_id = #{adapayMemberId},</if>
<if test="settleAccountId != null">settle_account_id = #{settleAccountId},</if>
<if test="cardId != null">card_id = #{cardId},</if>
<if test="cardName != null">card_name = #{cardName},</if>
<if test="certId != null">cert_id = #{certId},</if>
<if test="certType != null">cert_type = #{certType},</if>
<if test="telNo != null">tel_no = #{telNo},</if>
<if test="bankCode != null">bank_code = #{bankCode},</if>
<if test="bankName != null">bank_name = #{bankName},</if>
<if test="bankAcctType != null">bank_acct_type = #{bankAcctType},</if>
<if test="provCode != null">prov_code = #{provCode},</if>
<if test="areaCode != null">area_code = #{areaCode},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteAdapaySettleAccountById" parameterType="Long">
delete from adapay_settle_account where id = #{id}
</delete>
<delete id="deleteAdapaySettleAccountByIds" parameterType="String">
delete from adapay_settle_account where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="selectByMerchantId" resultMap="AdapaySettleAccountResult">
select
<include refid="Base_Column_List"/>
from adapay_settle_account
where del_flag = '0'
and merchant_id = #{merchantId,jdbcType=VARCHAR}
</select>
</mapper>