<?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_transit.TbGoodsTransitMapper">




	<!-- ================================== 查询相关 ================================== -->
	<!-- select id, merchant_id, merchant_name, goods_type, goods_name, goods_units, price, place_origin, discription, stock, goods_status, audit_status, audit_time, remark, create_time, create_by, create_name, update_time, update_by, update_name, delete_status from tb_goods_transit  -->

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

	<!-- 公共查询sql片段 -->
	<sql id="select_sql">
		select *
		from tb_goods_transit
	</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("merchantId") '> and merchant_id = #{merchantId} </if>
			<if test=' this.has("merchantName") '> and merchant_name = #{merchantName} </if>
			<if test=' this.has("goodsType") '> and goods_type = #{goodsType} </if>
			<if test=' this.has("goodsName") '> and goods_name like concat('%', #{goodsName}, '%')</if>
			<if test=' this.has("goodsUnits") '> and goods_units = #{goodsUnits} </if>
			<if test=' this.has("price") '> and price = #{price} </if>
			<if test=' this.has("placeOrigin") '> and place_origin = #{placeOrigin} </if>
			<if test=' this.has("description") '> and discription = #{discription} </if>
			<if test=' this.has("stock") '> and stock = #{stock} </if>
			<if test=' this.has("goodsStatus") '> and goods_status = #{goodsStatus} </if>
			<if test=' this.has("isOrders") '> and is_orders = #{isOrders} </if>
			<if test=' this.has("enterpriseConfirm") '> and enterprise_confirm = #{enterpriseConfirm} </if>
			<if test=' this.has("auditStatus") '> and audit_status = #{auditStatus} </if>
			<if test=' this.has("auditTime") '> and audit_time = #{auditTime} </if>
			<if test=' this.has("remark") '> and remark = #{remark} </if>
			<if test=' this.has("createTime") '> and create_time = #{createTime} </if>
			<if test=' this.has("createBy") '> and create_by = #{createBy} </if>
			<if test=' this.has("createName") '> and create_name = #{createName} </if>
			<if test=' this.has("updateTime") '> and update_time = #{updateTime} </if>
			<if test=' this.has("updateBy") '> and update_by = #{updateBy} </if>
			<if test=' this.has("updateName") '> and update_name = #{updateName} </if>
			<if test=' this.has("deleteStatus") '> and delete_status = #{deleteStatus} </if>
		</where>
	</select>










</mapper>
