|
|
@ -11,9 +11,9 @@ public interface RefundMapper { |
|
|
|
|
|
|
|
@Insert({ |
|
|
|
"insert into detail", |
|
|
|
"(jwcode,order_code,refund_type,refund_goods,contact_id,recharge_coin,free_coin,task_coin,remark,admin_id,create_time,update_type)", |
|
|
|
"(jwcode,refund_type,refund_goods,contact_id,recharge_coin,free_coin,task_coin,remark,admin_id,create_time,update_type,order_code)", |
|
|
|
"values", |
|
|
|
"(#{jwcode},#{orderCode},#{refundType},#{refundGoods},#{contactId},#{rechargeCoin},#{freeCoin},#{taskCoin},#{remark},#{adminId},now(),'退款')" |
|
|
|
"(#{jwcode},#{refundType},#{refundGoods},#{contactId},#{rechargeCoin},#{freeCoin},#{taskCoin},#{remark},#{adminId},now(),'退款',#{orderCode})" |
|
|
|
}) |
|
|
|
@Options(useGeneratedKeys = true, keyColumn = "detail_id", keyProperty = "detailId") |
|
|
|
int insert(Detail detail); |
|
|
@ -30,9 +30,29 @@ public interface RefundMapper { |
|
|
|
@Select("SELECT EXISTS (SELECT 1 FROM detail WHERE contact_id = #{contactId})") |
|
|
|
boolean existsByContactId(@Param("contactId") Integer contactId); |
|
|
|
|
|
|
|
//根据订单号查询 |
|
|
|
// @Select("select d.* " + |
|
|
|
// " p.name AS productName" + |
|
|
|
// "FROM detail where order_code = #{orderCode} and detail_flag = 1" + |
|
|
|
// "LEFT JOIN product p ON d.product_id = p.id" ) |
|
|
|
// Detail selectByOrderCode(@Param("orderCode") String orderCode); |
|
|
|
|
|
|
|
|
|
|
|
//根据订单号查询 |
|
|
|
@Select("SELECT d.*, p.name AS productName " + |
|
|
|
"FROM detail d " + |
|
|
|
"LEFT JOIN product p ON d.product_id = p.product_id " + |
|
|
|
"WHERE d.order_code = #{orderCode} AND d.detail_flag = 1 AND d.refund_flag = 1") |
|
|
|
Detail selectByOrderCode(@Param("orderCode") String orderCode); |
|
|
|
|
|
|
|
//软删除 |
|
|
|
@Update("update detail set detail_flag = 0 where detail_id = #{detailId}") |
|
|
|
int update(@Param("detailId") Integer detailId); |
|
|
|
|
|
|
|
//是否退款 |
|
|
|
@Update("update detail set refund_flag = 0 where detail_id = #{contactId}") |
|
|
|
int updateOrderCode(Integer contactId); |
|
|
|
|
|
|
|
@Select("select * from detail where detail_id = #{detailId} and detail_flag = 1") |
|
|
|
Detail selectByDetailId(Integer detailId); |
|
|
|
|
|
|
|