| @@ -203,16 +203,19 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| Map<String,Object> resultData=new HashMap(); | Map<String,Object> resultData=new HashMap(); | ||||
| WxRentContract wxRentContract = new WxRentContract(); | WxRentContract wxRentContract = new WxRentContract(); | ||||
| wxRentContract.setTenantId(tenantId); | wxRentContract.setTenantId(tenantId); | ||||
| //将到期 | |||||
| wxRentContract.setStatus(EnumRentContractStatus.CONTRACT_END_SOON.getCode()); | |||||
| int endSoonCount=wxRentContractMapper.queryRentContractEndSoonStatus(wxRentContract); | |||||
| wxRentContractMapper.updateRentContractEndSoonStatus(wxRentContract); | |||||
| resultData.put("endSoonCount",endSoonCount); | |||||
| //计租中 | //计租中 | ||||
| wxRentContract.setStatus(EnumRentContractStatus.RENT_PAID.getCode()); | wxRentContract.setStatus(EnumRentContractStatus.RENT_PAID.getCode()); | ||||
| int rendPaidCount =wxRentContractMapper.queryRentContractPaidStatus(wxRentContract); | int rendPaidCount =wxRentContractMapper.queryRentContractPaidStatus(wxRentContract); | ||||
| wxRentContractMapper.updateRentContractPaidStatus(wxRentContract); | wxRentContractMapper.updateRentContractPaidStatus(wxRentContract); | ||||
| resultData.put("rendPaidCount",rendPaidCount); | resultData.put("rendPaidCount",rendPaidCount); | ||||
| //将到期 | |||||
| wxRentContract.setStatus(EnumRentContractStatus.CONTRACT_END_SOON.getCode()); | |||||
| int endSoonCount=wxRentContractMapper.queryRentContractEndSoonStatus(wxRentContract); | |||||
| wxRentContractMapper.updateRentContractEndSoonStatus(wxRentContract); | |||||
| resultData.put("endSoonCount",endSoonCount); | |||||
| //到期 | //到期 | ||||
| wxRentContract.setStatus(EnumRentContractStatus.CONTRACT_END.getCode()); | wxRentContract.setStatus(EnumRentContractStatus.CONTRACT_END.getCode()); | ||||
| int endCount=wxRentContractMapper.queryRentContractEndStatus(wxRentContract); | int endCount=wxRentContractMapper.queryRentContractEndStatus(wxRentContract); | ||||
| @@ -111,15 +111,15 @@ | |||||
| </select> | </select> | ||||
| <update id="updateRentContractEndSoonStatus" parameterType="com.iformall.domain.po.WxRentContract"> | <update id="updateRentContractEndSoonStatus" parameterType="com.iformall.domain.po.WxRentContract"> | ||||
| update wx_rent_contract set status=#{status} where tenant_id=#{tenantId} and status!=#{status} and status!=1 and status!=6 and DATEDIFF(rental_end_date,now()) <= 30 | |||||
| update wx_rent_contract set status=#{status} where tenant_id=#{tenantId} and status!=1 and status!=6 and DATEDIFF(rental_end_date,now()) <= 30 | |||||
| </update> | </update> | ||||
| <update id="updateRentContractPaidStatus" parameterType="com.iformall.domain.po.WxRentContract"> | <update id="updateRentContractPaidStatus" parameterType="com.iformall.domain.po.WxRentContract"> | ||||
| update wx_rent_contract set status=#{status} where tenant_id=#{tenantId} and status!=#{status} and status!=1 and status!=6 and rental_start_date <= now() and rental_end_date >= now() | |||||
| update wx_rent_contract set status=#{status} where tenant_id=#{tenantId} and status!=1 and status!=6 and rental_start_date <= now() and rental_end_date >= now() | |||||
| </update> | </update> | ||||
| <update id="updateRentContractEndStatus" parameterType="com.iformall.domain.po.WxRentContract"> | <update id="updateRentContractEndStatus" parameterType="com.iformall.domain.po.WxRentContract"> | ||||
| update wx_rent_contract set status=#{status} where tenant_id=#{tenantId} and status!=#{status} and status!=1 and status!=6 and rental_end_date <now() | |||||
| update wx_rent_contract set status=#{status} where tenant_id=#{tenantId} and status!=1 and status!=6 and rental_end_date <now() | |||||
| </update> | </update> | ||||
| </mapper> | </mapper> | ||||
| @@ -127,7 +127,8 @@ | |||||
| select s.id,s.shop_number shopNumber,s.build_area buildArea, | select s.id,s.shop_number shopNumber,s.build_area buildArea, | ||||
| s.img_url imgUrl,s.operation_area operationArea, | s.img_url imgUrl,s.operation_area operationArea, | ||||
| s.status,b.building_name building,f.floor_name floor,m.`name` merchantName,m.id merchantId | |||||
| s.status,b.building_name building,f.floor_name floor,m.`name` merchantName,m.id merchantId, | |||||
| m.link_person linkPerson,m.link_phone linkPhone | |||||
| from wx_shop s left join wx_merchant_shop ms on ms.shop_id=s.id and ms.is_del=0 | from wx_shop s left join wx_merchant_shop ms on ms.shop_id=s.id and ms.is_del=0 | ||||
| left join wx_merchant m on ms.merchant_id=m.id | left join wx_merchant m on ms.merchant_id=m.id | ||||
| left join wx_mall_building b on s.building=b.id | left join wx_mall_building b on s.building=b.id | ||||