|
|
|
@@ -97,46 +97,46 @@ |
|
|
|
order by rc.id desc |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="queryRentContractWaitSignStatus" resultType="int" parameterType="com.iformall.domain.po.WxRentContract"> |
|
|
|
<select id="queryRentContractWaitSignStatus" resultType="int" parameterType="com.iformall.domain.po.WxPropertyContract"> |
|
|
|
select count(id) from wx_property_contract where tenant_id=#{tenantId} and status=#{status} |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="queryRentContractEndSoonStatus" resultType="int" parameterType="com.iformall.domain.po.WxRentContract"> |
|
|
|
<select id="queryRentContractEndSoonStatus" resultType="int" parameterType="com.iformall.domain.po.WxPropertyContract"> |
|
|
|
select count(id) from wx_property_contract where tenant_id=#{tenantId} and status!=1 and status!=6 and status!=7 and DATEDIFF(rental_end_date,now()) <= 30 |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="queryRentContractPaidStatus" resultType="int" parameterType="com.iformall.domain.po.WxRentContract"> |
|
|
|
<select id="queryRentContractPaidStatus" resultType="int" parameterType="com.iformall.domain.po.WxPropertyContract"> |
|
|
|
select count(id) from wx_property_contract where tenant_id=#{tenantId} and status!=1 and status!=6 and status!=7 and rental_start_date <= now() and rental_end_date >= now() |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="queryRentContractEndStatus" resultType="int" parameterType="com.iformall.domain.po.WxRentContract"> |
|
|
|
<select id="queryRentContractEndStatus" resultType="int" parameterType="com.iformall.domain.po.WxPropertyContract"> |
|
|
|
select count(id) from wx_property_contract where tenant_id=#{tenantId} and status!=1 and status!=6 and status!=7 and rental_end_date <now() |
|
|
|
</select> |
|
|
|
|
|
|
|
<update id="updateRentContractEndSoonStatus" parameterType="com.iformall.domain.po.WxRentContract"> |
|
|
|
<update id="updateRentContractEndSoonStatus" parameterType="com.iformall.domain.po.WxPropertyContract"> |
|
|
|
update wx_property_contract set status=#{status} where tenant_id=#{tenantId} and status!=1 and status!=6 and status!=7 and DATEDIFF(rental_end_date,now()) <= 30 |
|
|
|
</update> |
|
|
|
|
|
|
|
<update id="updateRentContractPaidStatus" parameterType="com.iformall.domain.po.WxRentContract"> |
|
|
|
<update id="updateRentContractPaidStatus" parameterType="com.iformall.domain.po.WxPropertyContract"> |
|
|
|
update wx_property_contract set status=#{status} where tenant_id=#{tenantId} and status!=1 and status!=6 and status!=7 and rental_start_date <= now() and rental_end_date >= now() |
|
|
|
</update> |
|
|
|
|
|
|
|
<update id="updateRentContractEndStatus" parameterType="com.iformall.domain.po.WxRentContract"> |
|
|
|
<update id="updateRentContractEndStatus" parameterType="com.iformall.domain.po.WxPropertyContract"> |
|
|
|
update wx_property_contract set status=#{status} where tenant_id=#{tenantId} and status!=1 and status!=6 and status!=7 and rental_end_date <now() |
|
|
|
</update> |
|
|
|
|
|
|
|
<update id="updateRentWaitSignStatus" parameterType="com.iformall.domain.po.WxRentContract"> |
|
|
|
<update id="updateRentWaitSignStatus" parameterType="com.iformall.domain.po.WxPropertyContract"> |
|
|
|
update wx_property_contract set status=#{status} where tenant_id=#{tenantId} and status!=7 and merchant_id is null |
|
|
|
</update> |
|
|
|
|
|
|
|
<update id="updateRentInvalidStatus" parameterType="com.iformall.domain.po.WxRentContract"> |
|
|
|
<update id="updateRentInvalidStatus" parameterType="com.iformall.domain.po.WxPropertyContract"> |
|
|
|
update wx_property_contract set status=#{status} where shop_id in ( |
|
|
|
select s.shop_id from (SELECT shop_id FROM wx_property_contract WHERE tenant_id = #{tenantId} and merchant_id is not null and status!=6 |
|
|
|
)s) and merchant_id is null and tenant_id=#{tenantId} |
|
|
|
</update> |
|
|
|
|
|
|
|
<select id="getRentContractList" parameterType="String" resultType="com.iformall.domain.po.WxRentContract"> |
|
|
|
select rc.*,s.shop_number from wx_property_contract rc left join wx_shop s on rc.shop_id=s.id |
|
|
|
select rc.*,s.shop_number from wx_rent_contract rc left join wx_shop s on rc.shop_id=s.id |
|
|
|
where rc.status not in(1,6,7) and rc.tenant_id=#{tenantId} |
|
|
|
</select> |
|
|
|
|
|
|
|
|