<?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.pj.tb_goods_demand.TbGoodsDemandMapper">




	<!-- ================================== 查询相关 ================================== -->
	<!-- select id, level_one_goods_id, goods_name, goods_img, purchaser_id, purchaser_name, is_orders, goods_quantity, remark, create_time, delete_status from tb_goods_demand  -->

	<!-- 通用映射：自动模式 -->
	<resultMap id="model" autoMapping="true" type="com.pj.tb_goods_demand.TbGoodsDemand"></resultMap>

	<!-- 公共查询sql片段 -->
	<sql id="select_sql">
		select *
		from tb_goods_demand
	</sql>


	<!-- 查集合 - 根据条件（参数为空时代表忽略指定条件） [G] -->
	<select id="getList" resultMap="model">
		<include refid="select_sql"></include>
		<where>
			<if test=' this.has("id") '> and id = #{id} </if>
			<if test=' this.has("levelOneGoodsId") '> and level_one_goods_id = #{levelOneGoodsId} </if>
			<if test=' this.has("goodsName") '> and goods_name like concat('%', #{goodsName}, '%')</if>
			<if test=' this.has("goodsNo") '> and goods_no = #{goodsNo} </if>
			<if test=' this.has("goodsImg") '> and goods_img = #{goodsImg} </if>
			<if test=' this.has("purchaserId") '> and purchaser_id = #{purchaserId} </if>
			<if test=' this.has("purchaserName") '> and purchaser_name = #{purchaserName} </if>
			<if test=' this.has("isOrders") '> and is_orders = #{isOrders} </if>
			<if test=' this.has("isRelease") '> and is_release = #{isRelease} </if>
			<if test=' this.has("goodsQuantity") '> and goods_quantity = #{goodsQuantity} </if>
			<if test=' this.has("remark") '> and remark = #{remark} </if>
			<if test=' this.has("createTime") '> and create_time = #{createTime} </if>
			<if test=' this.has("deleteStatus") '> and delete_status = #{deleteStatus} </if>
			<if test=' this.has("isConfirm") '> and is_confirm = #{isConfirm} </if>
		</where>
	</select>
</mapper>
