| @@ -2399,7 +2399,7 @@ public class WxChartServiceImpl implements WxChartDataService { | |||
| } | |||
| } else { | |||
| datamap.put("otherysje", 0); | |||
| datamap.put("otheryssje", 0); | |||
| datamap.put("otherssje", 0); | |||
| datamap.put("otherzjsjl", 0); | |||
| } | |||
| @@ -2408,7 +2408,7 @@ public class WxChartServiceImpl implements WxChartDataService { | |||
| payinfo = wxBillRentMapper.queryOweInfo(params); | |||
| if (payinfo != null) { | |||
| BigDecimal owe = (BigDecimal) payinfo.get("owe"); | |||
| totalOwe.add(owe); | |||
| totalOwe = totalOwe.add(owe); | |||
| datamap.put("rentOwe", owe); | |||
| } else { | |||
| datamap.put("rentOwe", 0); | |||
| @@ -2417,7 +2417,7 @@ public class WxChartServiceImpl implements WxChartDataService { | |||
| payinfo = wxBillPropertyMapper.queryOweInfo(params); | |||
| if (payinfo != null) { | |||
| BigDecimal owe = (BigDecimal) payinfo.get("owe"); | |||
| totalOwe.add(owe); | |||
| totalOwe = totalOwe.add(owe); | |||
| datamap.put("propertyOwe", owe); | |||
| } else { | |||
| datamap.put("propertyOwe", 0); | |||
| @@ -2426,7 +2426,7 @@ public class WxChartServiceImpl implements WxChartDataService { | |||
| payinfo = wxBillOtherMapper.queryOweInfo(params); | |||
| if (payinfo != null) { | |||
| BigDecimal owe = (BigDecimal) payinfo.get("owe"); | |||
| totalOwe.add(owe); | |||
| totalOwe = totalOwe.add(owe); | |||
| datamap.put("otherOwe", owe); | |||
| } else { | |||
| datamap.put("otherOwe", 0); | |||
| @@ -2435,10 +2435,10 @@ public class WxChartServiceImpl implements WxChartDataService { | |||
| payinfo = wxBillDepositMapper.queryOweInfoAll(params); | |||
| if (payinfo != null) { | |||
| BigDecimal owe = (BigDecimal) payinfo.get("owe"); | |||
| totalOwe.add(owe); | |||
| datamap.put("depositOwe", owe); | |||
| totalOwe = totalOwe.add(owe); | |||
| datamap.put("totalOwe", owe); | |||
| } else { | |||
| datamap.put("depositOwe", 0); | |||
| datamap.put("totalOwe", 0); | |||
| } | |||
| datamap.put("totalOwe", totalOwe); | |||
| @@ -2504,3 +2504,4 @@ public class WxChartServiceImpl implements WxChartDataService { | |||
| } | |||
| } | |||
| @@ -22,9 +22,9 @@ | |||
| <result column="rent_shop_type" jdbcType="INTEGER" property="rentShopType"/> | |||
| <result column="return_price" jdbcType="BIGINT" property="returnPrice"/> | |||
| <result column="pay_way" jdbcType="INTEGER" property="payWay"/> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`rent_contract_id`,`receive_pay`,`pay`,`receive_date`,`pay_date`,`createtime`, | |||
| `expired_day`,`tenant_id`,`owe`,`status`,`is_del`,`need_pay`,`merchant_id`,`user_id`,`shop_id`,`updatetime`, | |||
| @@ -32,42 +32,42 @@ | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| where 1 = 1 | |||
| <if test=" null != id "> and `id` = #{id} </if> | |||
| <if test=" null != rentContractId "> and `rent_contract_id` = #{rentContractId} </if> | |||
| <if test=" null != receivePay "> and `receive_pay` = #{receivePay} </if> | |||
| <if test=" null != pay "> and `pay` = #{pay} </if> | |||
| <if test=" null != receiveDate "> and `receive_date` = #{receiveDate} </if> | |||
| <if test=" null != payDate "> and `pay_date` = #{payDate} </if> | |||
| <if test=" null != createtime "> and `createtime` = #{createtime} </if> | |||
| <if test=" null != expiredDay "> and `expired_day` = #{expiredDay} </if> | |||
| <if test=" null != tenantId "> and `tenant_id` = #{tenantId} </if> | |||
| <if test=" null != owe "> and `owe` = #{owe} </if> | |||
| <if test=" null != status "> and `status` = #{status} </if> | |||
| <if test=" null != isDel "> and `is_del` = #{isDel} </if> | |||
| <if test=" null != needPay "> and `need_pay` = #{needPay} </if> | |||
| <if test=" null != merchantId "> and `merchant_id` = #{merchantId} </if> | |||
| <if test=" null != userId "> and `user_id` = #{userId} </if> | |||
| where 1 = 1 | |||
| <if test=" null != id "> and `id` = #{id} </if> | |||
| <if test=" null != rentContractId "> and `rent_contract_id` = #{rentContractId} </if> | |||
| <if test=" null != receivePay "> and `receive_pay` = #{receivePay} </if> | |||
| <if test=" null != pay "> and `pay` = #{pay} </if> | |||
| <if test=" null != receiveDate "> and `receive_date` = #{receiveDate} </if> | |||
| <if test=" null != payDate "> and `pay_date` = #{payDate} </if> | |||
| <if test=" null != createtime "> and `createtime` = #{createtime} </if> | |||
| <if test=" null != expiredDay "> and `expired_day` = #{expiredDay} </if> | |||
| <if test=" null != tenantId "> and `tenant_id` = #{tenantId} </if> | |||
| <if test=" null != owe "> and `owe` = #{owe} </if> | |||
| <if test=" null != status "> and `status` = #{status} </if> | |||
| <if test=" null != isDel "> and `is_del` = #{isDel} </if> | |||
| <if test=" null != needPay "> and `need_pay` = #{needPay} </if> | |||
| <if test=" null != merchantId "> and `merchant_id` = #{merchantId} </if> | |||
| <if test=" null != userId "> and `user_id` = #{userId} </if> | |||
| <if test=" null != shopId "> and `shop_id` = #{shopId} </if> | |||
| <if test=" null != updatetime ">and `updatetime` = #{updatetime}</if> | |||
| <if test=" null != rentShopType ">and `rent_shop_type` = #{rentShopType}</if> | |||
| <if test=" null != payWay ">and `pay_way` = #{payWay}</if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| #{idItem} | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| </if> | |||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | |||
| </sql> | |||
| <select id="findList" parameterType="com.iformall.domain.po.WxBillDeposit" resultMap="BaseResultMap"> | |||
| select <include refid="allColumns" /> from wx_bill_rent_deposit | |||
| <include refid="dynamicWhereConditions" /> | |||
| </select> | |||
| <select id="queryBillDepositList" parameterType="com.iformall.domain.po.WxRentContract" resultType="hashmap"> | |||
| select br.`id`,br.`receive_pay` receivePay,br.`pay`,br.`receive_date` receiveDate, | |||
| br.`pay_date` payDate,br.`createtime`,br.`expired_day` expiredDay,br.`owe`,br.`status`, | |||
| @@ -86,11 +86,11 @@ | |||
| <if test=" null != rentShopType ">and br.`rent_shop_type` = #{rentShopType}</if> | |||
| <if test=" null != rentContractId ">and br.`rent_contract_id` = #{rentContractId}</if> | |||
| <if test=" null != payWay ">and br.`pay_way` = #{payWay}</if> | |||
| </where> | |||
| order by id desc | |||
| </select> | |||
| <select id="queryPayInfo" resultType="hashmap" parameterType="hashmap"> | |||
| select IFNULL(sum(receive_pay),0) receivepay,IFNULL(sum(pay),0) pay,tenant_id from wx_bill_rent_deposit | |||
| where tenant_id=#{tenantId} and date_format(receive_date,'%Y-%m')=#{receiveDate} | |||
| @@ -112,7 +112,7 @@ | |||
| </select> | |||
| <select id="queryOweInfoAll" resultType="hashmap" parameterType="hashmap"> | |||
| select sum(res.owe) owe,res.tenant_id from | |||
| select IFNULL(round(sum(res.owe)/100,2),0) owe,res.tenant_id from | |||
| ( | |||
| select IFNULL(sum(owe),0) owe,tenant_id from wx_bill_rent_deposit | |||
| where tenant_id=#{tenantId} and date_format(receive_date,'%Y-%m')=#{receiveDate} | |||
| @@ -123,18 +123,16 @@ | |||
| select IFNULL(sum(owe),0) owe,tenant_id from wx_bill_other_deposit | |||
| where tenant_id=#{tenantId} and date_format(receive_date,'%Y-%m')=#{receiveDate} | |||
| ) res | |||
| group by res.tenant_id | |||
| </select> | |||
| <update id="updateNotPaidStatus" parameterType="hashmap"> | |||
| update wx_bill_rent_deposit set status=#{notPaid},expired_day=DATEDIFF(now(),receive_date) | |||
| where tenant_id=#{tenantId} and status!=#{paid} and status!=5 and DATEDIFF(now(),receive_date)>0 | |||
| </update> | |||
| <update id="updateWaitPayStatus" parameterType="hashmap"> | |||
| update wx_bill_rent_deposit set status=#{waitPay} where id in( | |||
| select a.id from (select br.id,rc.receive_period,br.rent_contract_id,br.receive_date from wx_bill_rent_deposit br | |||
| update wx_bill_rent_deposit set status=#{waitPay} where id in( | |||
| select a.id from (select br.id,rc.receive_period,br.rent_contract_id,br.receive_date from wx_bill_rent_deposit br | |||
| left join wx_rent_contract rc on br.rent_contract_id=rc.id | |||
| where br.tenant_id=#{tenantId} and br.status!=#{paid} and br.status!=5 and now() < br.receive_date | |||
| and DATE_ADD(now(),INTERVAL 1 MONTH)>br.receive_date) a) | |||
| @@ -144,5 +142,6 @@ | |||
| select count(*) c from wx_rent_contract r,wx_bill_rent_deposit b | |||
| where b.rent_contract_id = r.id and b.status = 1 and r.id = #{id} | |||
| </select> | |||
| </mapper> | |||
| @@ -21,9 +21,9 @@ | |||
| <result column="comments" jdbcType="VARCHAR" property="comments" /> | |||
| <result column="rent_shop_type" jdbcType="INTEGER" property="rentShopType"/> | |||
| <result column="pay_way" jdbcType="INTEGER" property="payWay"/> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`receive_pay`,`pay`,`receive_date`,`pay_date`,`createtime`,`expired_day`, | |||
| `tenant_id`,`owe`,`status`,`is_del`,`merchant_id`,`user_id`,`shop_id`,`updatetime`,`name`,`comments`, | |||
| @@ -31,40 +31,40 @@ | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| where 1 = 1 | |||
| <if test=" null != id "> and `id` = #{id} </if> | |||
| <if test=" null != receivePay "> and `receive_pay` = #{receivePay} </if> | |||
| <if test=" null != pay "> and `pay` = #{pay} </if> | |||
| <if test=" null != receiveDate "> and `receive_date` = #{receiveDate} </if> | |||
| <if test=" null != payDate "> and `pay_date` = #{payDate} </if> | |||
| <if test=" null != createtime "> and `createtime` = #{createtime} </if> | |||
| <if test=" null != expiredDay "> and `expired_day` = #{expiredDay} </if> | |||
| <if test=" null != tenantId "> and `tenant_id` = #{tenantId} </if> | |||
| <if test=" null != owe "> and `owe` = #{owe} </if> | |||
| <if test=" null != status "> and `status` = #{status} </if> | |||
| <if test=" null != isDel "> and `is_del` = #{isDel} </if> | |||
| <if test=" null != merchantId "> and `merchant_id` = #{merchantId} </if> | |||
| <if test=" null != userId "> and `user_id` = #{userId} </if> | |||
| <if test=" null != shopId "> and `shop_id` = #{shopId} </if> | |||
| where 1 = 1 | |||
| <if test=" null != id "> and `id` = #{id} </if> | |||
| <if test=" null != receivePay "> and `receive_pay` = #{receivePay} </if> | |||
| <if test=" null != pay "> and `pay` = #{pay} </if> | |||
| <if test=" null != receiveDate "> and `receive_date` = #{receiveDate} </if> | |||
| <if test=" null != payDate "> and `pay_date` = #{payDate} </if> | |||
| <if test=" null != createtime "> and `createtime` = #{createtime} </if> | |||
| <if test=" null != expiredDay "> and `expired_day` = #{expiredDay} </if> | |||
| <if test=" null != tenantId "> and `tenant_id` = #{tenantId} </if> | |||
| <if test=" null != owe "> and `owe` = #{owe} </if> | |||
| <if test=" null != status "> and `status` = #{status} </if> | |||
| <if test=" null != isDel "> and `is_del` = #{isDel} </if> | |||
| <if test=" null != merchantId "> and `merchant_id` = #{merchantId} </if> | |||
| <if test=" null != userId "> and `user_id` = #{userId} </if> | |||
| <if test=" null != shopId "> and `shop_id` = #{shopId} </if> | |||
| <if test=" null != updatetime "> and `updatetime` = #{updatetime} </if> | |||
| <if test=" null != name "> and `name` = #{name} </if> | |||
| <if test=" null != rentShopType ">and `rent_shop_type` = #{rentShopType}</if> | |||
| <if test=" null != payWay ">and `pay_way` = #{payWay}</if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| #{idItem} | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| </if> | |||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | |||
| </sql> | |||
| <select id="findList" parameterType="com.iformall.domain.po.WxBillOther" resultMap="BaseResultMap"> | |||
| select <include refid="allColumns" /> from wx_bill_other | |||
| <include refid="dynamicWhereConditions" /> | |||
| </select> | |||
| <select id="queryBillList" parameterType="com.iformall.domain.po.WxBillOther" resultType="hashmap"> | |||
| select br.`id`,br.`receive_pay` receivePay,br.`pay`,br.`receive_date` receiveDate, | |||
| br.`pay_date` payDate,br.`createtime`,br.`expired_day` expiredDay,br.`owe`,br.`status`, | |||
| @@ -82,16 +82,16 @@ | |||
| <if test=" null != name ">and br.`name` = #{name}</if> | |||
| <if test=" null != rentShopType ">and br.`rent_shop_type` = #{rentShopType}</if> | |||
| <if test=" null != payWay ">and br.`pay_way` = #{payWay}</if> | |||
| </where> | |||
| order by id desc | |||
| </select> | |||
| <update id="updateNotPaidStatus" parameterType="hashmap"> | |||
| update wx_bill_other set status=#{notPaid},expired_day=DATEDIFF(now(),receive_date) | |||
| where tenant_id=#{tenantId} and status!=#{paid} and DATEDIFF(now(),receive_date)>0 | |||
| </update> | |||
| <update id="updateWaitPayStatus" parameterType="hashmap"> | |||
| update wx_bill_other set status=#{waitPay} where tenant_id=#{tenantId} | |||
| and status!=#{paid} and DATEDIFF(now(),receive_date) <=0 | |||
| @@ -99,23 +99,21 @@ | |||
| <select id="queryPayInfoTotal" resultType="hashmap" parameterType="hashmap"> | |||
| select sum(t.receivepay),receivepay,sum(t.pay) pay from | |||
| select round(sum(t.receivepay)/100,2) receivepay,round(sum(t.pay)/100,2) pay from | |||
| ( | |||
| select IFNULL(sum(receive_pay),0) receivepay,IFNULL(sum(pay),0) pay,tenant_id from wx_bill_other | |||
| where tenant_id=#{tenantId} and receive_date between #{startdate} and #{enddate} | |||
| group by tenant_id | |||
| union | |||
| select IFNULL(sum(receive_pay),0) receivepay,IFNULL(sum(pay),0) pay,tenant_id from wx_bill_daily | |||
| where tenant_id=#{tenantId} and receive_date between #{startdate} and #{enddate} | |||
| group by tenant_id | |||
| ) t | |||
| </select> | |||
| <select id="queryOweInfo" resultType="hashmap" parameterType="hashmap"> | |||
| select IFNULL(sum(owe),0) owe,tenant_id from wx_bill_other | |||
| select IFNULL(round(sum(owe)/100,2),0) owe,tenant_id from wx_bill_other | |||
| where status = 1 and tenant_id=#{tenantId} and receive_date between #{startdate} and #{enddate} | |||
| group by tenant_id | |||
| </select> | |||
| </mapper> | |||
| @@ -30,9 +30,9 @@ | |||
| <result column="pay_way" jdbcType="INTEGER" property="payWay"/> | |||
| <result column="late_pay_status" jdbcType="INTEGER" property="latePayStatus"/> | |||
| <result column="comments" jdbcType="VARCHAR" property="comments"/> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`property_contract_id`,`receive_pay`,`pay`,`receive_date`,`pay_date`, | |||
| `createtime`,`expired_day`,`tenant_id`,`owe`,`status`,`is_del`,`need_pay`, | |||
| @@ -43,21 +43,21 @@ | |||
| <sql id="dynamicWhereConditions"> | |||
| where 1=1 | |||
| <if test=" null != id "> and `id` = #{id} </if> | |||
| <if test=" null != id "> and `id` = #{id} </if> | |||
| <if test=" null != propertyContractId "> and `property_contract_id` = #{propertyContractId} </if> | |||
| <if test=" null != receivePay "> and `receive_pay` = #{receivePay} </if> | |||
| <if test=" null != pay "> and `pay` = #{pay} </if> | |||
| <if test=" null != receiveDate "> and `receive_date` = #{receiveDate} </if> | |||
| <if test=" null != payDate "> and `pay_date` = #{payDate} </if> | |||
| <if test=" null != createtime "> and `createtime` = #{createtime} </if> | |||
| <if test=" null != expiredDay "> and `expired_day` = #{expiredDay} </if> | |||
| <if test=" null != tenantId "> and `tenant_id` = #{tenantId} </if> | |||
| <if test=" null != owe "> and `owe` = #{owe} </if> | |||
| <if test=" null != status "> and `status` = #{status} </if> | |||
| <if test=" null != isDel "> and `is_del` = #{isDel} </if> | |||
| <if test=" null != needPay "> and `need_pay` = #{needPay} </if> | |||
| <if test=" null != merchantId "> and `merchant_id` = #{merchantId} </if> | |||
| <if test=" null != userId "> and `user_id` = #{userId} </if> | |||
| <if test=" null != receivePay "> and `receive_pay` = #{receivePay} </if> | |||
| <if test=" null != pay "> and `pay` = #{pay} </if> | |||
| <if test=" null != receiveDate "> and `receive_date` = #{receiveDate} </if> | |||
| <if test=" null != payDate "> and `pay_date` = #{payDate} </if> | |||
| <if test=" null != createtime "> and `createtime` = #{createtime} </if> | |||
| <if test=" null != expiredDay "> and `expired_day` = #{expiredDay} </if> | |||
| <if test=" null != tenantId "> and `tenant_id` = #{tenantId} </if> | |||
| <if test=" null != owe "> and `owe` = #{owe} </if> | |||
| <if test=" null != status "> and `status` = #{status} </if> | |||
| <if test=" null != isDel "> and `is_del` = #{isDel} </if> | |||
| <if test=" null != needPay "> and `need_pay` = #{needPay} </if> | |||
| <if test=" null != merchantId "> and `merchant_id` = #{merchantId} </if> | |||
| <if test=" null != userId "> and `user_id` = #{userId} </if> | |||
| <if test=" null != shopId "> and `shop_id` = #{shopId} </if> | |||
| <if test=" null != updatetime ">and `updatetime` = #{updatetime}</if> | |||
| <if test=" null != rentShopType ">and `rent_shop_type` = #{rentShopType}</if> | |||
| @@ -67,19 +67,19 @@ | |||
| <if test=" null != latePayStatus ">and `late_pay_status` = #{latePayStatus}</if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| #{idItem} | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| </if> | |||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | |||
| </sql> | |||
| <select id="findList" parameterType="com.iformall.domain.po.WxBillProperty" resultMap="BaseResultMap"> | |||
| select <include refid="allColumns" /> from wx_bill_property | |||
| <include refid="dynamicWhereConditions" /> | |||
| </select> | |||
| <select id="queryBillPropertyList" parameterType="com.iformall.domain.po.WxBillProperty" resultType="hashmap"> | |||
| select br.`id`,br.`receive_pay` receivePay,br.`pay`,br.`receive_date` receiveDate, | |||
| br.`pay_date` payDate,br.`createtime`,br.`expired_day` expiredDay,br.`owe`,br.`status`, | |||
| @@ -109,11 +109,11 @@ | |||
| <if test=" null != propertyContractId ">and br.`property_contract_id` = #{propertyContractId}</if> | |||
| <if test=" null != payWay ">and br.`pay_way` = #{payWay}</if> | |||
| <if test=" null != latePayStatus ">and br.`late_pay_status` = #{latePayStatus}</if> | |||
| </where> | |||
| <if test=" null != sortColumns">order by br.${sortColumns}</if> | |||
| </select> | |||
| <select id="queryPayInfo" resultType="hashmap" parameterType="hashmap"> | |||
| select IFNULL(sum(receive_pay),0) receivepay,IFNULL(sum(pay),0) pay,tenant_id from wx_bill_property | |||
| where tenant_id=#{tenantId} and receive_date between #{startdate} and #{enddate} and is_preview = 0 | |||
| @@ -128,19 +128,18 @@ | |||
| <select id="queryOweInfo" resultType="hashmap" parameterType="hashmap"> | |||
| select IFNULL(sum(owe),0) owe,tenant_id from wx_bill_property | |||
| select IFNULL(round(sum(owe)/100,2),0) owe,tenant_id from wx_bill_property | |||
| where status = 1 and tenant_id=#{tenantId} and receive_date between #{startdate} and #{enddate} and is_preview = 0 | |||
| group by tenant_id | |||
| </select> | |||
| <update id="updateNotPaidStatus" parameterType="hashmap"> | |||
| update wx_bill_property set status=#{notPaid},expired_day=DATEDIFF(now(),receive_date) | |||
| where tenant_id=#{tenantId} and status!=#{paid} and status != 6 and DATEDIFF(now(),receive_date)>0 | |||
| </update> | |||
| <update id="updateWaitPayStatus" parameterType="hashmap"> | |||
| update wx_bill_property set status=#{waitPay} where id in( | |||
| select a.id from (select br.id,rc.receive_period,br.property_contract_id,br.receive_date from wx_bill_property br | |||
| update wx_bill_property set status=#{waitPay} where id in( | |||
| select a.id from (select br.id,rc.receive_period,br.property_contract_id,br.receive_date from wx_bill_property br | |||
| left join wx_property_contract rc on br.property_contract_id=rc.id | |||
| where br.tenant_id=#{tenantId} and br.status!=#{paid} and br.status != 6 and now() < br.receive_date | |||
| and DATE_ADD(now(),INTERVAL 1 MONTH)>br.receive_date) a) | |||
| @@ -180,3 +179,4 @@ | |||
| where c.id = br.property_contract_id and br.status = 1 and c.id = #{contractId} | |||
| </select> | |||
| </mapper> | |||
| @@ -30,9 +30,9 @@ | |||
| <result column="pay_way" jdbcType="INTEGER" property="payWay"/> | |||
| <result column="late_pay_status" jdbcType="INTEGER" property="latePayStatus"/> | |||
| <result column="comments" jdbcType="VARCHAR" property="comments"/> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`rent_contract_id`,`receive_pay`,`pay`,`receive_date`,`pay_date`, | |||
| `createtime`,`expired_day`,`tenant_id`,`owe`,`status`,`is_del`,`need_pay`, | |||
| @@ -40,7 +40,7 @@ | |||
| `revenue`,`late_pay_ratio`,`late_pay_time`,`late_pay_price`,`period`,`is_preview`,`shop_info`, | |||
| `pay_way`,`late_pay_status`,`comments` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| where 1=1 | |||
| <if test=" null != id ">and `id` = #{id}</if> | |||
| @@ -74,15 +74,15 @@ | |||
| </if> | |||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||
| </sql> | |||
| <select id="findList" parameterType="com.iformall.domain.po.WxBillRent" resultMap="BaseResultMap"> | |||
| select | |||
| <include refid="allColumns"/> | |||
| from wx_bill_rent | |||
| <include refid="dynamicWhereConditions"/> | |||
| </select> | |||
| <select id="queryBillRentList" parameterType="com.iformall.domain.po.WxRentContract" resultType="hashmap"> | |||
| select br.`id`,br.`receive_pay` receivePay,br.`pay`,br.`receive_date` receiveDate, | |||
| br.`pay_date` payDate,br.`createtime`,br.`expired_day` expiredDay,br.`owe`,br.`status`, | |||
| @@ -113,11 +113,11 @@ | |||
| <if test=" null != rentContractId ">and br.`rent_contract_id` = #{rentContractId}</if> | |||
| <if test=" null != payWay ">and br.`pay_way` = #{payWay}</if> | |||
| <if test=" null != latePayStatus ">and br.`late_pay_status` = #{latePayStatus}</if> | |||
| </where> | |||
| <if test=" null != sortColumns">order by br.${sortColumns}</if> | |||
| </select> | |||
| <select id="queryPayInfo" resultType="hashmap" parameterType="hashmap"> | |||
| select IFNULL(sum(receive_pay),0) receivepay,IFNULL(sum(pay),0) pay,tenant_id from wx_bill_rent | |||
| where tenant_id=#{tenantId} and receive_date between #{startdate} and #{enddate} and is_preview = 0 | |||
| @@ -131,19 +131,18 @@ | |||
| <select id="queryOweInfo" resultType="hashmap" parameterType="hashmap"> | |||
| select IFNULL(sum(owe),0) owe,tenant_id from wx_bill_rent | |||
| select IFNULL(round(sum(owe)/100,2),0) owe,tenant_id from wx_bill_rent | |||
| where status = 1 and tenant_id=#{tenantId} and receive_date between #{startdate} and #{enddate} and is_preview = 0 | |||
| group by tenant_id | |||
| </select> | |||
| <update id="updateNotPaidStatus" parameterType="hashmap"> | |||
| update wx_bill_rent set status=#{notPaid},expired_day=DATEDIFF(now(),receive_date) | |||
| where tenant_id=#{tenantId} and status!=#{paid} and status!=6 and DATEDIFF(now(),receive_date)>0 | |||
| </update> | |||
| <update id="updateWaitPayStatus" parameterType="hashmap"> | |||
| update wx_bill_rent set status=#{waitPay} where id in( | |||
| select a.id from (select br.id,rc.receive_period,br.rent_contract_id,br.receive_date from wx_bill_rent br | |||
| update wx_bill_rent set status=#{waitPay} where id in( | |||
| select a.id from (select br.id,rc.receive_period,br.rent_contract_id,br.receive_date from wx_bill_rent br | |||
| left join wx_rent_contract rc on br.rent_contract_id=rc.id | |||
| where br.tenant_id=#{tenantId} and br.status!=#{paid} and br.status!=6 and now() < br.receive_date | |||
| and DATE_ADD(now(),INTERVAL 1 MONTH)>br.receive_date) a) | |||
| @@ -179,3 +178,4 @@ | |||
| </mapper> | |||