platformx-device-biz/src/main/resources/mapper/DeviceLeasingLedgerItemMapper.xml
@@ -19,4 +19,20 @@ <result property="updateTime" column="update_time"/> <result property="delFlag" column="del_flag"/> </resultMap> <select id="selectDeviceNumByContractId" resultType="java.lang.Integer"> select ifnull(sum(dlli.num),0) from device_leasing_ledger_item dlli where dlli.device_id = #{deviceId} and exists ( select * from device_leasing_ledger dll where dll.contract_id = #{contractId} and dll.id = dlli.ledger_id ) </select> </mapper>