|
@@ -4,6 +4,7 @@ import java.util.List;
|
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
+import com.fs.hisStore.vo.FsStorePaymentAmountVO;
|
|
|
import com.fs.hisStore.vo.FsStorePaymentUsetVo;
|
|
import com.fs.hisStore.vo.FsStorePaymentUsetVo;
|
|
|
import com.fs.hisStore.domain.FsStorePaymentScrm;
|
|
import com.fs.hisStore.domain.FsStorePaymentScrm;
|
|
|
import com.fs.hisStore.param.FsStorePaymentParam;
|
|
import com.fs.hisStore.param.FsStorePaymentParam;
|
|
@@ -74,7 +75,15 @@ public interface FsStorePaymentScrmMapper
|
|
|
FsStorePaymentScrm selectFsStorePaymentByCode(String payCode);
|
|
FsStorePaymentScrm selectFsStorePaymentByCode(String payCode);
|
|
|
|
|
|
|
|
@Select({"<script> " +
|
|
@Select({"<script> " +
|
|
|
- "select p.*,o.order_code,c.company_name,d.dept_name,u.phone as user_phone,cu.nick_name as company_user_nick_name,cu.user_name as company_user_name from fs_store_payment_scrm p left join company_user cu on p.company_user_id=cu.user_id left join fs_user u on u.user_id=p.user_id left join company_dept d on d.dept_id=p.dept_id left join company c on c.company_id=p.company_id left join fs_store_order_scrm o on o.id=p.order_id " +
|
|
|
|
|
|
|
+ "select p.*,o.order_code,c.company_name,d.dept_name,u.phone as user_phone," +
|
|
|
|
|
+ "cu.nick_name as company_user_nick_name,cu.user_name as company_user_name ,csc.name miniProgramName " +
|
|
|
|
|
+ "from fs_store_payment_scrm p " +
|
|
|
|
|
+ "left join company_user cu on p.company_user_id=cu.user_id " +
|
|
|
|
|
+ "left join fs_user u on u.user_id=p.user_id " +
|
|
|
|
|
+ "left join company_dept d on d.dept_id=p.dept_id " +
|
|
|
|
|
+ "left join company c on c.company_id=p.company_id " +
|
|
|
|
|
+ "left join fs_store_order_scrm o on o.id=p.order_id " +
|
|
|
|
|
+ "LEFT JOIN fs_course_play_source_config csc ON csc.appid = p.app_id " +
|
|
|
"where 1=1 " +
|
|
"where 1=1 " +
|
|
|
"<if test = 'maps.payCode != null and maps.payCode !=\"\" '> " +
|
|
"<if test = 'maps.payCode != null and maps.payCode !=\"\" '> " +
|
|
|
"and p.pay_code like CONCAT('%',#{maps.payCode},'%') " +
|
|
"and p.pay_code like CONCAT('%',#{maps.payCode},'%') " +
|
|
@@ -100,14 +109,13 @@ public interface FsStorePaymentScrmMapper
|
|
|
"<if test = 'maps.companyId != null '> " +
|
|
"<if test = 'maps.companyId != null '> " +
|
|
|
"and p.company_id =#{maps.companyId} " +
|
|
"and p.company_id =#{maps.companyId} " +
|
|
|
"</if>" +
|
|
"</if>" +
|
|
|
-// "<if test = 'maps.createTime != null '> " +
|
|
|
|
|
-// "and DATE_FORMAT(p.create_time,'%Y-%m-%d') = DATE_FORMAT(#{maps.createTime},'%Y-%m-%d') " +
|
|
|
|
|
-// "</if>" +
|
|
|
|
|
- "<if test = 'maps.beginTime != null and maps.beginTime != \"\" '> " +
|
|
|
|
|
- " AND date_format(p.pay_time,'%y%m%d') >= date_format(#{maps.beginTime},'%y%m%d') " +
|
|
|
|
|
|
|
+ "<if test = 'maps.params != null and maps.params != \"\" '> " +
|
|
|
|
|
+ "<if test = 'maps.params.beginTime != null and maps.params.beginTime != \"\" '> " +
|
|
|
|
|
+ " AND date_format(p.pay_time,'%y%m%d') >= date_format(#{maps.params.beginTime},'%y%m%d') " +
|
|
|
|
|
+ "</if>" +
|
|
|
|
|
+ "<if test = 'maps.params.endTime != null and maps.params.endTime != \"\" '> " +
|
|
|
|
|
+ " AND date_format(p.pay_time,'%y%m%d') <= date_format(#{maps.params.endTime},'%y%m%d') " +
|
|
|
"</if>" +
|
|
"</if>" +
|
|
|
- "<if test = 'maps.endTime != null and maps.endTime != \"\" '> " +
|
|
|
|
|
- " AND date_format(p.pay_time,'%y%m%d') <= date_format(#{maps.endTime},'%y%m%d') " +
|
|
|
|
|
"</if>" +
|
|
"</if>" +
|
|
|
|
|
|
|
|
"<if test = 'maps.refundBeginTime != null and maps.refundBeginTime != \"\" '> " +
|
|
"<if test = 'maps.refundBeginTime != null and maps.refundBeginTime != \"\" '> " +
|
|
@@ -122,10 +130,6 @@ public interface FsStorePaymentScrmMapper
|
|
|
"and p.bank_transaction_id like CONCAT('%',#{maps.bankTransactionId},'%') " +
|
|
"and p.bank_transaction_id like CONCAT('%',#{maps.bankTransactionId},'%') " +
|
|
|
"</if>" +
|
|
"</if>" +
|
|
|
|
|
|
|
|
- "<if test = 'maps.isShipment != null'> " +
|
|
|
|
|
- "and p.is_shipment = #{maps.isShipment}" +
|
|
|
|
|
- "</if>" +
|
|
|
|
|
-
|
|
|
|
|
"<if test = 'maps.companyUserNickName != null and maps.companyUserNickName !=\"\" '> " +
|
|
"<if test = 'maps.companyUserNickName != null and maps.companyUserNickName !=\"\" '> " +
|
|
|
"and cu.nick_name like CONCAT('%',#{maps.companyUserNickName},'%') " +
|
|
"and cu.nick_name like CONCAT('%',#{maps.companyUserNickName},'%') " +
|
|
|
"</if>" +
|
|
"</if>" +
|
|
@@ -133,11 +137,7 @@ public interface FsStorePaymentScrmMapper
|
|
|
" AND date_format(p.create_time,'%y%m%d') >= date_format(#{maps.createTimeList[0]},'%y%m%d') " +
|
|
" AND date_format(p.create_time,'%y%m%d') >= date_format(#{maps.createTimeList[0]},'%y%m%d') " +
|
|
|
" AND date_format(p.create_time,'%y%m%d') <= date_format(#{maps.createTimeList[1]},'%y%m%d') " +
|
|
" AND date_format(p.create_time,'%y%m%d') <= date_format(#{maps.createTimeList[1]},'%y%m%d') " +
|
|
|
"</if>" +
|
|
"</if>" +
|
|
|
-
|
|
|
|
|
-// "<if test = 'maps.refundTime != null '> " +
|
|
|
|
|
-// "and DATE_FORMAT(p.refund_time,'%Y-%m-%d') = DATE_FORMAT(#{maps.refundTime},'%Y-%m-%d') " +
|
|
|
|
|
-// "</if>" +
|
|
|
|
|
-
|
|
|
|
|
|
|
+ "<if test=\"maps.appId != null and maps.appId != ''\"> and p.app_id like #{maps.appId}</if>\n" +
|
|
|
" order by p.payment_id desc "+
|
|
" order by p.payment_id desc "+
|
|
|
"</script>"})
|
|
"</script>"})
|
|
|
List<FsStorePaymentVO> selectFsStorePaymentListQuery(@Param("maps") FsStorePaymentParam fsStorePayment);
|
|
List<FsStorePaymentVO> selectFsStorePaymentListQuery(@Param("maps") FsStorePaymentParam fsStorePayment);
|
|
@@ -370,4 +370,62 @@ public interface FsStorePaymentScrmMapper
|
|
|
* 批量更新发货状态
|
|
* 批量更新发货状态
|
|
|
* **/
|
|
* **/
|
|
|
void batchUpadte(@Param("list") List<String> list);
|
|
void batchUpadte(@Param("list") List<String> list);
|
|
|
|
|
+
|
|
|
|
|
+ @Select({"<script> " +
|
|
|
|
|
+ "select SUM(CASE WHEN p.status IN (1, -1) AND p.pay_money IS NOT NULL THEN p.pay_money ELSE 0 END) AS totalPaymentAmount, SUM(CASE WHEN p.status = '-1' AND refund_money IS NOT NULL THEN p.refund_money ELSE 0 END) AS totalRefundAmount from fs_store_payment_scrm p left join company_user cu on p.company_user_id=cu.user_id left join fs_user u on u.user_id=p.user_id left join company_dept d on d.dept_id=p.dept_id left join company c on c.company_id=p.company_id left join fs_store_order_scrm o on o.id=p.order_id " +
|
|
|
|
|
+ "where 1=1 " +
|
|
|
|
|
+ "<if test = 'maps.payCode != null and maps.payCode !=\"\" '> " +
|
|
|
|
|
+ "and p.pay_code like CONCAT('%',#{maps.payCode},'%') " +
|
|
|
|
|
+ "</if>" +
|
|
|
|
|
+ "<if test = 'maps.orderCode != null and maps.orderCode !=\"\" '> " +
|
|
|
|
|
+ "and o.order_code like CONCAT('%',#{maps.orderCode},'%') " +
|
|
|
|
|
+ "</if>" +
|
|
|
|
|
+ "<if test = 'maps.tradeNo != null and maps.tradeNo !=\"\" '> " +
|
|
|
|
|
+ "and p.trade_no like CONCAT('%',#{maps.tradeNo},'%') " +
|
|
|
|
|
+ "</if>" +
|
|
|
|
|
+ "<if test = 'maps.bankSerialNo != null and maps.bankSerialNo !=\"\" '> " +
|
|
|
|
|
+ "and p.bank_serial_no like CONCAT('%',#{maps.bankSerialNo},'%') " +
|
|
|
|
|
+ "</if>" +
|
|
|
|
|
+ "<if test = 'maps.mobile != null and maps.mobile !=\"\" '> " +
|
|
|
|
|
+ "and u.phone like CONCAT('%',#{maps.mobile},'%') " +
|
|
|
|
|
+ "</if>" +
|
|
|
|
|
+ "<if test = 'maps.status != null '> " +
|
|
|
|
|
+ "and p.status =#{maps.status} " +
|
|
|
|
|
+ "</if>" +
|
|
|
|
|
+ "<if test = 'maps.businessType != null '> " +
|
|
|
|
|
+ "and p.business_type =#{maps.businessType} " +
|
|
|
|
|
+ "</if>" +
|
|
|
|
|
+ "<if test = 'maps.companyId != null '> " +
|
|
|
|
|
+ "and p.company_id =#{maps.companyId} " +
|
|
|
|
|
+ "</if>" +
|
|
|
|
|
+ "<if test = 'maps.appId != null and maps.appId !=\"\" '> " +
|
|
|
|
|
+ "and p.app_id =#{maps.appId} " +
|
|
|
|
|
+ "</if>" +
|
|
|
|
|
+ "<if test = 'maps.params != null and maps.params != \"\" '> " +
|
|
|
|
|
+ "<if test = 'maps.params.beginTime != null and maps.params.beginTime != \"\" '> " +
|
|
|
|
|
+ " AND date_format(p.pay_time,'%y%m%d') >= date_format(#{maps.params.beginTime},'%y%m%d') " +
|
|
|
|
|
+ "</if>" +
|
|
|
|
|
+ "<if test = 'maps.params.endTime != null and maps.params.endTime != \"\" '> " +
|
|
|
|
|
+ " AND date_format(p.pay_time,'%y%m%d') <= date_format(#{maps.params.endTime},'%y%m%d') " +
|
|
|
|
|
+ "</if>" +
|
|
|
|
|
+ "</if>" +
|
|
|
|
|
+ "<if test = 'maps.refundBeginTime != null and maps.refundBeginTime != \"\" '> " +
|
|
|
|
|
+ "and DATE_FORMAT(p.refund_time,'%y%m%d') >= date_format(#{maps.refundBeginTime},'%y%m%d') " +
|
|
|
|
|
+ "</if>" +
|
|
|
|
|
+ "<if test = 'maps.refundEndTime != null and maps.refundEndTime != \"\" '> " +
|
|
|
|
|
+ " AND date_format(p.refund_time,'%y%m%d') <= date_format(#{maps.refundEndTime},'%y%m%d') " +
|
|
|
|
|
+ "</if>" +
|
|
|
|
|
+ "<if test = 'maps.bankTransactionId != null and maps.bankTransactionId !=\"\" '> " +
|
|
|
|
|
+ "and p.bank_transaction_id like CONCAT('%',#{maps.bankTransactionId},'%') " +
|
|
|
|
|
+ "</if>" +
|
|
|
|
|
+ "<if test = 'maps.companyUserNickName != null and maps.companyUserNickName !=\"\" '> " +
|
|
|
|
|
+ "and cu.nick_name like CONCAT('%',#{maps.companyUserNickName},'%') " +
|
|
|
|
|
+ "</if>" +
|
|
|
|
|
+ "<if test = 'maps.createTimeList != null '> " +
|
|
|
|
|
+ " AND date_format(p.create_time,'%y%m%d') >= date_format(#{maps.createTimeList[0]},'%y%m%d') " +
|
|
|
|
|
+ " AND date_format(p.create_time,'%y%m%d') <= date_format(#{maps.createTimeList[1]},'%y%m%d') " +
|
|
|
|
|
+ "</if>" +
|
|
|
|
|
+ " order by p.payment_id desc "+
|
|
|
|
|
+ "</script>"})
|
|
|
|
|
+ FsStorePaymentAmountVO calculateTotalAmount(@Param("maps") FsStorePaymentParam fsStorePayment);
|
|
|
}
|
|
}
|