Browse Source

[预账单][添加][创建合同添加预账单]

release_toaliyun_real
luozukai 7 years ago
committed by Stormeye Wu
parent
commit
244b91e01f
3 changed files with 18 additions and 17 deletions
  1. +12
    -12
      mallinkService/src/main/resources/mapper/WxBillAllMapper.xml
  2. +3
    -2
      mallinkService/src/main/resources/mapper/WxBillPropertyMapper.xml
  3. +3
    -3
      mallinkService/src/main/resources/mapper/WxBillRentMapper.xml

+ 12
- 12
mallinkService/src/main/resources/mapper/WxBillAllMapper.xml View File

@@ -10,7 +10,7 @@
bill.rent_shop_type rentShopType from (
select id,merchant_id,shop_id,tenant_id,'租金' name,1 bill_type_value,'租金'
bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,'' starttime,''
endtime,rent_shop_type from wx_bill_rent
endtime,rent_shop_type from wx_bill_rent where is_preview = 0
union
select id,merchant_id,shop_id,tenant_id,'租赁押金' name,2 bill_type_value,'租赁押金'
bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,'' starttime,''
@@ -18,7 +18,7 @@
union
select id,merchant_id,shop_id,tenant_id,'物业费' name,3 bill_type_value,'物业费'
bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,'' starttime,''
endtime,rent_shop_type from wx_bill_property
endtime,rent_shop_type from wx_bill_property where is_preview = 0
union
select id,merchant_id,shop_id,tenant_id,'物业押金' name,4 bill_type_value,'物业押金'
bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,'' starttime,''
@@ -57,7 +57,7 @@

select count(bill.id) owncount,IFNULL(sum(bill.owe),0) owe from (
select id,merchant_id,shop_id,tenant_id,1 bill_type_value,'租金'
bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_rent
bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_rent where is_preview = 0
union
select id,merchant_id,shop_id,tenant_id,2 bill_type_value,'租赁押金'
bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from
@@ -65,7 +65,7 @@
union
select id,merchant_id,shop_id,tenant_id,3 bill_type_value,'物业费'
bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from
wx_bill_property
wx_bill_property where is_preview = 0
union
select id,merchant_id,shop_id,tenant_id,4 bill_type_value,'物业押金'
bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from
@@ -98,7 +98,7 @@
select count(bill.id) paycount,IFNULL(sum(bill.pay),0) pay from (
select id,merchant_id,shop_id,tenant_id,1 bill_type_value,'租金'
bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_rent
bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_rent where is_preview = 0
union
select id,merchant_id,shop_id,tenant_id,2 bill_type_value,'租赁押金'
bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from
@@ -106,7 +106,7 @@
union
select id,merchant_id,shop_id,tenant_id,3 bill_type_value,'物业费'
bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from
wx_bill_property
wx_bill_property where is_preview = 0
union
select id,merchant_id,shop_id,tenant_id,4 bill_type_value,'物业押金'
bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from
@@ -144,7 +144,7 @@
rentShopType from (
select id,merchant_id,shop_id,tenant_id,'租金' name,1 bill_type_value,'租金'
bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,starttime,endtime,rent_shop_type
from wx_bill_rent
from wx_bill_rent where is_preview = 0
union
select id,merchant_id,shop_id,tenant_id,'租赁押金' name,2 bill_type_value,'租赁押金'
bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,starttime,endtime,rent_shop_type
@@ -152,7 +152,7 @@
union
select id,merchant_id,shop_id,tenant_id,'物业费' name,3 bill_type_value,'物业费'
bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,starttime,endtime,rent_shop_type
from wx_bill_property
from wx_bill_property where is_preview = 0
union
select id,merchant_id,shop_id,tenant_id,'物业押金' name,4 bill_type_value,'物业押金'
bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,starttime,endtime,rent_shop_type
@@ -219,7 +219,7 @@
select bill.tenant_id,bill.merchant_id,bill.receive_date,ifnull(sum(need_pay),0) need_pay from (
select id,merchant_id,shop_id,tenant_id,'租金' name,1 bill_type_value,'租金'
bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,''
endtime,rent_shop_type from wx_bill_rent
endtime,rent_shop_type from wx_bill_rent where is_preview = 0
union
select id,merchant_id,shop_id,tenant_id,'租赁押金' name,2 bill_type_value,'租赁押金'
bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,''
@@ -227,7 +227,7 @@ select bill.tenant_id,bill.merchant_id,bill.receive_date,ifnull(sum(need_pay),0)
union
select id,merchant_id,shop_id,tenant_id,'物业费' name,3 bill_type_value,'物业费'
bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,''
endtime,rent_shop_type from wx_bill_property
endtime,rent_shop_type from wx_bill_property where is_preview = 0
union
select id,merchant_id,shop_id,tenant_id,'物业押金' name,4 bill_type_value,'物业押金'
bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,''
@@ -258,7 +258,7 @@ select bill.tenant_id,bill.merchant_id,bill.receive_date,ifnull(sum(need_pay),0)
select bill.tenant_id,bill.merchant_id,sum(owe) owe from (
select id,merchant_id,shop_id,tenant_id,'租金' name,1 bill_type_value,'租金'
bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,''
endtime,rent_shop_type from wx_bill_rent
endtime,rent_shop_type from wx_bill_rent where is_preview = 0
union
select id,merchant_id,shop_id,tenant_id,'租赁押金' name,2 bill_type_value,'租赁押金'
bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,''
@@ -266,7 +266,7 @@ select bill.tenant_id,bill.merchant_id,bill.receive_date,ifnull(sum(need_pay),0)
union
select id,merchant_id,shop_id,tenant_id,'物业费' name,3 bill_type_value,'物业费'
bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,''
endtime,rent_shop_type from wx_bill_property
endtime,rent_shop_type from wx_bill_property where is_preview = 0
union
select id,merchant_id,shop_id,tenant_id,'物业押金' name,4 bill_type_value,'物业押金'
bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,''


+ 3
- 2
mallinkService/src/main/resources/mapper/WxBillPropertyMapper.xml View File

@@ -38,7 +38,7 @@
</sql>

<sql id="dynamicWhereConditions">
where 1 = 1
where is_preview = 0
<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>
@@ -86,6 +86,7 @@
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
<where>
is_preview = 0
<if test=" null != id ">and br.`id` = #{id}</if>
<if test=" null != merchantId ">and br.`merchant_id` = #{merchantId}</if>
<if test=" null != merchantName and ''!=merchantName ">and m.`name` like concat('%',#{merchantName},'%')</if>
@@ -101,7 +102,7 @@
<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 date_format(receive_date,'%Y-%m')=#{receiveDate}
where tenant_id=#{tenantId} and date_format(receive_date,'%Y-%m')=#{receiveDate} and is_preview = 0
group by tenant_id
</select>


+ 3
- 3
mallinkService/src/main/resources/mapper/WxBillRentMapper.xml View File

@@ -37,7 +37,7 @@
</sql>
<sql id="dynamicWhereConditions">
where 1 = 1
where is_preview = 0
<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>
@@ -88,6 +88,7 @@
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
<where>
is_preview = 0
<if test=" null != id ">and br.`id` = #{id}</if>
<if test=" null != merchantId ">and br.`merchant_id` = #{merchantId}</if>
<if test=" null != merchantName and ''!=merchantName ">and m.`name` like concat('%',#{merchantName},'%')</if>
@@ -96,14 +97,13 @@
<if test=" null != isDel ">and br.`is_del` = #{isDel}</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>
</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
where tenant_id=#{tenantId} and receive_date between #{startdate} and #{enddate}
where tenant_id=#{tenantId} and receive_date between #{startdate} and #{enddate} and is_preview = 0
group by tenant_id
</select>


Loading…
Cancel
Save