@Query(value="select * from contract_money where ds >= ?1 and ds <= ?2 and contract_code = ?3 and del_flag is not true order by ds desc",nativeQuery=true)
@Query(value="select * from contract_money where ds >= ?1 and ds <= ?2 and contract_code = ?3 and del_flag is not true order by ds desc",nativeQuery=true)
// @Query(value = "select a.id,b.customer_body company,a.contract_code,u.name create_name,a.create_account,a.create_time,a.ds,a.email,a.modify_account,a.modify_time,a.money,a.platform,a.type,a.user,a.del_flag,b.sale salse,b.price_level from contract_money a left join contract b on a.contract_code = b.contract_code left join user u on a.create_account = u.id where a.ds >= ?1 and a.ds <= ?2 and a.platform = ?3 order by a.ds desc",nativeQuery = true)
@@ -36,18 +36,21 @@ public interface ContractMoneyRepository extends JpaRepository<ContractMoney, Lo
// @Query(value = "select a.id,b.customer_body company,a.contract_code,u.name create_name,a.create_account,a.create_time,a.ds,a.email,a.modify_account,a.modify_time,a.money,a.platform,a.type,a.user,a.del_flag,b.sale salse,b.price_level from contract_money a left join contract b on a.contract_code = b.contract_code left join user u on a.create_account = u.id where a.ds >= ?1 and a.ds <= ?2 and a.platform = ?3 and b.price_level = ?4 order by a.ds desc",nativeQuery = true)
@Query(value="select a.id,a.company,a.contract_code,a.create_account,a.create_time,a.ds,a.email,a.modify_account,a.modify_time,a.money,a.platform,a.type,a.user,a.del_flag,a.salse,a.price_level,u.name create_name from contract_money a left join user u on a.create_account = u.id where a.ds >= ?1 and a.ds <= ?2 and a.platform = ?3 and a.del_flag is false order by a.ds desc",nativeQuery=true)
@Query(value="select a.id,a.company,a.contract_code,a.create_account,a.create_time,a.ds,a.email,a.modify_account,a.modify_time,a.money,a.platform,a.type,a.user,a.del_flag,a.salse,a.price_level,u.name create_name from contract_money a left join user u on a.create_account = u.id where a.ds >= ?1 and a.ds <= ?2 and a.platform = ?3 and a.del_flag is false order by a.ds desc",nativeQuery=true)
@Query(value="select a.id,a.company,a.contract_code,a.create_account,a.create_time,a.ds,a.email,a.modify_account,a.modify_time,a.money,a.platform,a.type,a.user,a.del_flag,a.salse,a.price_level,u.name create_name from contract_money a left join user u on a.create_account = u.id where a.ds >= ?1 and a.ds <= ?2 and a.platform = ?3 and a.type = ?4 and a.price_level = ?5 and a.del_flag is false order by a.ds desc",nativeQuery=true)
@Query(value="select a.id,a.company,a.contract_code,a.create_account,a.create_time,a.ds,a.email,a.modify_account,a.modify_time,a.money,a.platform,a.type,a.user,a.del_flag,a.salse,a.price_level,u.name create_name from contract_money a left join user u on a.create_account = u.id where a.ds >= ?1 and a.ds <= ?2 and a.platform = ?3 and a.type = ?4 and a.price_level = ?5 and a.del_flag is false order by a.ds desc",nativeQuery=true)
@Query(value="select a.id,a.company,a.contract_code,a.create_account,a.create_time,a.ds,a.email,a.modify_account,a.modify_time,a.money,a.platform,a.type,a.user,a.del_flag,a.salse,a.price_level,u.name create_name from contract_money a left join user u on a.create_account = u.id where a.ds >= ?1 and a.ds <= ?2 and a.platform = ?3 and a.type = ?4 and a.del_flag is false order by a.ds desc",nativeQuery=true)
@Query(value="select a.id,a.company,a.contract_code,a.create_account,a.create_time,a.ds,a.email,a.modify_account,a.modify_time,a.money,a.platform,a.type,a.user,a.del_flag,a.salse,a.price_level,u.name create_name from contract_money a left join user u on a.create_account = u.id where a.ds >= ?1 and a.ds <= ?2 and a.platform = ?3 and a.type = ?4 and a.del_flag is false order by a.ds desc",nativeQuery=true)
@Query(value="select a.id,a.company,a.contract_code,a.create_account,a.create_time,a.ds,a.email,a.modify_account,a.modify_time,a.money,a.platform,a.type,a.user,a.del_flag,a.salse,a.price_level,u.name create_name from contract_money a left join user u on a.create_account = u.id where a.ds >= ?1 and a.ds <= ?2 and a.platform = ?3 and a.price_level = ?4 and a.del_flag is false order by a.ds desc",nativeQuery=true)
@Query(value="select a.id,a.company,a.contract_code,a.create_account,a.create_time,a.ds,a.email,a.modify_account,a.modify_time,a.money,a.platform,a.type,a.user,a.del_flag,a.salse,a.price_level,u.name create_name from contract_money a left join user u on a.create_account = u.id where a.ds >= ?1 and a.ds <= ?2 and a.platform = ?3 and a.price_level = ?4 and a.del_flag is false order by a.ds desc",nativeQuery=true)
@Query(value="select a.id,a.company,a.contract_code,a.create_account,a.create_time,a.ds,a.email,a.modify_account,a.modify_time,a.money,a.platform,a.type,a.user,a.del_flag,a.salse,a.price_level,u.name create_name from contract_money a left join user u on a.create_account = u.id where a.ds >= ?1 and a.ds <= ?2 and a.platform = ?3 and a.id in ?4 and a.del_flag is false order by a.ds desc",nativeQuery=true)
@Query(value="select a.id,a.company,a.contract_code,a.create_account,a.create_time,a.ds,a.email,a.modify_account,a.modify_time,a.money,a.platform,a.type,a.user,a.del_flag,a.salse,a.price_level,u.name create_name from contract_money a left join user u on a.create_account = u.id where a.ds >= ?1 and a.ds <= ?2 and a.platform = ?3 and a.id in ?4 and a.del_flag is false order by a.ds desc",nativeQuery=true)
@Query(value="select contract_code, sum(case when type = 'pay' then money else 0 end) as pay_money,sum(case when type = 'invoice' then money else 0 end) as invoice_money from contract_money where contract_code in ?2 and platform = ?1 and del_flag is false group by contract_code",nativeQuery=true)