<?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.panzhihua.service_community.dao.RentingHoursePreOrderDao">
|
|
<resultMap type="com.panzhihua.service_community.entity.RentingHoursePreOrder"
|
id="RentingHoursePreOrderBaseResultMap">
|
<result property="id" column="id"/>
|
<result property="orderSn" column="order_sn"/>
|
<result property="registerId" column="register_id"/>
|
<result property="dingMoney" column="ding_money"/>
|
<result property="contractText" column="contract_text"/>
|
<result property="status" column="status"/>
|
<result property="expireDate" column="expire_date"/>
|
<result property="hourseOwnerWeixinAppid" column="hourse_owner_weixin_appid"/>
|
<result property="hourseOwnerUserId" column="hourse_owner_user_id"/>
|
<result property="tenantWeixinAppid" column="tenant_weixin_appid"/>
|
<result property="tenantUserId" column="tenant_user_id"/>
|
<result property="createUser" column="create_user"/>
|
<result property="createDate" column="create_date"/>
|
</resultMap>
|
|
<select id="pageList" resultType="com.panzhihua.common.model.vos.community.rentHouse.RentingHoursePreOrderVO">
|
select t.*,t2.url from renting_hourse_pre_order t left join renting_hourse_file t2 on t.register_id = t2.ref_id
|
<where>
|
1=1 and t2.type=1 and classification = 1
|
<if test="commonPage.communityId!=null and commonPage.communityId!=0">
|
and t.community_id = ${commonPage.communityId}
|
</if>
|
<if test="commonPage.userId!=null">
|
and t.create_user=#{commonPage.userId}
|
</if>
|
<if test="commonPage.keyword!=null and commonPage.keyword !=''">
|
and ( t.village_name like concat('%',#{commonPage.keyword},'%') or t.order_sn like concat('%',#{commonPage.keyword},'%') or t.pay_sn like concat('%',#{commonPage.keyword},'%'))
|
</if>
|
</where>
|
group by t.id order by t.create_date desc
|
</select>
|
|
<select id="statics" resultType="com.panzhihua.common.model.vos.community.rentHouse.PreOrderStatics">
|
select * from (
|
(select count(ding_money) as allOrder from renting_hourse_pre_order where 1=1 <if test="communityId !=null and communityId !=0">and community_id = ${communityId}</if> ) allOrder,
|
(select count(ding_money) as allRefuse from renting_hourse_pre_order where (status = 3 or status =4) <if test="communityId !=null and communityId !=0">and community_id = ${communityId}</if>) allRefuse,
|
(select count(*) as refuseNum from renting_hourse_pre_order where (status = 3 or status =4) <if test="communityId !=null and communityId !=0">and community_id = ${communityId}</if>) refuseNum,
|
(select count(ding_money) as settledOrder from renting_hourse_pre_order where status = 2 <if test="communityId !=null and communityId !=0">and community_id = ${communityId}</if>) settledOrder,
|
(select count(ding_money) as deductOrder from renting_hourse_pre_order where status = 1 <if test="communityId !=null and communityId !=0">and community_id = ${communityId}</if>) deductOrder )
|
</select>
|
|
</mapper>
|