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