|
|
|
<?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.zilber.boot.intelligencesite.mapper.IMaterialsMapper">
|
|
|
|
|
|
|
|
<resultMap id="IMaterialsResult" type="com.zilber.boot.intelligencesite.entity.IMaterials">
|
|
|
|
<result property="id" column="id" jdbcType="INTEGER"/>
|
|
|
|
<result property="name" column="name" jdbcType="VARCHAR"/>
|
|
|
|
<result property="specification" column="specification" jdbcType="VARCHAR"/>
|
|
|
|
<result property="unit" column="unit" jdbcType="VARCHAR"/>
|
|
|
|
<result property="planNeed" column="plan_need" jdbcType="INTEGER"/>
|
|
|
|
<result property="actualIn" column="actual_in" jdbcType="INTEGER"/>
|
|
|
|
<result property="surplus" column="surplus" jdbcType="INTEGER"/>
|
|
|
|
<result property="supplierName" column="supplier_name" jdbcType="VARCHAR"/>
|
|
|
|
<result property="purchaseTime" column="purchase_time" jdbcType="TIMESTAMP"/>
|
|
|
|
<result property="planUseTime" column="plan_use_time" jdbcType="TIMESTAMP"/>
|
|
|
|
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
|
|
|
<result property="creator" column="creator" jdbcType="VARCHAR"/>
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
<sql id="selectIMaterialsVo">
|
|
|
|
select
|
|
|
|
id, name, specification, unit, plan_need, actual_in, surplus, supplier_name, purchase_time, plan_use_time, create_time, creator from i_materials
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
|
|
<select id="queryList" parameterType="com.zilber.boot.intelligencesite.entity.IMaterials" resultMap="IMaterialsResult">
|
|
|
|
<include refid="selectIMaterialsVo"/>
|
|
|
|
<where>
|
|
|
|
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
|
|
|
<if test="specification != null and specification != ''"> and specification like concat('%', #{specification}, '%')</if>
|
|
|
|
<if test="unit != null and unit != ''"> and unit like concat('%', #{unit}, '%')</if>
|
|
|
|
<if test="planNeed != null"> and plan_need like concat('%', #{planNeed}, '%')</if>
|
|
|
|
<if test="actualIn != null"> and actual_in like concat('%', #{actualIn}, '%')</if>
|
|
|
|
<if test="surplus != null"> and surplus like concat('%', #{surplus}, '%')</if>
|
|
|
|
<if test="supplierName != null and supplierName != ''"> and supplier_name like concat('%', #{supplierName}, '%')</if>
|
|
|
|
<if test="purchaseTime != null"> and purchase_time=#{purchaseTime}</if>
|
|
|
|
<if test="planUseTime != null"> and plan_use_time=#{planUseTime}</if>
|
|
|
|
<if test="createTime != null"> and create_time=#{createTime}</if>
|
|
|
|
<if test="creator != null and creator != ''"> and creator=#{creator}</if>
|
|
|
|
</where>
|
|
|
|
order by create_time desc
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
</mapper>
|
|
|
|
|