<?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.stm.audit.mapper.AuditProjectItemMapper">

    <select id="getAllProjectItems" resultType="java.util.Map">
        SELECT distinct A.name,A.tp,A.des,A.id,
        CASE
        WHEN A.tp = 1 THEN '工具要求'
        WHEN A.tp = 2 THEN '记录要求'
        WHEN A.tp = 3 THEN '制度要求'
        WHEN A.tp = 4 THEN '查阅系统'
        WHEN A.tp = 5 THEN '访谈人员'
        WHEN A.tp = 6 THEN '流程要求'
        WHEN A.tp = 9 THEN '其他要求'
        ELSE A.tp
        END AS tpname
        FROM  audit_project_item A
        <where>
            <if test="query.name!=null">
                A.name like CONCAT('%',#{query.name},'%')
            </if>
            <if test="query.pid!=null">
                and A.pid =  #{query.pid}
            </if>
        </where>
        order by A.name
    </select>
</mapper>