<?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>
-
qinhu authored56f766fe