linwe
2023-12-01 5d5cd3ad979a0b85ab8c7034dcad1663fdcf71be
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
<?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.grid.mapper.GridmanMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="gridmanResultMap" type="org.springblade.modules.grid.entity.GridmanEntity">
        <result column="id" property="id"/>
        <result column="grid_id" property="gridId"/>
        <result column="user_id" property="userId"/>
        <result column="gridman_name" property="gridmanName"/>
        <result column="mobile" property="mobile"/>
        <result column="remark" property="remark"/>
        <result column="create_time" property="createTime"/>
        <result column="create_user" property="createUser"/>
        <result column="update_time" property="updateTime"/>
        <result column="update_user" property="updateUser"/>
        <result column="is_deleted" property="isDeleted"/>
    </resultMap>
 
    <!--自定义分页查询-->
    <select id="selectGridmanPage" resultType="org.springblade.modules.grid.vo.GridmanVO">
        select
        jgm.*,jg.community_code communityCode
        from jczz_gridman jgm
        left join jczz_grid jg on jg.id = jgm.grid_id and jg.is_deleted = 0
        where jgm.is_deleted = 0
        <if test="gridman.gridmanName!=null and gridman.gridmanName!=''">
            and jgm.gridman_name like concat('%',#{gridman.gridmanName},'%')
        </if>
        <if test="gridman.mobile!=null and gridman.mobile!=''">
            and jgm.mobile like concat('%',#{gridman.mobile},'%')
        </if>
        <if test="gridman.gridId!=null">
            and jg.id = #{gridman.gridId}
        </if>
    </select>
 
    <!--自定义分页查询-->
    <select id="getGridmanList" resultType="org.springblade.modules.grid.vo.GridmanVO">
        select
        jgm.*
        from jczz_gridman jgm
        where jgm.is_deleted = 0
        <if test="gridman.gridmanName!=null and gridman.gridmanName!=''">
            and jgm.gridman_name like concat('%',#{gridman.gridmanName},'%')
        </if>
        <if test="gridman.mobile!=null and gridman.mobile!=''">
            and jgm.mobile like concat('%',#{gridman.mobile},'%')
        </if>
    </select>
 
 
</mapper>