v1.1 后台-用户手动充值查询

This commit is contained in:
2022-10-19 21:37:07 +08:00
parent be5d5b99af
commit d90a139785
6 changed files with 1027 additions and 2 deletions

View File

@@ -9,10 +9,12 @@ import com.accompany.business.constant.ChargeChannelEnum;
import com.accompany.common.constant.Constant;
import com.accompany.common.utils.BlankUtil;
import com.accompany.common.utils.DateTimeUtil;
import com.accompany.common.utils.UUIDUitl;
import com.accompany.core.model.Users;
import com.accompany.core.service.user.UsersBaseService;
import com.accompany.payment.mapper.ChargeRecordMapper;
import com.accompany.payment.mapper.ChargeRecordMapperMgr;
import com.accompany.payment.mapper.ManualChargeRecordMapper;
import com.accompany.payment.model.ChargeRecord;
import com.accompany.payment.model.ChargeRecordExample;
import com.accompany.payment.vo.ChargeRecordDetailVo;
@@ -33,6 +35,7 @@ import javax.servlet.ServletOutputStream;
import java.io.OutputStream;
import java.math.BigDecimal;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
@@ -48,6 +51,8 @@ public class ChargeRecordAdminService extends BaseService {
private ChargeRecordMapper chargeRecordMapper;
@Autowired
private ChargeRecordAdminMapper chargeRecordAdminMapper;
@Autowired
private ManualChargeRecordMapper manualChargeRecordMapper;
@Autowired
private UsersBaseService usersBaseService;
@@ -187,8 +192,18 @@ public class ChargeRecordAdminService extends BaseService {
return statisVoList;
}
public PageInfo<ChargeRecord> queryUserChargeRecord(Long uid, String channel, Byte searchType, String chargeRecordId, Integer pageNum, Integer pageSize, String startDate, String endDate) throws Exception{
return queryChargeRecord(uid, channel, searchType, chargeRecordId, pageNum, pageSize, startDate, endDate,
(example)->chargeRecordMapper.selectByExample(example));
}
public PageInfo<ChargeRecord> queryManualChargeRecord(Long uid, String channel, Byte searchType, String chargeRecordId, Integer pageNum, Integer pageSize, String startDate, String endDate) throws Exception{
return queryChargeRecord(uid, channel, searchType, chargeRecordId, pageNum, pageSize, startDate, endDate,
(example)->manualChargeRecordMapper.selectByExample(example));
}
public PageInfo<ChargeRecord> queryChargeRecord(Long uid, String channel, Byte searchType, String chargeRecordId, Integer pageNum, Integer pageSize, String startDate, String endDate,
Function<ChargeRecordExample, List<ChargeRecord>> function){
ChargeRecordExample example = new ChargeRecordExample();
ChargeRecordExample.Criteria criteria = example.createCriteria();
if(Constant.ChargeRecordSearchType.CHARGE_ID.equals(searchType)){
@@ -216,7 +231,7 @@ public class ChargeRecordAdminService extends BaseService {
}
}
PageHelper.startPage(pageNum,pageSize);
List<ChargeRecord> list = chargeRecordMapper.selectByExample(example);
List<ChargeRecord> list = function.apply(example);
return new PageInfo<>(list);
}
@@ -278,4 +293,21 @@ public class ChargeRecordAdminService extends BaseService {
List<ChargeRecordCountryVo> data = getCountryGoldDetail(startTime, endTime);
EasyExcel.write(outputStream, ChargeRecordCountryVo.class).sheet("地区充值统计").doWrite(data);
}
public void addManualChargeRecord(String account, Long uid, String channel,
String country, String localCurrencyCode, Long localAmount, Long totalGold, Byte status) {
ChargeRecord chargeRecord = new ChargeRecord();
chargeRecord.setChargeRecordId(UUIDUitl.get());
chargeRecord.setChargeApp(account);
chargeRecord.setUid(uid);
chargeRecord.setChannel(channel);
chargeRecord.setCountry(country);
chargeRecord.setLocalCurrencyCode(localCurrencyCode);
chargeRecord.setLocalAmount(localAmount);
chargeRecord.setTotalGold(totalGold);
chargeRecord.setChargeStatus(status);
chargeRecord.setBussType(Constant.PayBussType.charge);
chargeRecord.setCreateTime(new Date());
manualChargeRecordMapper.insertSelective(chargeRecord);
}
}

View File

@@ -51,6 +51,7 @@ public class ChargeRecordPersonAdminVo {
@ExcelProperty("创建时间")
public String createTime;
public String chargeApp;
}

View File

@@ -10,6 +10,7 @@ import com.accompany.business.util.ReplaceDomainUtil;
import com.accompany.common.constant.Constant;
import com.accompany.common.result.BusiResult;
import com.accompany.common.status.BusiStatus;
import com.accompany.core.exception.ServiceException;
import com.accompany.core.model.Users;
import com.accompany.core.service.user.UsersBaseService;
import com.accompany.core.util.ExcelUtils;
@@ -208,8 +209,74 @@ public class ChargeRecordAdminController extends BaseController {
channel, searchType, chargeRecordId, e);
writeJson(false, e.getMessage());
}
}
@RequestMapping(value = "/manual/list", method = RequestMethod.GET)
@ResponseBody
public void getManualChargeRecord(Long erbanNo, String channel, Byte searchType, String chargeRecordId, String startDate, String endDate) {
Users users = null;
Long uid = 0L;
if (Constant.ChargeRecordSearchType.CHARGE_ID.equals(searchType)
|| Constant.ChargeRecordSearchType.THIRD_CHARGE_ID.equals(searchType)) {
if (StringUtils.isBlank(chargeRecordId)) {
writeJson(false, "账单号不能为空!");
}
} else {
if (erbanNo == null) {
writeJson(false, "请输入平台号");
}
users = usersBaseService.getUsersByErBanNo(erbanNo);
if (users == null) {
writeJson(false, "不存在此用户");
}
uid = users.getUid();
}
try {
ReplaceDomainUtil.handlerForObject(users);
PageInfo<ChargeRecord> pageInfo = chargeRecordAdminService.queryManualChargeRecord(uid, channel,
searchType, chargeRecordId, getPageNumber(), getPageSize(), startDate, endDate);
JSONObject jsonObject = new JSONObject();
jsonObject.put("total", pageInfo.getTotal());
jsonObject.put("rows", pageInfo.getList());
if (!CollectionUtils.isEmpty(pageInfo.getList())){
jsonObject.put("rows", chargeRecordAdminService.convertPersonVo(pageInfo.getList()));
}
if (Constant.ChargeRecordSearchType.PERSONAL.equals(searchType)) {
jsonObject.put("users", users);
} else {
if (pageInfo.getList().size() > 0) {
uid = pageInfo.getList().get(0).getUid();
users = usersService.getUsersByUid(uid);
jsonObject.put("users", users);
}
}
writeJson(jsonObject.toJSONString());
} catch (Exception e) {
logger.error("get user chargeRecord failed,erbanNo={},channel={},searchType={},chargeRecordId={}", erbanNo,
channel, searchType, chargeRecordId, e);
writeJson(false, e.getMessage());
}
}
@RequestMapping(value = "/manual/add", method = RequestMethod.POST)
@ResponseBody
public BusiResult<Void> addManualChargeRecord(String account, Long erbanNo, String channel, Byte status,
String country, String localCurrencyCode, Long localAmount, Long totalGold) {
Users users = null;
if (erbanNo == null) {
throw new ServiceException(BusiStatus.ERBAN_NO_NOT_EXIST,"请输入平台号");
}
users = usersBaseService.getUsersByErBanNo(erbanNo);
if (users == null) {
throw new ServiceException(BusiStatus.ERBAN_NO_NOT_EXIST, "用户不存在");
}
chargeRecordAdminService.addManualChargeRecord(account, users.getUid(), channel,
country, localCurrencyCode, localAmount, totalGold, status);
return new BusiResult<>(BusiStatus.SUCCESS);
}
/**

View File

@@ -0,0 +1,358 @@
<style>
#userMessage {
display: flex;
justify-content: flex-start;
align-items: center;
}
#userMessage .avatar {
width: 50px;
height: 50px;
}
#userMessage .avatar img {
width: 100%;
height: 100%;
}
#userMessage > div {
margin-right: 30px;
}
.erbanNo-text, #erbanNo, .channel-text, #channel, #startDate, #endDate {
display: none;
}
</style>
<section class="content">
<div class="box box-primary">
<div class="box-body">
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<section class="content-body">
<div id="toolbar">
<div id="userMessage">
<div class="avatar"><img src="" alt=""></div>
<div class="nick"></div>
<div class="erbanNo"></div>
</div>
<div class="search-wrapper">
<label for="erbanNo" class="control-label" class="erbanNo-text">平台号:</label>
<input type="text" class="" name="erbanNo" id="erbanNo">
<label for="searchType">查询类型</label>
<select name="searchType" id="searchType" class="">
<option value="1">根据订单号</option>
<option value="2">根据平台号</option>
<option value="3">根据第三方订单号</option>
</select>
<label for="channel" class="channel-text">充值渠道</label>
<select name="channel" id="channel">
<option value="">全部</option>
<option value="google_play_billing">谷歌内购</option>
<option value="payermax">payermax</option>
</select>
<label for="chargeRecordId" class="chargeRecord-text">订单号:</label>
<input type="text" id="chargeRecordId" name="chargeRecordId">
开始时间:<input type="text" name="startDate" id="startDate" class="input-sm">
结束时间:<input type="text" name="endDate" id="endDate" class="input-sm">
</div>
<div class="btn-group">
<button id="btnSearch" class="btn btn-primary">查询</button>
<button id="btnAddRecord" class="btn btn-default">新增</button>
</div>
</div>
<div id="table"></div>
</section>
</div>
</div>
</section>
<!-- 增加弹框 -->
<div class="modal fade" id="addModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="addModalLabel">新增</h4>
</div>
<div class="modal-body">
<form class="form-horizontal" id="addModalForm">
<div class="form-group">
<label for="modal_account" class="col-sm-3 control-label">银行账号<font color="red">*</font></label>
<div class="col-sm-9">
<input type="text" class="form-control" name="account" id="modal_account" placeholder="" >
</div>
</div>
<div class="form-group">
<label for="modal_erbanNo" class="col-sm-3 control-label">用户ID<font color="red">*</font></label>
<div class="col-sm-9">
<input type="text" class="form-control" name="erbanNo" id="modal_erbanNo" placeholder="">
</div>
</div>
<div class="form-group">
<label for="modal_channel" class="col-sm-3 control-label">充值渠道:</label>
<div class="col-sm-9">
<input type="text" class="form-control" name="channel" id="modal_channel" placeholder="">
</div>
</div>
<div class="form-group">
<label for="modal_country" class="col-sm-3 control-label">国家/地区:</label>
<div class="col-sm-9">
<input type="text" class="form-control" name="country" id="modal_country" placeholder="">
</div>
</div>
<div class="form-group">
<label for="modal_local_currency_code" class="col-sm-3 control-label">当地货币代码<font color="red">*</font></label>
<div class="col-sm-9">
<input type="text" class="form-control" name="localCurrencyCode" id="modal_local_currency_code" placeholder="">
</div>
</div>
<div class="form-group">
<label for="modal_local_amount" class="col-sm-3 control-label">当地货币交易数(分)<font color="red">*</font></label>
<div class="col-sm-9">
<input type="text" class="form-control" name="localAmount" id="modal_local_amount" placeholder="">
</div>
</div>
<div class="form-group">
<label for="modal_total_gold" class="col-sm-3 control-label">钻石数<font color="red">*</font></label>
<div class="col-sm-9">
<input type="text" class="form-control" name="totalGold" id="modal_total_gold" placeholder="">
</div>
</div>
<div class="form-group">
<label for="modal_status" class="col-sm-3 control-label">状态</font></label>
<div class="col-sm-9">
<select class="form-control" name="status" id="modal_status">
<option value="2">已支付</option>
<option value="1">未支付</option>
</select>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" id="btnAddModalConfirm">确定</button>
</div>
</div>
</div>
</div>
<script>
$('#table').bootstrapTable('destroy');
$('#table').bootstrapTable({
columns: [
{field: 'chargeRecordId', title: '充值订单号', align: 'center', valign: 'middle', width: '20%'},
{field: 'chargeApp', title: '银行账号', align: 'center', valign: 'middle', width: '20%'},
{field: 'erbanNo', title: '平台id', align: 'center', valign: 'middle'},
{field: 'nick', title: '昵称', align: 'center', valign: 'middle'},
{
field: 'channel', title: '充值渠道', align: 'center', valign: 'middle', width: '10%', formatter: function (val, row, index) {
if (val) {
switch (val) {
case "exchange":
return "兑换";
case "alipay":
return "支付宝APP";
case "wx":
return "微信APP";
case "alipay_wap":
return "支付宝H5";
case "ios_pay":
return "苹果内购";
case "wx_wap":
return "微信H5";
case "fastpay":
return "汇聚快捷支付";
case "wx_mp":
return "微信小程序支付";/**/
case "wx_pub":
return "微信公众号";
default:
return val
}
} else {
return '-';
}
}
},
{field: 'country', title: '地区', align: 'center', valign: 'middle'},
{field: 'localCurrencyCode', title: '本地货币代码', align: 'center', valign: 'middle'},
{field: 'localAmount', title: '本地金额', align: 'center', valign: 'middle'},
{field: 'totalGold', title: '钻石', align: 'center', valign: 'middle'},
{field: 'chargeStatus', title: '充值状态', align: 'center', valign: 'middle', width: '10%', formatter: function (val, row, inde) {
switch (val) {
case 1:
return "未完成";
case 2:
return "已支付";
}
}
},
{field: 'newUser', title: '是否新用户', align: 'center', valign: 'middle', formatter: function (val, row, inde) {
return val? "是" : "否"
}
},
{field: 'firstCharge', title: '是否首充', align: 'center', valign: 'middle', formatter: function (val, row, inde) {
return val? "是" : "否"
}
},
{field: 'createTime', title: '账单创建时间', align: 'center', valign: 'middle', width: '20%', formatter: function (val, row, index) {
if (val) {
var date = new Date(val);
return date.format("yyyy-MM-dd hh:mm:ss");
} else {
return '-';
}
}
},
],
cache: false,
striped: true,
showRefresh: false,
pageSize: 10,
pagination: true,
pageList: [10, 20, 30, 50],
sidePagination: "server", //表示服务端请求
//设置为undefined可以获取pageNumberpageSizesearchTextsortNamesortOrder
//设置为limit可以获取limit, offset, search, sort, order
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
pageSize: params.pageSize,
pageNumber: params.pageNumber,
erbanNo: $('#erbanNo').val(),
searchType: $('#searchType').val(),
startDate: $('#startDate').val(),
endDate: $('#endDate').val(),
channel: $("#channel").val(),
chargeRecordId: $('#chargeRecordId').val()
};
return param;
},
uniqueId: 'code',
toolbar: '#toolbar',
url: '/admin/chargeRecord/manual/list.action',
onLoadSuccess: function (data) { //加载成功时执行
console.log("load success");
console.log(data);
if (data.users) {
var $user = $('#userMessage');
$user.find('.avatar img').attr('src', data.users.avatar);
$user.find('.nick').html('昵称:' + data.users.nick);
$user.find('.erbanNo').html('平台号:' + data.users.erbanNo);
}
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
})
$('#btnSearch').on('click', function () {
if ((!$('#erbanNo').val() && $('#searchType').val() == "2")
|| (!$('#chargeRecordId').val() && $('#searchType').val() == "3")
|| ($('#searchType').val() == "1" && !$('#chargeRecordId').val())) {
$("#tipMsg").text("请输入必填的信息");
$("#tipModal").modal('show');
return;
}
TableHelper.doRefresh('#table');
})
var picker1 = $("#startDate").datetimepicker({
format: 'yyyy-mm-dd hh:ii:00',
autoclose: true
})
var picker2 = $('#endDate').datetimepicker({
format: 'yyyy-mm-dd hh:ii:00',
autoclose: true
})
picker1.on('changeDate', function () {
var date = $('#startDate').datetimepicker('getDate');
picker2.datetimepicker('setStartDate', date);
});
picker2.on('changeDate', function () {
var date = $('#endDate').datetimepicker('getDate');
picker1.datetimepicker('setEndDate', date);
});
$('#searchType').on('change', function () {
if ($(this).val() == '2') {
// 根据平台号
$('.erbanNo-text').show();
$('#erbanNo').show();
$('.channel-text').show();
$('#channel').show();
$('#startDate').show();
$('#endDate').show();
$('#chargeRecordId').hide();
$('.chargeRecord-text').hide();
} else {
// 根据充值记录id
$('.erbanNo-text').hide();
$('#erbanNo').hide();
$('.channel-text').hide();
$('#channel').hide();
$('#startDate').hide();
$('#endDate').hide();
$('#chargeRecordId').show();
$('.chargeRecord-text').show();
}
});
// 添加打开弹窗
$("#btnAddRecord").on('click',function(){
//清除数据
$('#addModal').find('input').val('');
$('#addModal').find('textarea').val('');
$('#addModal').modal('show');
});
// 添加
$("#btnAddModalConfirm").click(function () {
if ($("#addModalForm").validationEngine('validate')) {
$.ajax({
type: "post",
url: "/admin/chargeRecord/manual/add.action",
data: {
account: $("#modal_account").val(),
erbanNo: $("#modal_erbanNo").val(),
channel: $("#modal_channel").val(),
country: $("#modal_country").val(),
localCurrencyCode: $("#modal_local_currency_code").val(),
localAmount: $("#modal_local_amount").val(),
totalGold: $("#modal_total_gold").val(),
status: $("#modal_status").val(),
},
dataType: "json",
success: function (json) {
if (apiResult(json)) {
$("#tipMsg").text("保存成功");
$("#tipModal").modal('show');
$("#addModal").modal('hide');
TableHelper.doRefresh('#table');
} else {
$("#tipMsg").text("保存失败." + json.data.msg);
$("#tipModal").modal('show');
$("#addModal").modal('hide');
}
},
error: function (req) {
serverError(req);
}
});
}
});
function apiResult(json) {
if (json.code == 200 && json.message == 'success') {
return true;
}
$("#tipMsg").text("请求失败,错误信息:" + json.message);
$("#tipModal").modal('show');
return false;
}
</script>

View File

@@ -0,0 +1,40 @@
package com.accompany.payment.mapper;
import com.accompany.payment.model.ChargeRecord;
import com.accompany.payment.model.ChargeRecordExample;
import com.accompany.payment.model.PersonalStatisticDO;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
public interface ManualChargeRecordMapper {
int countByExample(ChargeRecordExample example);
int deleteByExample(ChargeRecordExample example);
int deleteByPrimaryKey(String chargeRecordId);
int insert(ChargeRecord record);
int insertSelective(ChargeRecord record);
List<ChargeRecord> selectByExample(ChargeRecordExample example);
ChargeRecord selectByPrimaryKey(String chargeRecordId);
int updateByExampleSelective(@Param("record") ChargeRecord record, @Param("example") ChargeRecordExample example);
int updateByExample(@Param("record") ChargeRecord record, @Param("example") ChargeRecordExample example);
int updateByPrimaryKeySelective(ChargeRecord record);
int updateByPrimaryKey(ChargeRecord record);
List<PersonalStatisticDO> personalStatistic(@Param("caomeiNum") Long caomeiNum, @Param("nick") String nick, @Param("startDate") String startDate, @Param("endDate") String endDate);
Integer getUserChargeAllAmount(@Param("uid") Long uid, @Param("chargeRecordStatus") Byte chargeRecordStatus, @Param("startTime") Date startTime, @Param("endTime") Date endTime);
ChargeRecord getChargeRecordByPingxxChargeId(String pingxxChargeId);
}

View File

@@ -0,0 +1,527 @@
<?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.accompany.payment.mapper.ManualChargeRecordMapper">
<resultMap id="BaseResultMap" type="com.accompany.payment.model.ChargeRecord">
<id column="charge_record_id" property="chargeRecordId" jdbcType="VARCHAR"/>
<result column="uid" property="uid" jdbcType="BIGINT"/>
<result column="room_uid" property="roomUid" jdbcType="BIGINT"/>
<result column="pingxx_charge_id" property="pingxxChargeId" jdbcType="VARCHAR"/>
<result column="charge_prod_id" property="chargeProdId" jdbcType="VARCHAR"/>
<result column="channel" property="channel" jdbcType="VARCHAR"/>
<result column="payment_type" property="paymentType" jdbcType="VARCHAR"/>
<result column="buss_type" property="bussType" jdbcType="TINYINT"/>
<result column="charge_status" property="chargeStatus" jdbcType="TINYINT"/>
<result column="charge_status_desc" property="chargeStatusDesc" jdbcType="VARCHAR"/>
<result column="amount" property="amount" jdbcType="BIGINT"/>
<result column="country" property="country" jdbcType="VARCHAR"/>
<result column="local_currency_code" property="localCurrencyCode" jdbcType="VARCHAR"/>
<result column="local_amount" property="localAmount" jdbcType="BIGINT"/>
<result column="total_gold" property="totalGold" jdbcType="BIGINT"/>
<result column="client_ip" property="clientIp" jdbcType="VARCHAR"/>
<result column="wx_pub_openid" property="wxPubOpenid" jdbcType="VARCHAR"/>
<result column="subject" property="subject" jdbcType="VARCHAR"/>
<result column="body" property="body" jdbcType="VARCHAR"/>
<result column="extra" property="extra" jdbcType="VARCHAR"/>
<result column="metadata" property="metadata" jdbcType="VARCHAR"/>
<result column="charge_desc" property="chargeDesc" jdbcType="VARCHAR"/>
<result column="agent_conf_id" property="agentConfId" jdbcType="VARCHAR"/>
<result column="agent_id" property="agentId" jdbcType="VARCHAR"/>
<result column="charge_app" property="chargeApp" jdbcType="VARCHAR"/>
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
</resultMap>
<resultMap id="PersonalStatisticMap" type="com.accompany.payment.model.PersonalStatisticDO">
<result column="erban_no" property="erbanNo" jdbcType="BIGINT"/>
<result column="nick" property="nick" jdbcType="VARCHAR"/>
<result column="amountSum" property="amountSum" jdbcType="BIGINT"/>
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" suffix=")" prefixOverrides="and">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach collection="criterion.value" item="listItem" open="(" close=")"
separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" suffix=")" prefixOverrides="and">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach collection="criterion.value" item="listItem" open="(" close=")"
separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
charge_record_id, uid, room_uid, pingxx_charge_id, charge_prod_id, channel, buss_type,
charge_status, charge_status_desc, amount, country, local_currency_code, local_amount, total_gold, client_ip, wx_pub_openid,
subject, body, extra, metadata, charge_desc, agent_conf_id, agent_id, charge_app, create_time, update_time
</sql>
<select id="selectByExample" resultMap="BaseResultMap"
parameterType="com.accompany.payment.model.ChargeRecordExample">
select
<if test="distinct">
distinct
</if>
'true' as QUERYID,
<include refid="Base_Column_List"/>
from manual_charge_record
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String">
select
<include refid="Base_Column_List"/>
from manual_charge_record
where charge_record_id = #{chargeRecordId,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from charge_record
where manual_charge_record_id = #{chargeRecordId,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="com.accompany.payment.model.ChargeRecordExample">
delete from charge_record
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</if>
</delete>
<insert id="insert" parameterType="com.accompany.payment.model.ChargeRecord">
insert into manual_charge_record (charge_record_id, uid, room_uid,
pingxx_charge_id, charge_prod_id, channel,
buss_type, charge_status, charge_status_desc,
amount, total_gold, client_ip,
wx_pub_openid, subject, body,
extra, metadata, charge_desc,
create_time, update_time)
values (#{chargeRecordId,jdbcType=VARCHAR}, #{uid,jdbcType=BIGINT}, #{roomUid,jdbcType=BIGINT},
#{pingxxChargeId,jdbcType=VARCHAR}, #{chargeProdId,jdbcType=VARCHAR}, #{channel,jdbcType=VARCHAR},
#{bussType,jdbcType=TINYINT}, #{chargeStatus,jdbcType=TINYINT}, #{chargeStatusDesc,jdbcType=VARCHAR},
#{amount,jdbcType=BIGINT}, #{totalGold,jdbcType=BIGINT}, #{clientIp,jdbcType=VARCHAR},
#{wxPubOpenid,jdbcType=VARCHAR}, #{subject,jdbcType=VARCHAR}, #{body,jdbcType=VARCHAR},
#{extra,jdbcType=VARCHAR}, #{metadata,jdbcType=VARCHAR}, #{chargeDesc,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.accompany.payment.model.ChargeRecord">
insert into manual_charge_record
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="chargeRecordId != null">
charge_record_id,
</if>
<if test="uid != null">
uid,
</if>
<if test="roomUid != null">
room_uid,
</if>
<if test="pingxxChargeId != null">
pingxx_charge_id,
</if>
<if test="chargeProdId != null">
charge_prod_id,
</if>
<if test="channel != null">
channel,
</if>
<if test="paymentType != null">
payment_type,
</if>
<if test="bussType != null">
buss_type,
</if>
<if test="chargeStatus != null">
charge_status,
</if>
<if test="chargeStatusDesc != null">
charge_status_desc,
</if>
<if test="amount != null">
amount,
</if>
<if test="country != null">
country,
</if>
<if test="localCurrencyCode != null">
local_currency_code,
</if>
<if test="localAmount != null">
local_amount,
</if>
<if test="totalGold != null">
total_gold,
</if>
<if test="clientIp != null">
client_ip,
</if>
<if test="clientDeviceId != null">
client_device_id,
</if>
<if test="wxPubOpenid != null">
wx_pub_openid,
</if>
<if test="subject != null">
subject,
</if>
<if test="body != null">
body,
</if>
<if test="extra != null">
extra,
</if>
<if test="metadata != null">
metadata,
</if>
<if test="chargeDesc != null">
charge_desc,
</if>
<if test="agentConfId != null">
agent_conf_id,
</if>
<if test="agentId != null">
agent_id,
</if>
<if test="chargeApp != null">
charge_app,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="chargeRecordId != null">
#{chargeRecordId,jdbcType=VARCHAR},
</if>
<if test="uid != null">
#{uid,jdbcType=BIGINT},
</if>
<if test="roomUid != null">
#{roomUid,jdbcType=BIGINT},
</if>
<if test="pingxxChargeId != null">
#{pingxxChargeId,jdbcType=VARCHAR},
</if>
<if test="chargeProdId != null">
#{chargeProdId,jdbcType=VARCHAR},
</if>
<if test="channel != null">
#{channel,jdbcType=VARCHAR},
</if>
<if test="paymentType != null">
#{paymentType,jdbcType=VARCHAR},
</if>
<if test="bussType != null">
#{bussType,jdbcType=TINYINT},
</if>
<if test="chargeStatus != null">
#{chargeStatus,jdbcType=TINYINT},
</if>
<if test="chargeStatusDesc != null">
#{chargeStatusDesc,jdbcType=VARCHAR},
</if>
<if test="amount != null">
#{amount,jdbcType=BIGINT},
</if>
<if test="country != null">
#{country,jdbcType=VARCHAR},
</if>
<if test="localCurrencyCode != null">
#{localCurrencyCode,jdbcType=VARCHAR},
</if>
<if test="localAmount != null">
#{localAmount,jdbcType=BIGINT},
</if>
<if test="totalGold != null">
#{totalGold,jdbcType=BIGINT},
</if>
<if test="clientIp != null">
#{clientIp,jdbcType=VARCHAR},
</if>
<if test="clientDeviceId != null">
#{clientDeviceId,jdbcType=VARCHAR},
</if>
<if test="wxPubOpenid != null">
#{wxPubOpenid,jdbcType=VARCHAR},
</if>
<if test="subject != null">
#{subject,jdbcType=VARCHAR},
</if>
<if test="body != null">
#{body,jdbcType=VARCHAR},
</if>
<if test="extra != null">
#{extra,jdbcType=VARCHAR},
</if>
<if test="metadata != null">
#{metadata,jdbcType=VARCHAR},
</if>
<if test="chargeDesc != null">
#{chargeDesc,jdbcType=VARCHAR},
</if>
<if test="agentConfId != null">
#{agentConfId,jdbcType=VARCHAR},
</if>
<if test="agentId != null">
#{agentId,jdbcType=VARCHAR},
</if>
<if test="chargeApp != null">
#{chargeApp,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.accompany.payment.model.ChargeRecordExample"
resultType="java.lang.Integer">
select count(*) from manual_charge_record
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update manual_charge_record
<set>
<if test="record.chargeRecordId != null">
charge_record_id = #{record.chargeRecordId,jdbcType=VARCHAR},
</if>
<if test="record.uid != null">
uid = #{record.uid,jdbcType=BIGINT},
</if>
<if test="record.roomUid != null">
room_uid = #{record.roomUid,jdbcType=BIGINT},
</if>
<if test="record.pingxxChargeId != null">
pingxx_charge_id = #{record.pingxxChargeId,jdbcType=VARCHAR},
</if>
<if test="record.chargeProdId != null">
charge_prod_id = #{record.chargeProdId,jdbcType=VARCHAR},
</if>
<if test="record.channel != null">
channel = #{record.channel,jdbcType=VARCHAR},
</if>
<if test="record.bussType != null">
buss_type = #{record.bussType,jdbcType=TINYINT},
</if>
<if test="record.chargeStatus != null">
charge_status = #{record.chargeStatus,jdbcType=TINYINT},
</if>
<if test="record.chargeStatusDesc != null">
charge_status_desc = #{record.chargeStatusDesc,jdbcType=VARCHAR},
</if>
<if test="record.amount != null">
amount = #{record.amount,jdbcType=BIGINT},
</if>
<if test="record.country != null">
country = #{record.country,jdbcType=VARCHAR},
</if>
<if test="record.localCurrencyCode != null">
local_currency_code = #{record.localCurrencyCode,jdbcType=VARCHAR},
</if>
<if test="record.localAmount != null">
local_amount = #{record.localAmount,jdbcType=BIGINT},
</if>
<if test="record.totalGold != null">
total_gold = #{record.totalGold,jdbcType=BIGINT},
</if>
<if test="record.clientIp != null">
client_ip = #{record.clientIp,jdbcType=VARCHAR},
</if>
<if test="record.wxPubOpenid != null">
wx_pub_openid = #{record.wxPubOpenid,jdbcType=VARCHAR},
</if>
<if test="record.subject != null">
subject = #{record.subject,jdbcType=VARCHAR},
</if>
<if test="record.body != null">
body = #{record.body,jdbcType=VARCHAR},
</if>
<if test="record.extra != null">
extra = #{record.extra,jdbcType=VARCHAR},
</if>
<if test="record.metadata != null">
metadata = #{record.metadata,jdbcType=VARCHAR},
</if>
<if test="record.chargeDesc != null">
charge_desc = #{record.chargeDesc,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause"/>
</if>
</update>
<update id="updateByExample" parameterType="map">
update manual_charge_record
set charge_record_id = #{record.chargeRecordId,jdbcType=VARCHAR},
uid = #{record.uid,jdbcType=BIGINT},
room_uid = #{record.roomUid,jdbcType=BIGINT},
pingxx_charge_id = #{record.pingxxChargeId,jdbcType=VARCHAR},
charge_prod_id = #{record.chargeProdId,jdbcType=VARCHAR},
channel = #{record.channel,jdbcType=VARCHAR},
buss_type = #{record.bussType,jdbcType=TINYINT},
charge_status = #{record.chargeStatus,jdbcType=TINYINT},
charge_status_desc = #{record.chargeStatusDesc,jdbcType=VARCHAR},
amount = #{record.amount,jdbcType=BIGINT},
total_gold = #{record.totalGold,jdbcType=BIGINT},
client_ip = #{record.clientIp,jdbcType=VARCHAR},
wx_pub_openid = #{record.wxPubOpenid,jdbcType=VARCHAR},
subject = #{record.subject,jdbcType=VARCHAR},
body = #{record.body,jdbcType=VARCHAR},
extra = #{record.extra,jdbcType=VARCHAR},
metadata = #{record.metadata,jdbcType=VARCHAR},
charge_desc = #{record.chargeDesc,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause"/>
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.accompany.payment.model.ChargeRecord">
update manual_charge_record
<set>
<if test="uid != null">
uid = #{uid,jdbcType=BIGINT},
</if>
<if test="roomUid != null">
room_uid = #{roomUid,jdbcType=BIGINT},
</if>
<if test="pingxxChargeId != null">
pingxx_charge_id = #{pingxxChargeId,jdbcType=VARCHAR},
</if>
<if test="chargeProdId != null">
charge_prod_id = #{chargeProdId,jdbcType=VARCHAR},
</if>
<if test="channel != null">
channel = #{channel,jdbcType=VARCHAR},
</if>
<if test="bussType != null">
buss_type = #{bussType,jdbcType=TINYINT},
</if>
<if test="chargeStatus != null">
charge_status = #{chargeStatus,jdbcType=TINYINT},
</if>
<if test="chargeStatusDesc != null">
charge_status_desc = #{chargeStatusDesc,jdbcType=VARCHAR},
</if>
<if test="amount != null">
amount = #{amount,jdbcType=BIGINT},
</if>
<if test="totalGold != null">
total_gold = #{totalGold,jdbcType=BIGINT},
</if>
<if test="clientIp != null">
client_ip = #{clientIp,jdbcType=VARCHAR},
</if>
<if test="wxPubOpenid != null">
wx_pub_openid = #{wxPubOpenid,jdbcType=VARCHAR},
</if>
<if test="subject != null">
subject = #{subject,jdbcType=VARCHAR},
</if>
<if test="body != null">
body = #{body,jdbcType=VARCHAR},
</if>
<if test="extra != null">
extra = #{extra,jdbcType=VARCHAR},
</if>
<if test="metadata != null">
metadata = #{metadata,jdbcType=VARCHAR},
</if>
<if test="chargeDesc != null">
charge_desc = #{chargeDesc,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where manual_charge_record_id = #{chargeRecordId,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.accompany.payment.model.ChargeRecord">
update manual_charge_record
set uid = #{uid,jdbcType=BIGINT},
room_uid = #{roomUid,jdbcType=BIGINT},
pingxx_charge_id = #{pingxxChargeId,jdbcType=VARCHAR},
charge_prod_id = #{chargeProdId,jdbcType=VARCHAR},
channel = #{channel,jdbcType=VARCHAR},
buss_type = #{bussType,jdbcType=TINYINT},
charge_status = #{chargeStatus,jdbcType=TINYINT},
charge_status_desc = #{chargeStatusDesc,jdbcType=VARCHAR},
amount = #{amount,jdbcType=BIGINT},
total_gold = #{totalGold,jdbcType=BIGINT},
client_ip = #{clientIp,jdbcType=VARCHAR},
wx_pub_openid = #{wxPubOpenid,jdbcType=VARCHAR},
subject = #{subject,jdbcType=VARCHAR},
body = #{body,jdbcType=VARCHAR},
extra = #{extra,jdbcType=VARCHAR},
metadata = #{metadata,jdbcType=VARCHAR},
charge_desc = #{chargeDesc,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where charge_record_id = #{chargeRecordId,jdbcType=VARCHAR}
</update>
</mapper>