吉安感知网项目-后端
linwei
4 hours ago 08ddfad4530a014094c06fe68b8c2d9a0753403a
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
83
84
85
86
<?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.sxkj.gd.flyer.mapper.GdFlyerMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="gdFlyerResultMap" type="org.sxkj.gd.flyer.entity.GdFlyerEntity">
        <result column="id" property="id"/>
        <result column="flyer_name" property="flyerName"/>
        <result column="flyer_phone" property="flyerPhone"/>
        <result column="flight_hours" property="flightHours"/>
        <result column="project_experience" property="projectExperience"/>
        <result column="technical_strength" property="technicalStrength"/>
        <result column="skilled_uav_type" property="skilledUavType"/>
        <result column="skilled_task_type" property="skilledTaskType" typeHandler="org.sxkj.common.handler.GenericListTypeHandler"/>
        <result column="area_code" property="areaCode"/>
        <result column="flyer_address" property="flyerAddress"/>
        <result column="certification" property="certification" typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler"/>
        <result column="create_user" property="createUser"/>
        <result column="create_dept" property="createDept"/>
        <result column="create_time" property="createTime"/>
        <result column="update_user" property="updateUser"/>
        <result column="update_time" property="updateTime"/>
        <result column="status" property="status"/>
        <result column="is_deleted" property="isDeleted"/>
    </resultMap>
 
    <resultMap id="gdFlyerVOResultMap" type="org.sxkj.gd.flyer.vo.GdFlyerVO">
        <result column="id" property="id"/>
        <result column="flyer_id" property="flyerId"/>
        <result column="flyer_name" property="flyerName"/>
        <result column="flyer_phone" property="flyerPhone"/>
        <result column="flight_hours" property="flightHours"/>
        <result column="project_experience" property="projectExperience"/>
        <result column="technical_strength" property="technicalStrength"/>
        <result column="skilled_uav_type" property="skilledUavType"/>
        <result column="skilled_task_type" property="skilledTaskType" typeHandler="org.sxkj.common.handler.GenericListTypeHandler"/>
        <result column="area_code" property="areaCode"/>
        <result column="flyer_address" property="flyerAddress"/>
        <result column="certification" property="certification" typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler"/>
        <result column="area_match_flag" property="areaMatchFlag"/>
    </resultMap>
 
    <select id="selectGdFlyerPage" resultMap="gdFlyerVOResultMap">
        select
            *,
            CASE
                WHEN CAST(#{param2.skilledTaskType} AS VARCHAR) IS NOT NULL
                     AND CAST(#{param2.skilledTaskType} AS VARCHAR) != ''
                     AND skilled_task_type = #{param2.skilledTaskType} THEN 1
                ELSE 0
            END as area_match_flag
        from
            ja_gd_flyer
        <where>
                is_deleted = 0
            <if test="param2.flyerName != null and param2.flyerName != ''">
                and flyer_name like concat('%',#{param2.flyerName},'%')
            </if>
            <if test="param2.flyerPhone != null and param2.flyerPhone != ''">
                and flyer_phone like concat('%',#{param2.flyerPhone},'%')
            </if>
            <if test="param2.technicalStrength != null and param2.technicalStrength != ''">
                and technical_strength = #{param2.technicalStrength}
            </if>
            <if test="param2.skilledUavType != null and param2.skilledUavType != ''">
                and skilled_uav_type = #{param2.skilledUavType}
            </if>
            <!-- <if test="param2.skilledTaskType != null and param2.skilledTaskType != ''"> -->
            <!--     and skilled_task_type = #{param2.skilledTaskType} -->
            <!-- </if> -->
            <!-- <if test="param2.deptList != null and param2.deptList.size > 0"> -->
            <!--     AND create_dept in -->
            <!--     <foreach collection="param2.deptList" item="deptId" open="(" separator="," close=")"> -->
            <!--         #{deptId} -->
            <!--     </foreach> -->
            <!-- </if> -->
        </where>
        ORDER BY area_match_flag DESC, create_time DESC
    </select>
 
 
    <select id="exportGdFlyer" resultType="org.sxkj.gd.flyer.excel.GdFlyerExcel">
        SELECT * FROM ja_gd_flyer ${ew.customSqlSegment}
    </select>
 
</mapper>