<?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="com.zcloud.modules.oa.dao.OaPostDao">

    <!--分页查询-->
    <select id="listPage" resultType="java.util.Map">
        SELECT
            p.*,
            d.name department_name
        FROM oa_post p
        left join oa_department d on d.department_id = p.department_id
        where
            d.is_delete = 0
            and p.is_delete = 0
            <if test="params.corpinfoId != null and params.corpinfoId != ''">
                AND p.corpinfo_id = #{params.corpinfoId}
            </if>
            <if test="params.name != null and params.name != ''">
                    AND p.name like concat('%',#{params.name},'%')
            </if>
        ORDER BY d.level asc, d.order_by, p.order_by
    </select>
</mapper>
