<?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="net.lab1024.sa.admin.module.business.base.item.dao.ItemDao">

    <!-- 查询结果列 -->
    <sql id="base_columns">
        t_item. item_id,
        t_item.item_code,
        t_item.item_name,
        t_item.unit,
        t_item.pack_factor,
        t_item.disabled_flag,
        t_item.item_type,
        t_item.remark,
        t_item.create_user_id,
        t_item.create_user_name,
        t_item.create_time,
        t_item.update_time
    </sql>

    <!-- 分页查询 -->
    <select id="queryPage" resultType="net.lab1024.sa.admin.module.business.base.item.domain.vo.ItemVO">
        SELECT
        <include refid="base_columns"/>
        FROM t_item
        <where>
            <!--物料编码-->
            <if test="queryForm.itemId != null">
                AND t_item.item_id=#{queryForm.itemId}
            </if>
            <!--物料名称-->
            <if test="queryForm.disabledFlag != null">
                AND t_item.disabled_flag=#{queryForm.disabledFlag}
            </if>
        </where>
        ORDER BY t_item.item_code
    </select>


</mapper>
