ConsumablesMapper.xml 1.02 KB
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 20 21 22 23 24 25 26 27 28 29 30 31
<?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.ConsumablesMapper">

    <sql id="where">
        <where>
            <if test="params.name != null and params.name != ''">
                and t.name like concat('%', #{params.name}, '%')
            </if>
            <if test="params.supplierName != null and params.supplierName != ''">
                and t.supplier_name = #{params.supplierName}
            </if>
        </where>
    </sql>

    <select id="exportList" resultType="java.util.HashMap">
        SELECT
        (@i:=@i+1) as 序号,
        t.name as 易耗品名称,
        t.code as '易耗品代号',
        t.supplier_name as 供应商,
        t.position as 位置,
        t.purchase_date as 购买日期,
        t.stock_num as 库存数量
        FROM consumables t ,(select @i:=0)t
        <include refid="where"/>
        ORDER BY t.id DESC
    </select>


</mapper>