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
<?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_dangjian.dao.ComActProjectMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.panzhihua.service_dangjian.entity.ComActProject">
        <id column="id" property="id" />
        <result column="unit_id" property="unitId" />
        <result column="unit_name" property="unitName" />
        <result column="speciality" property="speciality" />
        <result column="project" property="project" />
        <result column="phone" property="phone" />
        <result column="image" property="image" />
        <result column="create_time" property="createTime" />
    </resultMap>
 
    <select id="getList" resultMap="BaseResultMap">
        select
            id,
            unit_id,
            unit_name,
            speciality,
            project,
            phone,
            image,
            create_time
        from com_act_project
        <where>
            1=1
            <if test="item.unitId !=null and item.unitId !='' ">
                and unit_id=#{item.unitId}
            </if>
            <if test="item.speciality !=null and item.speciality !='' ">
                and (speciality like concat ('%',#{item.speciality},'%') or #{item.speciality} like concat ('%',speciality,'%'))
            </if>
            <if test="item.project !=null and item.project !='' ">
                and project like concat ('%',#{item.project},'%')
            </if>
        </where>
        order by create_time desc
    </select>
 
 
</mapper>