Browse Source

7.15筛选非测试数据

huangqizheng/feature-20250715100115-非测试数据筛选
huangqizhen 1 month ago
parent
commit
507f7090a4
  1. 7
      src/main/java/com/example/demo/Mysql/MysqlServiceImpl.java
  2. 4
      src/main/resources/mapper/GoldDetailMapper.xml

7
src/main/java/com/example/demo/Mysql/MysqlServiceImpl.java

@ -77,7 +77,7 @@ public class MysqlServiceImpl implements MysqlService {
//退款类型 61ERP退款退金币 //退款类型 61ERP退款退金币
String insertSql = "INSERT INTO user_gold_record (order_code,jwcode,sum_gold,permanent_gold,free_june,free_december," + String insertSql = "INSERT INTO user_gold_record (order_code,jwcode,sum_gold,permanent_gold,free_june,free_december," +
"task_gold,pay_platform,goods_name,refund_type,refund_model,remark,type,admin_id," + "task_gold,pay_platform,goods_name,refund_type,refund_model,remark,type,admin_id," +
"audit_status,create_time) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) ";
"audit_status,create_time,flag) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) ";
try (PreparedStatement mysqlStmt = mysqlConn.prepareStatement(insertSql)) { try (PreparedStatement mysqlStmt = mysqlConn.prepareStatement(insertSql)) {
while (resultSet.next()) { while (resultSet.next()) {
int gtype = resultSet.getInt("gtype"); int gtype = resultSet.getInt("gtype");
@ -159,6 +159,11 @@ public class MysqlServiceImpl implements MysqlService {
mysqlStmt.setString(12, remark); mysqlStmt.setString(12, remark);
mysqlStmt.setInt(15, 3); mysqlStmt.setInt(15, 3);
mysqlStmt.setTimestamp(16, created_at); mysqlStmt.setTimestamp(16, created_at);
if(remark.contains("测试")){
mysqlStmt.setInt(17, 0);
}else {
mysqlStmt.setInt(17, 1);
}
// 更新时的值 // 更新时的值
mysqlStmt.addBatch(); mysqlStmt.addBatch();

4
src/main/resources/mapper/GoldDetailMapper.xml

@ -13,6 +13,7 @@
left join `user` on `user`.jwcode = `ugr`.jwcode left join `user` on `user`.jwcode = `ugr`.jwcode
left join `admin` on `admin`.id = `ugr`.admin_id left join `admin` on `admin`.id = `ugr`.admin_id
<where> <where>
ugr.flag = 1 and
ugr.audit_status IN (1,3) ugr.audit_status IN (1,3)
<if test="jwcode != null"> <if test="jwcode != null">
and ugr.jwcode = #{jwcode} and ugr.jwcode = #{jwcode}
@ -44,6 +45,8 @@
select sum(sum_gold) as Goldtotal, sum(permanent_gold) as permanentGold, sum(free_june+free_december) as freeGold, sum(task_gold) as taskGold select sum(sum_gold) as Goldtotal, sum(permanent_gold) as permanentGold, sum(free_june+free_december) as freeGold, sum(task_gold) as taskGold
from user_gold_record from user_gold_record
<where> <where>
ugr.flag = 1 and
ugr.audit_status IN (1,3)
<if test="jwcode != null"> <if test="jwcode != null">
and `ugr`.jwcode = #{jwcode} and `ugr`.jwcode = #{jwcode}
</if> </if>
@ -103,6 +106,7 @@
left join `user` on `user`.jwcode = `ugr`.jwcode left join `user` on `user`.jwcode = `ugr`.jwcode
left join `admin` on `admin`.id = `ugr`.admin_id left join `admin` on `admin`.id = `ugr`.admin_id
<where> <where>
ugr.flag = 1
<if test="jwcode != null"> <if test="jwcode != null">
and `ugr`.jwcode = #{jwcode} and `ugr`.jwcode = #{jwcode}
</if> </if>

Loading…
Cancel
Save