linwei
2024-01-29 87c0cb5ed6477f1760034bcf1de608102b29e442
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<?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="org.springblade.modules.place.mapper.PlaceCheckMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="placeCheckResultMap" type="org.springblade.modules.place.vo.PlaceCheckVO">
        <result column="id" property="id"/>
        <result column="house_code" property="houseCode"/>
        <result column="remark" property="remark"/>
        <result column="image_urls" property="imageUrls"/>
        <result column="signature_path" property="signaturePath"/>
        <result column="create_user" property="createUser"/>
        <result column="create_time" property="createTime"/>
        <result column="is_deleted" property="isDeleted"/>
 
        <collection property="patrolRecordVOList" column="id" select="selectTaskRepairStepList"
                    javaType="java.util.List" ofType="org.springblade.modules.patrol.entity.PatrolRecord"
                    autoMapping="true">
            <id property="placeCheckId" column="id"/>
        </collection>
    </resultMap>
 
    <!--自定义分页查询-->
    <select id="selectPlaceCheckPage" resultMap="placeCheckResultMap">
        select * from jczz_place_check where is_deleted = 0
        <if test="placeCheck.houseCode!=null and placeCheck.houseCode!=''">
            and house_code = #{placeCheck.houseCode}
        </if>
        <if test="placeCheck.startTime!=null and placeCheck.startTime!=''">
            and date_format(create_time,'%Y-%m-%d') &gt;= #{placeCheck.startTime}
        </if>
        <if test="placeCheck.endTime!=null and placeCheck.endTime!=''">
            and date_format(create_time,'%Y-%m-%d') &lt;= #{placeCheck.endTime}
        </if>
    </select>
 
 
<!--    <resultMap type="org.springblade.modules.dto.PlaceCheckDTO" id="PlaceCheckDTOResult">-->
<!--        <result property="id"    column="id"    />-->
<!--        <result property="houseCode"    column="house_code"    />-->
<!--        <result property="remark"    column="remark"    />-->
<!--        <result property="signaturePath"    column="signature_path"    />-->
<!--        <result property="createUser"    column="create_user"    />-->
<!--        <result property="createTime"    column="create_time"    />-->
<!--        <result property="isDeleted"    column="is_deleted"    />-->
<!--    </resultMap>-->
 
    <sql id="selectPlaceCheck">
        select
            id,
            house_code,
            remark,
            signature_path,
            create_user,
            create_time,
            is_deleted
        from
            jczz_place_check
    </sql>
 
<!--    <select id="selectPlaceCheckById" parameterType="long" resultMap="PlaceCheckDTOResult">-->
<!--        <include refid="selectPlaceCheck"/>-->
<!--        where-->
<!--        id = #{id}-->
<!--    </select>-->
 
<!--    <select id="selectPlaceCheckList" parameterType="org.springblade.modules.dto.PlaceCheckDTO" resultMap="PlaceCheckDTOResult">-->
<!--        <include refid="selectPlaceCheck"/>-->
<!--        <where>-->
<!--            <if test="id != null "> and id = #{id}</if>-->
<!--            <if test="houseCode != null  and houseCode != ''"> and house_code = #{houseCode}</if>-->
<!--            <if test="remark != null  and remark != ''"> and remark = #{remark}</if>-->
<!--            <if test="signaturePath != null  and signaturePath != ''"> and signature_path = #{signaturePath}</if>-->
<!--            <if test="createUser != null "> and create_user = #{createUser}</if>-->
<!--            <if test="createTime != null "> and create_time = #{createTime}</if>-->
<!--            <if test="isDeleted != null "> and is_deleted = #{isDeleted}</if>-->
<!--        </where>-->
<!--    </select>-->
 
 
 
</mapper>