jiangping
2023-08-21 2837bdd57f72e386bbf9a725e7b3a13e5eb9e930
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
<?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="doumeemes.dao.ext.CompanyLogExtMapper">
 
 
    <select id="selectPage" resultType="doumeemes.dao.business.model.CompanyLog">
        SELECT
            co.name as companyName,
            su.REALNAME as updateUserName,
        dept.name AS shortName,
            cl.*
        FROM
            company_log cl
        LEFT JOIN company co ON cl.COMPANY_ID = co.id
        LEFT JOIN SYSTEM_USER su ON su.id = cl.UPDATE_USER
        left join department dept on dept.COMPANY_ID = co.ID and  dept.PARENT_ID IS NULL AND dept.TYPE != 4
        <where>
            <if test="companyName != null and companyName != ''">
                co.name LIKE CONCAT('%',#{companyName},'%')
            </if>
            <if test="type != null">
                AND cl.UPDATE_TYPE = #{type}
            </if>
        </where>
        order by cl.id desc
 
    </select>
</mapper>