zhangherong
2025-06-12 6abc1a2fb78003bb1ea6283d813b8ccc0bcd9b2b
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.jeecg.modules.base.mapper.EnterpriseAdministratorMapper">
 
    <delete id="deleteByMainId" parameterType="java.lang.String">
        DELETE
        FROM  mom_base_enterprise_administrator
        WHERE
             administrator_id = #{mainId}
    </delete>
 
    <select id="selectByMainId" parameterType="java.lang.String" resultType="org.jeecg.modules.base.entity.EnterpriseAdministrator">
        SELECT *
        FROM  mom_base_enterprise_administrator
        WHERE
             administrator_id = #{mainId}
    </select>
    <select id="mapList" resultType="Map">
        select
        t3.id id,
        t3.administrator_id administratorId,
        t3.auth_name authName,
        t3.create_time createTime,
        t4.id enterpriseId,
        t4.code enterpriseCode,
        t4.name enterpriseName,
        t5.account account,
        t5.name name
        from mom_base_enterprise_administrator t3
        left join
        (
            select
                t1.id id,
                t1.code code,
                t1.name name,
                t1.parent_id parentId,
                t1.version version
              from mom_base_enterprise t1
              where t1.del_flag=0
        ) t4
        on t4.id=t3.enterprise_id
        left join (select * from mom_sys_administrator where del_flag=0) t5
        on t3.administrator_id=t5.id
        where
        t3.del_flag = 0
        <if test="mainId != null and mainId != ''">
         and t3.administrator_id = #{mainId}
        </if>
        <if test="enterpriseId != null and enterpriseId != ''">
         and t4.id = #{enterpriseId}
        </if>
    </select>
</mapper>