yangys
2025-07-10 88fab7bde2a5c4e5831164fa7db54ab59caa6fb0
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
<?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.mdm.basesetting.producedivision.mapper.ProduceDivisionMapper">
<!--
    &lt;!&ndash; 通用查询映射结果 &ndash;&gt;
    <resultMap id="BaseResultMap" type="org.springblade.mdm.basesetting.machine.entity.Machine">
        <id column="id" property="id"/>
        <result column="code" property="code"/>
        <result column="name" property="name"/>
 
        <result column="status" property="status"/>
        <result column="createTime" property="create_time"/>
        <result column="updateTime" property="update_time"/>
        <result column="is_deleted" property="isDeleted"/>
    </resultMap>-->
    <select id="pageQuery" resultType="org.springblade.mdm.basesetting.producedivision.vo.ProduceDivisionViewVO">
        select p.id,p.drawing_no,p.team_leader_id,p.programmer_id,p.checker_id,p.senior_id,l.name team_leader_name,pro.name  programmer_name,c.name checker_name,s.name seniorName
        from mdm_produce_division p join blade_user l on p.team_leader_id=l.id and l.is_deleted=0
                                join blade_user pro on p.programmer_id=pro.id and pro.is_deleted=0
                                join blade_user c on p.checker_id=c.id and c.is_deleted=0
                                join blade_user s on p.senior_id=s.id and c.is_deleted=0
                                                         where p.is_deleted=0
        <if test="name != null and name != ''">
            AND (l.account like concat('%',#{name,jdbcType=VARCHAR},'%') or l.name like
            concat('%',#{name,jdbcType=VARCHAR},'%')
            or pro.account like concat('%',#{name,jdbcType=VARCHAR},'%') or pro.name like
            concat('%',#{name,jdbcType=VARCHAR},'%')
            or c.account like concat('%',#{name,jdbcType=VARCHAR},'%') or c.name like
            concat('%',#{name,jdbcType=VARCHAR},'%')
            or s.account like concat('%',#{name,jdbcType=VARCHAR},'%') or s.name like
            concat('%',#{name,jdbcType=VARCHAR},'%')
            )
        </if>
    </select>
 
</mapper>