| @@ -35,6 +35,7 @@ public class WxBillPropertyController extends BaseController { | |||||
| wxBillProperty = new WxBillProperty(); | wxBillProperty = new WxBillProperty(); | ||||
| } | } | ||||
| wxBillProperty.setTenantId(getTenantId()); | wxBillProperty.setTenantId(getTenantId()); | ||||
| wxBillProperty.setSortColumns(WxBillProperty.Field.Id_ASC); | |||||
| PageInfo<Map<String, Object>> result = wxBillPropertyService.listAsPage(wxBillProperty, pageNum, pageSize); | PageInfo<Map<String, Object>> result = wxBillPropertyService.listAsPage(wxBillProperty, pageNum, pageSize); | ||||
| return new ResultData(result); | return new ResultData(result); | ||||
| } | } | ||||
| @@ -351,7 +351,7 @@ public class WxBillRent implements Serializable { | |||||
| sb.append(","); | sb.append(","); | ||||
| sb.append(fields[k].toString()); | sb.append(fields[k].toString()); | ||||
| } | } | ||||
| this.sortColumns = sb.toString(); | |||||
| } | } | ||||
| public void setSortColumns(String sortColumns) | public void setSortColumns(String sortColumns) | ||||
| @@ -92,6 +92,7 @@ public class WxBillRentServiceImpl implements WxBillRentService { | |||||
| public Map<String, Object> getById(Long id) { | public Map<String, Object> getById(Long id) { | ||||
| WxBillRent record = new WxBillRent(); | WxBillRent record = new WxBillRent(); | ||||
| record.setId(id); | record.setId(id); | ||||
| record.setSortColumns(WxBillRent.Field.Id_ASC); | |||||
| return wxBillRentMapper.queryBillRentList(record).get(0); | return wxBillRentMapper.queryBillRentList(record).get(0); | ||||
| } | } | ||||
| @@ -83,12 +83,13 @@ | |||||
| br.`property_contract_id` propertyContractId,d.receive_pay deposit,case when br.late_pay_time is null then 0 | br.`property_contract_id` propertyContractId,d.receive_pay deposit,case when br.late_pay_time is null then 0 | ||||
| else | else | ||||
| FLOOR(DATEDIFF(now(),br.late_pay_time)*br.late_pay_ratio/10000*br.owe) end latePayPrice, | FLOOR(DATEDIFF(now(),br.late_pay_time)*br.late_pay_ratio/10000*br.owe) end latePayPrice, | ||||
| (select max(period) from wx_bill_property where id=br.id) allPeriod,d.`status` depositStatus | |||||
| (select max(period) from wx_bill_property where property_contract_id=br.property_contract_id) | |||||
| allPeriod,d.`status` depositStatus | |||||
| from wx_bill_property br left join wx_merchant m on br.merchant_id=m.id | from wx_bill_property br left join wx_merchant m on br.merchant_id=m.id | ||||
| left join wx_shop s on br.shop_id=s.id | left join wx_shop s on br.shop_id=s.id | ||||
| left join wx_bill_property_deposit d on br.property_contract_id=d.property_contract_id | left join wx_bill_property_deposit d on br.property_contract_id=d.property_contract_id | ||||
| <where> | <where> | ||||
| is_preview = 0 | |||||
| br.is_preview = 0 | |||||
| <if test=" null != id ">and br.`id` = #{id}</if> | <if test=" null != id ">and br.`id` = #{id}</if> | ||||
| <if test=" null != merchantId ">and br.`merchant_id` = #{merchantId}</if> | <if test=" null != merchantId ">and br.`merchant_id` = #{merchantId}</if> | ||||
| <if test=" null != merchantName and ''!=merchantName ">and m.`name` like concat('%',#{merchantName},'%')</if> | <if test=" null != merchantName and ''!=merchantName ">and m.`name` like concat('%',#{merchantName},'%')</if> | ||||
| @@ -99,7 +100,7 @@ | |||||
| <if test=" null != rentShopType ">and br.`rent_shop_type` = #{rentShopType}</if> | <if test=" null != rentShopType ">and br.`rent_shop_type` = #{rentShopType}</if> | ||||
| </where> | </where> | ||||
| order by ${sortColumns} | |||||
| order by br.${sortColumns} | |||||
| </select> | </select> | ||||
| <select id="queryPayInfo" resultType="hashmap" parameterType="hashmap"> | <select id="queryPayInfo" resultType="hashmap" parameterType="hashmap"> | ||||
| @@ -84,13 +84,14 @@ | |||||
| br.`revenue`,br.`late_pay_ratio` latePayRatio,br.`late_pay_time` latePayTime,br.`period`, | br.`revenue`,br.`late_pay_ratio` latePayRatio,br.`late_pay_time` latePayTime,br.`period`, | ||||
| br.`rent_contract_id` rentContractId,d.receive_pay deposit,case when br.late_pay_time is null then 0 else | br.`rent_contract_id` rentContractId,d.receive_pay deposit,case when br.late_pay_time is null then 0 else | ||||
| FLOOR(DATEDIFF(now(),br.late_pay_time)*br.late_pay_ratio/10000*br.owe) end latePayPrice, | FLOOR(DATEDIFF(now(),br.late_pay_time)*br.late_pay_ratio/10000*br.owe) end latePayPrice, | ||||
| (select max(period) from wx_bill_rent where id=br.id) allPeriod,d.`status` depositStatus | |||||
| (select max(period) from wx_bill_rent where rent_contract_id=br.rent_contract_id) allPeriod,d.`status` | |||||
| depositStatus | |||||
| from wx_bill_rent br left join wx_merchant m on br.merchant_id=m.id | from wx_bill_rent br left join wx_merchant m on br.merchant_id=m.id | ||||
| left join wx_shop s on br.shop_id=s.id | left join wx_shop s on br.shop_id=s.id | ||||
| left join wx_rent_contract r on br.rent_contract_id=r.id | left join wx_rent_contract r on br.rent_contract_id=r.id | ||||
| left join wx_bill_rent_deposit d on br.rent_contract_id=d.rent_contract_id and br.merchant_id=d.merchant_id | left join wx_bill_rent_deposit d on br.rent_contract_id=d.rent_contract_id and br.merchant_id=d.merchant_id | ||||
| <where> | <where> | ||||
| is_preview = 0 | |||||
| br.is_preview = 0 | |||||
| <if test=" null != id ">and br.`id` = #{id}</if> | <if test=" null != id ">and br.`id` = #{id}</if> | ||||
| <if test=" null != merchantId ">and br.`merchant_id` = #{merchantId}</if> | <if test=" null != merchantId ">and br.`merchant_id` = #{merchantId}</if> | ||||
| <if test=" null != merchantName and ''!=merchantName ">and m.`name` like concat('%',#{merchantName},'%')</if> | <if test=" null != merchantName and ''!=merchantName ">and m.`name` like concat('%',#{merchantName},'%')</if> | ||||
| @@ -100,7 +101,7 @@ | |||||
| <if test=" null != starttime and null!=endtime ">and br.`receive_date` between #{starttime} and #{endtime}</if> | <if test=" null != starttime and null!=endtime ">and br.`receive_date` between #{starttime} and #{endtime}</if> | ||||
| <if test=" null != rentShopType ">and br.`rent_shop_type` = #{rentShopType}</if> | <if test=" null != rentShopType ">and br.`rent_shop_type` = #{rentShopType}</if> | ||||
| </where> | </where> | ||||
| order by ${sortColumns} | |||||
| order by br.${sortColumns} | |||||
| </select> | </select> | ||||
| <select id="queryPayInfo" resultType="hashmap" parameterType="hashmap"> | <select id="queryPayInfo" resultType="hashmap" parameterType="hashmap"> | ||||