int count =hrDeliverEmployContractService.selectCount(new EntityWrapper<HrDeliverEmployContractEntity>()
.eq("pool_id",hrDeliverEmployContract.getPoolId()).andNew().lt("contract_start_date",hrDeliverEmployContract.getContractStartDate()).or().gt("contract_end_date",hrDeliverEmployContract.getContractEndDate()) );
对应的SQL
SELECT COUNT(1)
FROM hr_deliver_employ_contract
WHERE (pool_id = 1) AND (contract_start_date < '2018-07-01 00:00:00.0' OR contract_end_date > '2018-10-31 00:00:00.0');
mybatis plus or使用
1 2 3 |
|
对应SQL
|