MethodMapper.xml 980 Bytes
Newer Older
qinhu's avatar
1  
qinhu committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
<?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="cn.wise.sc.cement.business.mapper.MethodMapper">
    <sql id="where">
        <where>
            <if test="params.standard != null and params.standard != ''">
                and t.standard = #{params.standard}
            </if>
            <if test="params.name != null and params.name != ''">
                and t.name like concat('%', #{params.name}, '%')
            </if>
        </where>
    </sql>

    <select id="exportList" resultType="java.util.HashMap">
        SELECT
        (@i:=@i+1) as 序号,
        t.name as 检测依据名,
        t.standard as 标准号,
竹天卫's avatar
竹天卫 committed
20
        t.number as 检测依据编号,
qinhu's avatar
1  
qinhu committed
21 22 23 24 25 26 27 28
        t.do_date as 实施日期,
        t.up_date as 更新日期
        FROM method t ,(select @i:=0)t
        <include refid="where"/>
        ORDER BY t.id DESC
    </select>

</mapper>