|
- <?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.simple.mapper.WxBillRentMapper">
- <resultMap id="BaseResultMap" type="com.simple.domain.po.WxBillRent">
- <id column="id" jdbcType="BIGINT" property="id" />
- <result column="shop_id" jdbcType="BIGINT" property="shopId" />
- <result column="user_area" jdbcType="DECIMAL" property="userArea" />
- <result column="price" jdbcType="DECIMAL" property="price" />
- <result column="need_pay" jdbcType="DECIMAL" property="needPay" />
- <result column="receive_pay" jdbcType="DECIMAL" property="receivePay" />
- <result column="pay" jdbcType="DECIMAL" property="pay" />
- <result column="receive_period" jdbcType="INTEGER" property="receivePeriod" />
- <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="pay_way" jdbcType="INTEGER" property="payWay" />
- <result column="receipt_num" jdbcType="VARCHAR" property="receiptNum" />
- <result column="tenant_id" jdbcType="VARCHAR" property="tenantId" />
- <result column="owe" jdbcType="DECIMAL" property="owe" />
- <result column="pay_status" jdbcType="Integer" property="payStatus" />
-
- </resultMap>
-
- <sql id="allColumns">
- `id`,`shop_id`,`user_area`,`price`,`need_pay`,`receive_pay`,`pay`,`receive_period`,`receive_date`,`pay_date`,`createtime`,`expired_day`,`pay_way`,`receipt_num`,`tenant_id`,`owe`,`pay_status`
- </sql>
-
- <sql id="dynamicWhereConditions">
- where 1 = 1
- <if test=" null != id "> and `id` = #{id} </if>
- <if test=" null != shopId "> and `shop_id` = #{shopId} </if>
- <if test=" null != userArea "> and `user_area` = #{userArea} </if>
- <if test=" null != price "> and `price` = #{price} </if>
- <if test=" null != needPay "> and `need_pay` = #{needPay} </if>
- <if test=" null != receivePay "> and `receive_pay` = #{receivePay} </if>
- <if test=" null != pay "> and `pay` = #{pay} </if>
- <if test=" null != receivePeriod "> and `receive_period` = #{receivePeriod} </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 != payWay "> and `pay_way` = #{payWay} </if>
- <if test=" null != receiptNum "> and `receipt_num` = #{receiptNum} </if>
- <if test=" null != tenantId "> and `tenant_id` = #{tenantId} </if>
- <if test=" null != ids ">
- and id in
- <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
- #{idItem}
- </foreach>
- </if>
- <if test=" null != sortColumns"> order by ${sortColumns} </if>
- </sql>
-
- <select id="findList" parameterType="com.simple.domain.po.WxBillRent" resultMap="BaseResultMap">
- select <include refid="allColumns" /> from wx_bill_rent
- <include refid="dynamicWhereConditions" />
- </select>
-
- <select id="findListMap" parameterType="com.simple.domain.po.WxBillRent" resultType="hashmap">
- select br.id,br.shop_id shopId,br.user_area userArea,br.price,br.need_pay needPay,br.receive_pay receivePay,
- br.pay,br.receive_period receivePeriod,br.receive_date receiveDate,br.pay_date payDate,br.createtime,
- br.expired_day expiredDay,br.pay_way payWay,br.receipt_num receiptNum,m.`name` merchantName,
- s.build_area buildArea,s.operation_area operationArea,s.shop_number shopNumber,br.owe,br.pay_status payStatus
- from wx_bill_rent br left join wx_merchant_shop ms on br.shop_id=ms.shop_id and ms.is_del=0
- inner join wx_merchant m on ms.merchant_id=m.id
- inner join wx_shop s on ms.shop_id=s.id
- where 1 = 1
- <if test=" null != id "> and br.`id` = #{id} </if>
- <if test=" null != shopId "> and br.`shop_id` = #{shopId} </if>
- <if test=" null != userArea "> and br.`user_area` = #{userArea} </if>
- <if test=" null != price "> and br.`price` = #{price} </if>
- <if test=" null != needPay "> and br.`need_pay` = #{needPay} </if>
- <if test=" null != receivePay "> and br.`receive_pay` = #{receivePay} </if>
- <if test=" null != pay "> and br.`pay` = #{pay} </if>
- <if test=" null != receivePeriod "> and br.`receive_period` = #{receivePeriod} </if>
- <if test=" null != receiveDate "> and br.`receive_date` = #{receiveDate} </if>
- <if test=" null != payDate "> and br.`pay_date` = #{payDate} </if>
- <if test=" null != createtime "> and br.`createtime` = #{createtime} </if>
- <if test=" null != expiredDay "> and br.`expired_day` = #{expiredDay} </if>
- <if test=" null != payWay "> and br.`pay_way` = #{payWay} </if>
- <if test=" null != receiptNum "> and br.`receipt_num` = #{receiptNum} </if>
- <if test=" null != tenantId "> and br.`tenant_id` = #{tenantId} </if>
- <if test=" null != shopNumber "> and br.`shop_number` = #{shopNumber} </if>
- <if test=" null != payStatus "> and br.`pay_status` = #{payStatus} </if>
-
- <if test=" null != ids ">
- and br.id in
- <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
- #{idItem}
- </foreach>
- </if>
- <if test=" null != sortColumns"> order by br.${sortColumns} </if>
- </select>
-
-
- <select id="queryPayInfo" resultType="hashmap" parameterType="hashmap">
- select sum(receive_pay) receivepay,sum(pay) pay,tenant_id from wx_bill_rent
- where tenant_id=#{tenantId} and date_format(receive_date,'%Y-%m')=#{receiveDate}
- group by tenant_id
- </select>
-
-
- </mapper>
|