mitao
2025-02-21 31573d6180d15ef65ed0df9c2732495f40b12663
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?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>