Преглед изворни кода

[账单通知][添加][查询语句]

release_toaliyun_real
gongbiao пре 7 година
родитељ
комит
594201fcdd
2 измењених фајлова са 77 додато и 5 уклоњено
  1. +75
    -0
      mallinkService/src/main/resources/mapper/WxBillAllMapper.xml
  2. +2
    -5
      mallinkService/src/main/resources/mapper/WxRentContractMapper.xml

+ 75
- 0
mallinkService/src/main/resources/mapper/WxBillAllMapper.xml Прегледај датотеку

@@ -212,4 +212,79 @@
</select> </select>
<select id="getWaitPayBill" resultType="hashmap">
select bill.merchant_id merchantId,bill.receive_date,bill.need_pay needPay,m.link_phone linkPhone from (
select 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
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,''
endtime,rent_shop_type from wx_bill_rent_deposit
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
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,''
endtime,rent_shop_type from wx_bill_property_deposit
union
select id,merchant_id,shop_id,tenant_id,'水费' name,5 bill_type_value,'水费' bill_type,0 as
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_daily where type=1
union
select id,merchant_id,shop_id,tenant_id,'电费' name,6 bill_type_value,'电费' bill_type,0 as
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_daily where type=2
union
select id,merchant_id,shop_id,tenant_id,name,7 bill_type_value,'其他' bill_type,0 as
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_other
) bill
where DATEDIFF(bill.receive_date,now())=3 and bill.status!=3
group by bill.merchant_id,bill.receive_date) bill
left join wx_merchant m on bill.merchant_id=m.id
</select>
<select id="getOweBill" resultType="hashmap">
select bill.merchant_id merchantId,bill.owe,m.link_phone linkPhone from (
select 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
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,''
endtime,rent_shop_type from wx_bill_rent_deposit
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
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,''
endtime,rent_shop_type from wx_bill_property_deposit
union
select id,merchant_id,shop_id,tenant_id,'水费' name,5 bill_type_value,'水费' bill_type,0 as
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_daily where type=1
union
select id,merchant_id,shop_id,tenant_id,'电费' name,6 bill_type_value,'电费' bill_type,0 as
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_daily where type=2
union
select id,merchant_id,shop_id,tenant_id,name,7 bill_type_value,'其他' bill_type,0 as
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_other
) bill
where DATEDIFF(bill.receive_date,now())&lt;0 and bill.status!=3
group by bill.merchant_id) bill
left join wx_merchant m on bill.merchant_id=m.id
</select>

</mapper> </mapper>

+ 2
- 5
mallinkService/src/main/resources/mapper/WxRentContractMapper.xml Прегледај датотеку

@@ -38,7 +38,6 @@
<result column="apply_status" jdbcType="INTEGER" property="applyStatus"/> <result column="apply_status" jdbcType="INTEGER" property="applyStatus"/>
<result column="bank_name" jdbcType="VARCHAR" property="bankName"/> <result column="bank_name" jdbcType="VARCHAR" property="bankName"/>
<result column="rent_shop_type" jdbcType="INTEGER" property="rentShopType"/> <result column="rent_shop_type" jdbcType="INTEGER" property="rentShopType"/>
<result column="way" jdbcType="INTEGER" property="way"/>
</resultMap> </resultMap>
@@ -47,7 +46,7 @@
`tenant_id`,`filepath`,`status`,`contract_number`,`deposit`,`pay_date`,`is_del`,`merchant_name`, `tenant_id`,`filepath`,`status`,`contract_number`,`deposit`,`pay_date`,`is_del`,`merchant_name`,
`brand`,`business_id`,`shop_type`,`shop_id`,`updatetime`,`createtime`,`link_person`,`link_phone`, `brand`,`business_id`,`shop_type`,`shop_id`,`updatetime`,`createtime`,`link_person`,`link_phone`,
`pay_account`,`filename`,`lease`,`type`,`revenue`,`adjust_ratio`,`adjust_period`,`pay_ratio`, `pay_account`,`filename`,`lease`,`type`,`revenue`,`adjust_ratio`,`adjust_period`,`pay_ratio`,
`start_date`,`end_date`,`apply_status`,`bank_name`,`rent_shop_type`,`way`
`start_date`,`end_date`,`apply_status`,`bank_name`,`rent_shop_type`
</sql> </sql>
@@ -83,7 +82,6 @@
<if test=" null != startDate ">and `start_date` = #{startDate}</if> <if test=" null != startDate ">and `start_date` = #{startDate}</if>
<if test=" null != endDate ">and `end_date` = #{endDate}</if> <if test=" null != endDate ">and `end_date` = #{endDate}</if>
<if test=" null != rentShopType ">and `rent_shop_type` = #{rentShopType}</if> <if test=" null != rentShopType ">and `rent_shop_type` = #{rentShopType}</if>
<if test=" null != way ">and `way` = #{way}</if>
<if test=" null != ids "> <if test=" null != ids ">
and id in and id in
@@ -107,7 +105,7 @@
rc.lease,rc.filepath,rc.filename,rc.pay_account payAccount,rc.sign_date signDate,rc.merchant_id merchantId,rc.type, rc.lease,rc.filepath,rc.filename,rc.pay_account payAccount,rc.sign_date signDate,rc.merchant_id merchantId,rc.type,
rc.start_date startDate,rc.end_date endDate,br.`name` brandName,rc.apply_status applyStatus,rc.bank_name rc.start_date startDate,rc.end_date endDate,br.`name` brandName,rc.apply_status applyStatus,rc.bank_name
bankName, bankName,
rc.rent_shop_type rentShopType,rc.way
rc.rent_shop_type rentShopType
from wx_rent_contract rc from wx_rent_contract rc
left join wx_shop s on rc.shop_id=s.id left join wx_shop s on rc.shop_id=s.id
left join wx_mall_floor f on s.floor=f.id left join wx_mall_floor f on s.floor=f.id
@@ -121,7 +119,6 @@
<if test=" null != shopId ">and rc.`shop_id` = #{shopId}</if> <if test=" null != shopId ">and rc.`shop_id` = #{shopId}</if>
<if test=" null != type ">and rc.`type` = #{type}</if> <if test=" null != type ">and rc.`type` = #{type}</if>
<if test=" null != rentShopType ">and rc.`rent_shop_type` = #{rentShopType}</if> <if test=" null != rentShopType ">and rc.`rent_shop_type` = #{rentShopType}</if>
<if test=" null != way ">and rc.`way` = #{way}</if>
</where> </where>
order by rc.id desc order by rc.id desc


Loading…
Откажи
Сачувај