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
29
30
31
32
<?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.business.SalaryParamMapper">
 
 
    <select id="selectPage" resultType="doumeemes.dao.business.vo.SalaryParamVO">
        SELECT
            sp.*,
            m.`NAME` as materialName,
            m.`CODE` as materialCode,
            p.`NAME` as procedureName,
            su.REALNAME as createUserName,
           d.name as departName
        from
            salary_param sp
        LEFT JOIN procedures p on p.ID = sp.PROCEDURE_ID
        LEFT JOIN material_distribute md on md.ID = sp.MATERIAL_ID
        LEFT JOIN material m on m.ID = md.MATERIAL_ID
        LEFT JOIN department d on sp.DEPART_ID= d.id
        LEFT JOIN `system_user` su  on su.ID = sp.CREATE_USER
        where
        sp.DELETED = 0
        <if test="model.keyWord != null and model.keyWord != ''">
           and  ( m.`NAME` like concat('%',#{model.keyWord},'%')
            or   m.`CODE` = #{model.keyWord})</if>
        <if test="model.procedureName != null and model.procedureName != ''"> and p.`NAME` like concat('%',#{model.procedureName},'%')</if>
        <if test="model.type != null"> and sp.`TYPE` = #{model.type}</if>
        <if test="model.rootDepartId != null"> and sp.`ROOT_DEPART_ID` = #{model.rootDepartId}</if>
        <if test="model.departId != null"> and sp.`DEPART_ID` = #{model.departId}</if>
        order by sp.CREATE_TIME desc
    </select>
</mapper>