|
@ -1,4 +1,4 @@ |
|
|
package com.example.fefund.mapper; |
|
|
|
|
|
|
|
|
package com.example.fefund.mapper ; |
|
|
|
|
|
|
|
|
import com.example.commons.domain.entity.Detail; |
|
|
import com.example.commons.domain.entity.Detail; |
|
|
import org.apache.ibatis.annotations.*; |
|
|
import org.apache.ibatis.annotations.*; |
|
@ -10,15 +10,23 @@ public interface RefundMapper { |
|
|
|
|
|
|
|
|
@Insert({ |
|
|
@Insert({ |
|
|
"insert into detail", |
|
|
"insert into detail", |
|
|
"(jwcord_id,refund_type,refund_goods,recharge_coin,free_coin,task_coin,remark,admin_id,creat_time)", |
|
|
|
|
|
|
|
|
"(jwcode,refund_type,refund_goods,recharge_coin,free_coin,task_coin,remark,admin_id,create_time,update_type)", |
|
|
"values", |
|
|
"values", |
|
|
"(#{jwcode},#{refundType},#{refundGoods},#{rechargeCoin},#{freeCoin},#{taskCoin},#{remark},#{adminId},now())" |
|
|
|
|
|
|
|
|
"(#{jwcode},#{refundType},#{refundGoods},#{rechargeCoin},#{freeCoin},#{taskCoin},#{remark},#{adminId},now(),#{updateType})" |
|
|
}) |
|
|
}) |
|
|
@Options(useGeneratedKeys = true, keyColumn = "detail_id", keyProperty = "detailId") |
|
|
@Options(useGeneratedKeys = true, keyColumn = "detail_id", keyProperty = "detailId") |
|
|
int insert(Detail detail); |
|
|
int insert(Detail detail); |
|
|
|
|
|
|
|
|
|
|
|
@Select({ |
|
|
|
|
|
"insert into audit", |
|
|
|
|
|
"(jwcode,refund_id,admin_id,create_time,detail_id)", |
|
|
|
|
|
"values", |
|
|
|
|
|
"(,#{jwcode},#{refundId},#{adminId},now(),#{detailId})" |
|
|
|
|
|
}) |
|
|
|
|
|
int insertAudit(Detail detail); |
|
|
|
|
|
|
|
|
@Update("update detail set detail_flag = 0 where detail_id = #{detailId}") |
|
|
@Update("update detail set detail_flag = 0 where detail_id = #{detailId}") |
|
|
int update(Integer detailId); |
|
|
|
|
|
|
|
|
int update(@Param("detailId") Integer detailId); |
|
|
|
|
|
|
|
|
@Select("select * from detail where detail_id = #{detailId} and detail_flag = 1") |
|
|
@Select("select * from detail where detail_id = #{detailId} and detail_flag = 1") |
|
|
Detail selectByDetailId(Integer detailId); |
|
|
Detail selectByDetailId(Integer detailId); |
|
@ -26,20 +34,28 @@ public interface RefundMapper { |
|
|
|
|
|
|
|
|
@Select({ |
|
|
@Select({ |
|
|
"<script>", |
|
|
"<script>", |
|
|
"SELECT d.*, a.area AS adminArea", |
|
|
|
|
|
|
|
|
"SELECT d.*,", |
|
|
|
|
|
" a.area AS adminArea, a.name AS adminName,", |
|
|
|
|
|
" u.name AS userName,", |
|
|
|
|
|
" au.status AS auditStatus, au.reson AS auditReson", |
|
|
"FROM detail d", |
|
|
"FROM detail d", |
|
|
"LEFT JOIN admin a ON d.admin_id = a.admin_id", |
|
|
"LEFT JOIN admin a ON d.admin_id = a.admin_id", |
|
|
"WHERE d.detail_flag = 1", |
|
|
|
|
|
"<where>", |
|
|
|
|
|
|
|
|
"LEFT JOIN user u ON d.jwcode = u.jwcode", |
|
|
|
|
|
"LEFT JOIN audit au ON d.detail_id = au.refund_id", |
|
|
|
|
|
"WHERE d.detail_flag = 1 and update_type ='退款'", |
|
|
"<if test='jwcode != null'>AND d.jwcode = #{jwcode}</if>", |
|
|
"<if test='jwcode != null'>AND d.jwcode = #{jwcode}</if>", |
|
|
"<if test='refundType != null'>AND d.refund_type LIKE CONCAT('%', #{refundType}, '%')</if>", |
|
|
"<if test='refundType != null'>AND d.refund_type LIKE CONCAT('%', #{refundType}, '%')</if>", |
|
|
"<if test='refundGoods != null'>AND d.refund_goods = #{refundGoods}</if>", |
|
|
|
|
|
|
|
|
"<if test='refundGoods != null'>AND d.refund_goods LIKE CONCAT('%', #{refundGoods}, '%')</if>", |
|
|
"<if test='rechargeCoin != null'>AND d.recharge_coin = #{rechargeCoin}</if>", |
|
|
"<if test='rechargeCoin != null'>AND d.recharge_coin = #{rechargeCoin}</if>", |
|
|
"<if test='freeCoin != null'>AND d.free_coin = #{freeCoin}</if>", |
|
|
"<if test='freeCoin != null'>AND d.free_coin = #{freeCoin}</if>", |
|
|
"<if test='taskCoin != null'>AND d.task_coin = #{taskCoin}</if>", |
|
|
"<if test='taskCoin != null'>AND d.task_coin = #{taskCoin}</if>", |
|
|
"<if test='remark != null'>AND d.remark LIKE CONCAT('%', #{remark}, '%')</if>", |
|
|
"<if test='remark != null'>AND d.remark LIKE CONCAT('%', #{remark}, '%')</if>", |
|
|
"<if test='adminId != null'>AND d.admin_id = #{adminId}</if>", |
|
|
"<if test='adminId != null'>AND d.admin_id = #{adminId}</if>", |
|
|
"</where>", |
|
|
|
|
|
|
|
|
"<if test='adminArea != null'>AND a.area LIKE CONCAT('%', #{adminArea}, '%')</if>", // admin表字段过滤 |
|
|
|
|
|
"<if test='adminName != null'>AND a.name LIKE CONCAT('%', #{adminName}, '%')</if>", // admin表字段过滤 |
|
|
|
|
|
"<if test='userName != null'>AND u.name LIKE CONCAT('%', #{userName}, '%')</if>", // user表字段过滤 |
|
|
|
|
|
"<if test='auditStatus != null'>AND au.status = #{auditStatus}</if>", // audit 表字段过滤 |
|
|
|
|
|
"<if test='auditReson != null'>AND au.reson LIKE CONCAT('%', #{auditReson}, '%')</if>", // audit表字段过滤 |
|
|
"</script>" |
|
|
"</script>" |
|
|
}) |
|
|
}) |
|
|
List<Detail> select(Detail detail); |
|
|
List<Detail> select(Detail detail); |
|
|