|
@@ -16,14 +16,17 @@
|
|
|
package me.zhengjie.modules.dm.order.repository;
|
|
|
|
|
|
import me.zhengjie.modules.dm.order.domain.DmOrderRecord;
|
|
|
-import me.zhengjie.modules.dm.service.domain.DmServicePj;
|
|
|
-import org.springframework.data.domain.Page;
|
|
|
-import org.springframework.data.domain.Pageable;
|
|
|
+import me.zhengjie.modules.dm.order.service.dto.DmExpenseCalendar;
|
|
|
import org.springframework.data.jpa.repository.JpaRepository;
|
|
|
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
|
|
+import org.springframework.data.jpa.repository.Modifying;
|
|
|
import org.springframework.data.jpa.repository.Query;
|
|
|
import org.springframework.data.repository.query.Param;
|
|
|
|
|
|
+import java.sql.Timestamp;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
|
|
|
* @website https:
|
|
|
* @author sunmz
|
|
@@ -52,4 +55,27 @@ public interface DmOrderRecordRepository extends JpaRepository<DmOrderRecord, Lo
|
|
|
" SELECT DISTINCT mob FROM dm_order_record WHERE create_date BETWEEN DATE_FORMAT(DATE_SUB(CURDATE(),INTERVAL 1 DAY),'%Y-%m-%d 00:00:00') AND DATE_FORMAT(DATE_SUB(CURDATE(),INTERVAL 1 DAY),'%Y-%m-%d 23:59:59') " +
|
|
|
" ) a ",nativeQuery = true)
|
|
|
Integer countConsumerNumber();
|
|
|
+
|
|
|
+ @Query(value = "SELECT a.`id`, a.`bh`, a.`money`, a.`mob`, a.`user_code`, a.`user_name`, a.`dept_id`, " +
|
|
|
+ "a.`user_type`, a.`phone`, a.`create_date`, a.`total_money`, a.`zk_money`, a.`seq`, a.`card`, " +
|
|
|
+ "a.`card_no`, a.`part`, a.`term`, a.`shop`, a.`term_name`, a.`shop_name`, a.`amt`, a.`balance`, " +
|
|
|
+ "a.`account`, a.`type`,b.id as orderItemId,b.bh as orderItemBh,b.pid ," +
|
|
|
+ "b.code ,b.name ,b.price,b.num ," +
|
|
|
+ "b.money as orderItemMoney,b.seq as orderItemSeq,b.amt as orderItemAmt,b.pj_type as pjType " +
|
|
|
+ "FROM dm_order_record a LEFT JOIN dm_order_item b ON a.bh=b.bh " +
|
|
|
+ "WHERE date_format(create_date,'%Y-%m-%d') = date_format(now(),'%Y-%m-%d') ",nativeQuery = true)
|
|
|
+ List<Map<String,Object>> selectOrderRecord();
|
|
|
+
|
|
|
+ @Modifying
|
|
|
+ @Query(value = "INSERT INTO `dm_order_record`(`bh`, `money`, `mob`, `user_code`, `user_name`, `dept_id`, `user_type`, `phone`, `create_date`, " +
|
|
|
+ "`total_money`, `zk_money`, `seq`, `card`, `card_no`, `part`, `term`, `shop`, `term_name`, `shop_name`, `amt`, `balance`, `account`, `type`) " +
|
|
|
+ "VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11, ?12, ?13, ?14, ?15, ?16, ?17, ?18, ?19, ?20, ?21, ?22, ?23) ",nativeQuery = true)
|
|
|
+ void insertOrderRecord(String bh, String money, String mob, String userCode, String userName, Long deptId, String userType, String phone, Timestamp createDate, String totalMoney, String zkMoney, Long seq, String card, String cardNo, Integer part, Integer term, Integer shop, String termName, String shopName, Double amt, Double balance, Integer account, Integer type);
|
|
|
+
|
|
|
+ @Modifying
|
|
|
+ @Query(value = "INSERT INTO `dm_order_item`(`bh`, `pid`, `code`, `name`, `price`, `num`, `money`, `seq`, `amt`, `pj_type`) " +
|
|
|
+ "VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10) ",nativeQuery = true)
|
|
|
+ void insertDmOrderItem(String bh,Long pid,String code,String name,String price,Integer num,String money,Long seq,Double amt,String pjType);
|
|
|
+
|
|
|
+
|
|
|
}
|