|
|
|
@@ -2,80 +2,83 @@ |
|
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|
|
|
<mapper namespace="com.iformall.mapper.WxBillRentMapper"> |
|
|
|
<resultMap id="BaseResultMap" type="com.iformall.domain.po.WxBillRent"> |
|
|
|
<id column="id" jdbcType="BIGINT" property="id" /> |
|
|
|
<result column="rent_contract_id" jdbcType="BIGINT" property="rentContractId" /> |
|
|
|
<result column="receive_pay" jdbcType="INTEGER" property="receivePay" /> |
|
|
|
<result column="pay" jdbcType="INTEGER" property="pay" /> |
|
|
|
<result column="receive_date" jdbcType="TIMESTAMP" property="receiveDate" /> |
|
|
|
<result column="pay_date" jdbcType="TIMESTAMP" property="payDate" /> |
|
|
|
<result column="createtime" jdbcType="TIMESTAMP" property="createtime" /> |
|
|
|
<result column="expired_day" jdbcType="INTEGER" property="expiredDay" /> |
|
|
|
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId" /> |
|
|
|
<result column="owe" jdbcType="BIGINT" property="owe" /> |
|
|
|
<result column="status" jdbcType="INTEGER" property="status" /> |
|
|
|
<result column="is_del" jdbcType="INTEGER" property="isDel" /> |
|
|
|
<result column="need_pay" jdbcType="INTEGER" property="needPay" /> |
|
|
|
<result column="merchant_id" jdbcType="BIGINT" property="merchantId" /> |
|
|
|
<result column="user_id" jdbcType="BIGINT" property="userId" /> |
|
|
|
<result column="shop_id" jdbcType="BIGINT" property="shopId" /> |
|
|
|
<result column="updatetime" jdbcType="TIMESTAMP" property="updatetime" /> |
|
|
|
|
|
|
|
|
|
|
|
<id column="id" jdbcType="BIGINT" property="id"/> |
|
|
|
<result column="rent_contract_id" jdbcType="BIGINT" property="rentContractId"/> |
|
|
|
<result column="receive_pay" jdbcType="INTEGER" property="receivePay"/> |
|
|
|
<result column="pay" jdbcType="INTEGER" property="pay"/> |
|
|
|
<result column="receive_date" jdbcType="TIMESTAMP" property="receiveDate"/> |
|
|
|
<result column="pay_date" jdbcType="TIMESTAMP" property="payDate"/> |
|
|
|
<result column="createtime" jdbcType="TIMESTAMP" property="createtime"/> |
|
|
|
<result column="expired_day" jdbcType="INTEGER" property="expiredDay"/> |
|
|
|
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> |
|
|
|
<result column="owe" jdbcType="BIGINT" property="owe"/> |
|
|
|
<result column="status" jdbcType="INTEGER" property="status"/> |
|
|
|
<result column="is_del" jdbcType="INTEGER" property="isDel"/> |
|
|
|
<result column="need_pay" jdbcType="INTEGER" property="needPay"/> |
|
|
|
<result column="merchant_id" jdbcType="BIGINT" property="merchantId"/> |
|
|
|
<result column="user_id" jdbcType="BIGINT" property="userId"/> |
|
|
|
<result column="shop_id" jdbcType="BIGINT" property="shopId"/> |
|
|
|
<result column="updatetime" jdbcType="TIMESTAMP" property="updatetime"/> |
|
|
|
|
|
|
|
|
|
|
|
</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` |
|
|
|
</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> |
|
|
|
<if test=" null != shopId "> and `shop_id` = #{shopId} </if> |
|
|
|
<if test=" null != updatetime "> and `updatetime` = #{updatetime} </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 != ids "> |
|
|
|
and id in |
|
|
|
and id in |
|
|
|
<foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> |
|
|
|
#{idItem} |
|
|
|
#{idItem} |
|
|
|
</foreach> |
|
|
|
</if> |
|
|
|
<if test=" null != sortColumns"> order by ${sortColumns} </if> |
|
|
|
</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 |
|
|
|
<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`, |
|
|
|
br.`need_pay` needPay,m.`name` merchantName,s.shop_number shopNumber,br.`updatetime` |
|
|
|
br.`need_pay` needPay,m.`name` merchantName,s.shop_number shopNumber,br.`updatetime`, |
|
|
|
br.`merchant_id` merchantId |
|
|
|
from wx_bill_rent br left join wx_merchant m on br.merchant_id=m.id |
|
|
|
left join wx_shop s on br.shop_id=s.id |
|
|
|
<where> |
|
|
|
<if test=" null != id "> and br.`id` = #{id} </if> |
|
|
|
<if test=" null != merchantId "> and br.`merchant_id` = #{merchantId} </if> |
|
|
|
<if test=" null != tenantId "> and br.`tenant_id` = #{tenantId} </if> |
|
|
|
<if test=" null != status "> and br.`status` = #{status} </if> |
|
|
|
<if test=" null != isDel "> and br.`is_del` = #{isDel} </if> |
|
|
|
|
|
|
|
<if test=" null != id ">and br.`id` = #{id}</if> |
|
|
|
<if test=" null != merchantId ">and br.`merchant_id` = #{merchantId}</if> |
|
|
|
<if test=" null != tenantId ">and br.`tenant_id` = #{tenantId}</if> |
|
|
|
<if test=" null != status ">and br.`status` = #{status}</if> |
|
|
|
<if test=" null != isDel ">and br.`is_del` = #{isDel}</if> |
|
|
|
|
|
|
|
</where> |
|
|
|
order by id |
|
|
|
</select> |
|
|
|
@@ -86,5 +89,10 @@ |
|
|
|
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 DATEDIFF(now(),receive_date)>0 |
|
|
|
</update> |
|
|
|
|
|
|
|
|
|
|
|
</mapper> |