增删改查 控制层
/**
* 新增对账差错all
*/
@PreAuthorize("@ss.hasPermi('pay:rpAccountCheckMistake:add')")
@Log(title = "对账差错 ", businessType = BusinessType.INSERT)
@PostMapping("/addCheckMistake")
public AjaxResult addCheckMistake(@RequestBody RpAccountCheckMistake rpAccountCheckMistake)
{
return toAjax(rpAccountCheckMistakeService.insertRpAccountCheckMistake(rpAccountCheckMistake));
}
/**
* 删除对账差错
*/
@PreAuthorize("@ss.hasPermi('pay:rpAccountCheckMistake:remove')")
@Log(title = "对账差错 ", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable String[] ids)
{
return toAjax(rpAccountCheckMistakeService.deleteRpAccountCheckMistakeByIds(ids));
}
/**
* 修改对账差错
*/
@PreAuthorize("@ss.hasPermi('pay:rpAccountCheckMistake:edit')")
@Log(title = "对账差错 ", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody RpAccountCheckMistake rpAccountCheckMistake)
{
return toAjax(rpAccountCheckMistakeService.updateRpAccountCheckMistake(rpAccountCheckMistake));
}
@PreAuthorize("@ss.hasPermi('pay:rpAccountCheckMistake:list')")
@GetMapping("/listCheckMistake")
public TableDataInfo listCheckMistake(RpAccountCheckMistake rpAccountCheckMistake)
{
startPage();
List<RpAccountCheckMistake> list = rpAccountCheckMistakeService.listCheckMistake(rpAccountCheckMistake);
return getDataTable(list);
}
增删改查 service
/**
* 新增对账差错 all
*/
public int insertRpAccountCheckMistake(RpAccountCheckMistake rpAccountCheckMistake);
/**
* 批量删除对账差错
*
* @param ids 需要删除的对账差错 ID
* @return 结果
*/
public int deleteRpAccountCheckMistakeByIds(String[] ids);
/**
* 删除对账差错 信息
*
* @param id 对账差错 ID
* @return 结果
*/
public int deleteRpAccountCheckMistakeById(String id);
/**
* 修改对账差错
*
* @param rpAccountCheckMistake 对账差错
* @return 结果
*/
public int updateRpAccountCheckMistake(RpAccountCheckMistake rpAccountCheckMistake);
/**
* 生成对账差错 列表查询all
*/
List<RpAccountCheckMistake> listCheckMistake(RpAccountCheckMistake rpAccountCheckMistake);
增删改查 serviceimpl
/**
* 新增对账差错 all
*/
@Override
public int insertRpAccountCheckMistake(RpAccountCheckMistake rpAccountCheckMistake)
{
rpAccountCheckMistake.setCreateTime(DateUtils.getNowDate());
return rpAccountCheckMistakeMapper.insertRpAccountCheckMistake(rpAccountCheckMistake);
}
/**
* 批量删除对账差错
*
* @param ids 需要删除的对账差错 ID
* @return 结果
*/
@Override
public int deleteRpAccountCheckMistakeByIds(String[] ids)
{
return rpAccountCheckMistakeMapper.deleteRpAccountCheckMistakeByIds(ids);
}
/**
* 删除对账差错 信息
*
* @param id 对账差错 ID
* @return 结果
*/
@Override
public int deleteRpAccountCheckMistakeById(String id)
{
return rpAccountCheckMistakeMapper.deleteRpAccountCheckMistakeById(id);
}
/**
* 修改对账差错
*
* @param rpAccountCheckMistake 对账差错
* @return 结果
*/
@Override
public int updateRpAccountCheckMistake(RpAccountCheckMistake rpAccountCheckMistake)
{
return rpAccountCheckMistakeMapper.updateRpAccountCheckMistake(rpAccountCheckMistake);
}
@Override
public List<RpAccountCheckMistake> listCheckMistake(RpAccountCheckMistake rpAccountCheckMistake) {
List<RpAccountCheckMistake> list = rpAccountCheckMistakeMapper.listCheckMistake(rpAccountCheckMistake);
UUID id=UUID.randomUUID();
String[] secret=id.toString().split("-");
String secret16= secret[0]+secret[1]+secret[2];
// 做判断 防重复
RpAccountCheckMistake rpAccountCheckMistake1 = new RpAccountCheckMistake();
rpAccountCheckMistake1.setId(secret16);
rpAccountCheckMistake1.setAccountCheckBatchNo(buildNoService.buildReconciliationNo());
rpAccountCheckMistake1.setBillDate(list.get(0).getRemitConfirmTime());
rpAccountCheckMistake1.setOrderAmount(list.get(0).getRemitAmount());
rpAccountCheckMistake1.setFee(list.get(0).getSettFee());
rpAccountCheckMistake1.setTradeStatus(list.get(0).getSettStatus());
rpAccountCheckMistake1.setBankAmount(list.get(0).getRemitAmount());
rpAccountCheckMistake1.setBankFee(list.get(0).getSettFee());
rpAccountCheckMistake1.setMerchantNo(list.get(0).getSubMchId());
rpAccountCheckMistake1.setBankOrderNo(list.get(0).getBanktrxno());
rpAccountCheckMistakeMapper.insertRpAccountCheckMistake(rpAccountCheckMistake1);
return list;
}
增删改查 mapper
/**
* 新增对账差错 all
*/
public int insertRpAccountCheckMistake(RpAccountCheckMistake rpAccountCheckMistake);
/**
* 删除对账差错
*
* @param id 对账差错 ID
* @return 结果
*/
public int deleteRpAccountCheckMistakeById(String id);
/**
* 批量删除对账差错
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteRpAccountCheckMistakeByIds(String[] ids);
/**
* 修改对账差错
*
* @param rpAccountCheckMistake 对账差错
* @return 结果
*/
public int updateRpAccountCheckMistake(RpAccountCheckMistake rpAccountCheckMistake);
/**
* 生成对账差错 列表查询all
*/
List<RpAccountCheckMistake> listCheckMistake(RpAccountCheckMistake rpAccountCheckMistake);
增删改查 mapperimpl sql
<?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.fangen.pay.mapper.RpAccountCheckMistakeMapper">
<resultMap type="RpAccountCheckMistake" id="RpAccountCheckMistakeResult">
<result property="id" column="id" />
<result property="version" column="version" />
<result property="creater" column="creater" />
<result property="status" column="status" />
<result property="createTime" column="create_time" />
<result property="remark" column="remark" />
<result property="accountCheckBatchNo" column="account_check_batch_no" />
<result property="billDate" column="bill_date" />
<result property="bankType" column="bank_type" />
<result property="orderTime" column="order_time" />
<result property="merchantName" column="merchant_name" />
<result property="merchantNo" column="merchant_no" />
<result property="orderNo" column="order_no" />
<result property="tradeTime" column="trade_time" />
<result property="trxNo" column="trx_no" />
<result property="orderAmount" column="order_amount" />
<result property="refundAmount" column="refund_amount" />
<result property="tradeStatus" column="trade_status" />
<result property="fee" column="fee" />
<result property="bankTradeTime" column="bank_trade_time" />
<result property="bankOrderNo" column="bank_order_no" />
<result property="bankTrxNo" column="bank_trx_no" />
<result property="bankTradeStatus" column="bank_trade_status" />
<result property="bankAmount" column="bank_amount" />
<result property="bankRefundAmount" column="bank_refund_amount" />
<result property="bankFee" column="bank_fee" />
<result property="errType" column="err_type" />
<result property="handleStatus" column="handle_status" />
<result property="handleValue" column="handle_value" />
<result property="handleRemark" column="handle_remark" />
<result property="operatorName" column="operator_name" />
<result property="operatorAccountNo" column="operator_account_no" />
<result property="remitConfirmTime" column="remit_confirm_time" />
<result property="remitAmount" column="remit_amount" />
<result property="settFee" column="sett_fee" />
<result property="settStatus" column="sett_status" />
<result property="payWayName" column="pay_way_name" />
<result property="subMchId" column="sub_mch_id" />
<result property="banktrxno" column="banktrxno" />
</resultMap>
<!--all-->
<sql id="selectRpAccountCheckMistakeVo">
select id, status, create_time, remark, account_check_batch_no, bill_date, bank_type, order_time, merchant_name, merchant_no, order_no, trade_time, trx_no, order_amount, refund_amount, trade_status, fee, bank_trade_time, bank_order_no, bank_trx_no, bank_trade_status, bank_amount, bank_refund_amount, bank_fee, err_type, handle_status, handle_value, handle_remark, operator_name, operator_account_no from rp_account_check_mistake
</sql>
<!--all-->
<select id="selectRpAccountCheckMistakeList" parameterType="RpAccountCheckMistake" resultMap="RpAccountCheckMistakeResult">
<include refid="selectRpAccountCheckMistakeVo"/>
<where>
<if test="creater != null and creater != ''"> and creater = #{creater}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="accountCheckBatchNo != null and accountCheckBatchNo != ''"> and account_check_batch_no = #{accountCheckBatchNo}</if>
<if test="billDate != null "> and bill_date = #{billDate}</if>
<if test="bankType != null and bankType != ''"> and bank_type = #{bankType}</if>
<if test="orderTime != null "> and order_time = #{orderTime}</if>
<if test="merchantName != null and merchantName != ''"> and merchant_name like concat('%', #{merchantName}, '%')</if>
<if test="merchantNo != null and merchantNo != ''"> and merchant_no = #{merchantNo}</if>
<if test="orderNo != null and orderNo != ''"> and order_no = #{orderNo}</if>
<if test="tradeTime != null "> and trade_time = #{tradeTime}</if>
<if test="trxNo != null and trxNo != ''"> and trx_no = #{trxNo}</if>
<if test="orderAmount != null "> and order_amount = #{orderAmount}</if>
<if test="refundAmount != null "> and refund_amount = #{refundAmount}</if>
<if test="tradeStatus != null and tradeStatus != ''"> and trade_status = #{tradeStatus}</if>
<if test="fee != null "> and fee = #{fee}</if>
<if test="bankTradeTime != null "> and bank_trade_time = #{bankTradeTime}</if>
<if test="bankOrderNo != null and bankOrderNo != ''"> and bank_order_no = #{bankOrderNo}</if>
<if test="bankTrxNo != null and bankTrxNo != ''"> and bank_trx_no = #{bankTrxNo}</if>
<if test="bankTradeStatus != null and bankTradeStatus != ''"> and bank_trade_status = #{bankTradeStatus}</if>
<if test="bankAmount != null "> and bank_amount = #{bankAmount}</if>
<if test="bankRefundAmount != null "> and bank_refund_amount = #{bankRefundAmount}</if>
<if test="bankFee != null "> and bank_fee = #{bankFee}</if>
<if test="errType != null and errType != ''"> and err_type = #{errType}</if>
<if test="handleStatus != null and handleStatus != ''"> and handle_status = #{handleStatus}</if>
<if test="handleValue != null and handleValue != ''"> and handle_value = #{handleValue}</if>
<if test="handleRemark != null and handleRemark != ''"> and handle_remark = #{handleRemark}</if>
<if test="operatorName != null and operatorName != ''"> and operator_name like concat('%', #{operatorName}, '%')</if>
<if test="operatorAccountNo != null and operatorAccountNo != ''"> and operator_account_no = #{operatorAccountNo}</if>
</where>
</select>
<select id="selectRpAccountCheckMistakeById" parameterType="String" resultMap="RpAccountCheckMistakeResult">
<include refid="selectRpAccountCheckMistakeVo"/>
where id = #{id}
</select>
<!--all-->
<insert id="insertRpAccountCheckMistake" parameterType="RpAccountCheckMistake">
insert into rp_account_check_mistake
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="createTime != null">create_time,</if>
<if test="status != null">status,</if>
<if test="accountCheckBatchNo != null and accountCheckBatchNo != ''">account_check_batch_no,</if>
<if test="billDate != null">bill_date,</if>
<if test="bankType != null and bankType != ''">bank_type,</if>
<if test="orderTime != null">order_time,</if>
<if test="merchantName != null">merchant_name,</if>
<if test="merchantNo != null">merchant_no,</if>
<if test="orderNo != null">order_no,</if>
<if test="tradeTime != null">trade_time,</if>
<if test="trxNo != null">trx_no,</if>
<if test="orderAmount != null">order_amount,</if>
<if test="refundAmount != null">refund_amount,</if>
<if test="tradeStatus != null">trade_status,</if>
<if test="fee != null">fee,</if>
<if test="bankTradeTime != null">bank_trade_time,</if>
<if test="bankOrderNo != null">bank_order_no,</if>
<if test="bankTrxNo != null">bank_trx_no,</if>
<if test="bankTradeStatus != null">bank_trade_status,</if>
<if test="bankAmount != null">bank_amount,</if>
<if test="bankRefundAmount != null">bank_refund_amount,</if>
<if test="bankFee != null">bank_fee,</if>
<if test="errType != null and errType != ''">err_type,</if>
<if test="handleStatus != null and handleStatus != ''">handle_status,</if>
<if test="handleValue != null">handle_value,</if>
<if test="handleRemark != null">handle_remark,</if>
<if test="operatorName != null">operator_name,</if>
<if test="operatorAccountNo != null">operator_account_no,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="createTime != null">#{createTime},</if>
<if test="status != null">#{status},</if>
<if test="accountCheckBatchNo != null and accountCheckBatchNo != ''">#{accountCheckBatchNo},</if>
<if test="billDate != null">#{billDate},</if>
<if test="bankType != null and bankType != ''">#{bankType},</if>
<if test="orderTime != null">#{orderTime},</if>
<if test="merchantName != null">#{merchantName},</if>
<if test="merchantNo != null">#{merchantNo},</if>
<if test="orderNo != null">#{orderNo},</if>
<if test="tradeTime != null">#{tradeTime},</if>
<if test="trxNo != null">#{trxNo},</if>
<if test="orderAmount != null">#{orderAmount},</if>
<if test="refundAmount != null">#{refundAmount},</if>
<if test="tradeStatus != null">#{tradeStatus},</if>
<if test="fee != null">#{fee},</if>
<if test="bankTradeTime != null">#{bankTradeTime},</if>
<if test="bankOrderNo != null">#{bankOrderNo},</if>
<if test="bankTrxNo != null">#{bankTrxNo},</if>
<if test="bankTradeStatus != null">#{bankTradeStatus},</if>
<if test="bankAmount != null">#{bankAmount},</if>
<if test="bankRefundAmount != null">#{bankRefundAmount},</if>
<if test="bankFee != null">#{bankFee},</if>
<if test="errType != null and errType != ''">#{errType},</if>
<if test="handleStatus != null and handleStatus != ''">#{handleStatus},</if>
<if test="handleValue != null">#{handleValue},</if>
<if test="handleRemark != null">#{handleRemark},</if>
<if test="operatorName != null">#{operatorName},</if>
<if test="operatorAccountNo != null">#{operatorAccountNo},</if>
</trim>
</insert>
<update id="updateRpAccountCheckMistake" parameterType="RpAccountCheckMistake">
update rp_account_check_mistake
<trim prefix="SET" suffixOverrides=",">
<if test="version != null">version = #{version},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="editor != null">editor = #{editor},</if>
<if test="creater != null">creater = #{creater},</if>
<if test="editTime != null">edit_time = #{editTime},</if>
<if test="status != null">status = #{status},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="accountCheckBatchNo != null and accountCheckBatchNo != ''">account_check_batch_no = #{accountCheckBatchNo},</if>
<if test="billDate != null">bill_date = #{billDate},</if>
<if test="bankType != null and bankType != ''">bank_type = #{bankType},</if>
<if test="orderTime != null">order_time = #{orderTime},</if>
<if test="merchantName != null">merchant_name = #{merchantName},</if>
<if test="merchantNo != null">merchant_no = #{merchantNo},</if>
<if test="orderNo != null">order_no = #{orderNo},</if>
<if test="tradeTime != null">trade_time = #{tradeTime},</if>
<if test="trxNo != null">trx_no = #{trxNo},</if>
<if test="orderAmount != null">order_amount = #{orderAmount},</if>
<if test="refundAmount != null">refund_amount = #{refundAmount},</if>
<if test="tradeStatus != null">trade_status = #{tradeStatus},</if>
<if test="fee != null">fee = #{fee},</if>
<if test="bankTradeTime != null">bank_trade_time = #{bankTradeTime},</if>
<if test="bankOrderNo != null">bank_order_no = #{bankOrderNo},</if>
<if test="bankTrxNo != null">bank_trx_no = #{bankTrxNo},</if>
<if test="bankTradeStatus != null">bank_trade_status = #{bankTradeStatus},</if>
<if test="bankAmount != null">bank_amount = #{bankAmount},</if>
<if test="bankRefundAmount != null">bank_refund_amount = #{bankRefundAmount},</if>
<if test="bankFee != null">bank_fee = #{bankFee},</if>
<if test="errType != null and errType != ''">err_type = #{errType},</if>
<if test="handleStatus != null and handleStatus != ''">handle_status = #{handleStatus},</if>
<if test="handleValue != null">handle_value = #{handleValue},</if>
<if test="handleRemark != null">handle_remark = #{handleRemark},</if>
<if test="operatorName != null">operator_name = #{operatorName},</if>
<if test="operatorAccountNo != null">operator_account_no = #{operatorAccountNo},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteRpAccountCheckMistakeById" parameterType="String">
delete from rp_account_check_mistake where id = #{id}
</delete>
<delete id="deleteRpAccountCheckMistakeByIds" parameterType="String">
delete from rp_account_check_mistake where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<!--生成对账差错 列表查询all -->
<sql id="listCheckMistake1">
select rsr.remit_confirm_time,rsr.remit_amount,rsr.sett_fee,rsr.sett_status,rpw.pay_way_name,rmsr.sub_mch_id,rah.banktrxno ,racm.bank_trade_status,racm.err_type,racm.handle_status,racm.handle_value,racm.handle_remark,racm.account_check_batch_no
from rp_sett_record rsr left join rp_user_pay_config rupc on rsr.user_no = rupc.user_no
left join rp_pay_way rpw on rpw.pay_product_code = rupc.product_code
left join rp_micro_submit_record rmsr on rmsr.account_number = rsr.bank_account_no
left join rp_account_history rah on rmsr.account_number = rah.accountno
left join rp_account_check_mistake racm on racm.bank_trx_no = rah.banktrxno
</sql>
<!-- 条件-->
<select id="listCheckMistake" parameterType="RpAccountCheckMistake" resultMap="RpAccountCheckMistakeResult">
<include refid="listCheckMistake1"/>
<where>
<if test="billDate != null "> and bill_date = #{billDate}</if>
</where>
</select>
</mapper>