|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.iformall.mapper.WxBillSettleScheduleMapper">
- <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxBillSettleSchedule">
- <id column="id" property="id"/>
- <result column="tenant_id" property="tenantId"/>
- <result column="parent_tenant_id" property="parentTenantId"/>
- <result column="settle_number" property="settleNumber"/>
- <result column="merchant_id" property="merchantId"/>
- <result column="status" property="status"/>
- <result column="apply_status" property="applyStatus"/>
- <result column="receiveMoney" property="receiveMoney"/>
- <result column="payMoney" property="payMoney"/>
- <result column="settletime" property="settletime"/>
- <result column="createtime" property="createtime"/>
- <result column="updatetime" property="updatetime"/>
- <result column="merchantName" property="merchantName"/>
- <result column="settle_receive_pay" property="settleReceivePay"/>
- </resultMap>
-
- <sql id="allColumns">
- `id`,`tenant_id`,`parent_tenant_id`,`settle_number`,`merchant_id`,`status`,`apply_status`,
- `receive_money`,`pay_money`,`settletime`,`createtime`,`updatetime`,`settle_receive_pay`
- </sql>
-
- <insert id = "createScheduleFromBillSettle" parameterType= "hashmap">
- insert into wx_bill_settle_schedule(`id`,`tenant_id`,`parent_tenant_id`,`settle_number`,`merchant_id`,`status`,`apply_status`,`receive_money`,`pay_money`,`settletime`,`createtime`,
- `updatetime`,`settle_receive_pay`)
- select `id`,`tenant_id`,`parent_tenant_id`,`settle_number`,`merchant_id`,`status`,`apply_status`,`receive_money`,`pay_money`,`settletime`,`createtime`,`updatetime`,#{settleReceivePay}
- from wx_bill_settle where id = #{id}
- </insert>
-
- <select id="listToSettleBillIdList" resultType="Long" parameterType="com.iformall.domain.vo.WxBillAll">
- select s.id from wx_bill_settle s where has_recorded != 1 and s.status > 0
- <if test=" null != tenantId and '' != tenantId">
- and s.`tenant_id` = #{tenantId}
- </if>
- <if test=" null != parentTenantId and '' != parentTenantId">
- and s.`parent_tenant_id` = #{parentTenantId}
- </if>
- </select>
-
- <select id="listBillSettleBillBillId" resultType="Long" parameterType="hashmap">
- select bb.bill_id from wx_bill_settle_bill bb where bb.settle_id = #{settleId} and bb.type=#{type}
- </select>
-
- <select id="calculteRentRecivePay" resultType="Double" parameterType="com.iformall.domain.po.WxBillRent">
- select IFNULL(sum( (receive_pay+service_charge_pay+ifnull(late_pay_price,0)-pay)),0) owe
- from wx_bill_rent where is_preview = 0 and tenant_id = #{tenantId}
- <if test=" null != idList ">
- and `id` in
- <foreach collection="idList" index="index" item="idItem" open="(" separator="," close=")">
- #{idItem}
- </foreach>
- </if>
- </select>
-
- <select id="calculteRentDepositRecivePay" resultType="Double" parameterType="com.iformall.domain.po.WxBillRent">
- select IFNULL(sum( (receive_pay-pay)),0) owe
- from wx_bill_rent_deposit where tenant_id = #{tenantId}
- <if test=" null != idList ">
- and `id` in
- <foreach collection="idList" index="index" item="idItem" open="(" separator="," close=")">
- #{idItem}
- </foreach>
- </if>
- </select>
-
- <select id="calcultePropertyRecivePay" resultType="Double" parameterType="com.iformall.domain.po.WxBillProperty">
- select IFNULL(sum( (receive_pay+service_charge_pay+ifnull(late_pay_price,0)-pay)),0) owe
- from wx_bill_property where is_preview = 0 and tenant_id = #{tenantId}
- <if test=" null != idList ">
- and `id` in
- <foreach collection="idList" index="index" item="idItem" open="(" separator="," close=")">
- #{idItem}
- </foreach>
- </if>
- </select>
-
- <select id="calcultePropertyDepositRecivePay" resultType="Double" parameterType="com.iformall.domain.po.WxBillProperty">
- select IFNULL(sum( (receive_pay-pay)),0) owe
- from wx_bill_property_deposit where tenant_id = #{tenantId}
- <if test=" null != idList ">
- and `id` in
- <foreach collection="idList" index="index" item="idItem" open="(" separator="," close=")">
- #{idItem}
- </foreach>
- </if>
- </select>
-
- <select id="calculteDailyRecivePay" resultType="Double" parameterType="com.iformall.domain.po.WxBillDaily">
- select IFNULL(sum( (receive_pay+service_charge_pay-pay)),0) owe
- from wx_bill_daily where tenant_id = #{tenantId} and type in (1,2,3)
- <if test=" null != idList ">
- and `id` in
- <foreach collection="idList" index="index" item="idItem" open="(" separator="," close=")">
- #{idItem}
- </foreach>
- </if>
- </select>
-
- <select id="calculteOtherRecivePay0" resultType="Double" parameterType="com.iformall.domain.po.WxBillOther">
- select IFNULL(sum( (receive_pay+service_charge_pay-pay)),0) owe
- from wx_bill_other where tenant_id = #{tenantId}
- <if test=" null != idList ">
- and `id` in
- <foreach collection="idList" index="index" item="idItem" open="(" separator="," close=")">
- #{idItem}
- </foreach>
- </if>
- </select>
-
- <select id="calculteOtherRecivePay1" resultType="Double" parameterType="com.iformall.domain.po.WxBillOther">
- select IFNULL(sum( owe ),0) owe
- from wx_bill_other where tenant_id = #{tenantId}
- <if test=" null != idList ">
- and `id` in
- <foreach collection="idList" index="index" item="idItem" open="(" separator="," close=")">
- #{idItem}
- </foreach>
- </if>
- </select>
-
- <select id="calculteOtherDepositRecivePay0" resultType="Double" parameterType="com.iformall.domain.po.WxBillOther">
- select IFNULL(sum( (receive_pay+service_charge_pay-pay)),0) owe
- from wx_bill_other_deposit where tenant_id = #{tenantId}
- <if test=" null != idList ">
- and `id` in
- <foreach collection="idList" index="index" item="idItem" open="(" separator="," close=")">
- #{idItem}
- </foreach>
- </if>
- </select>
-
- <select id="calculteMerchantSubsidyRecivePay1" resultType="Double" parameterType="com.iformall.domain.po.WxMerchantSubsidy">
- select IFNULL(sum( subsidy),0) owe
- from wx_merchant_subsidy where tenant_id = #{tenantId}
- <if test=" null != idList ">
- and `id` in
- <foreach collection="idList" index="index" item="idItem" open="(" separator="," close=")">
- #{idItem}
- </foreach>
- </if>
- </select>
-
- </mapper>
-
|