<?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.project.tb_disinfect.TbDisinfectMapper">



	<!-- ================================== 查询相关 ================================== -->
	<!-- select id, send_people, receive_people, goods_name, origin, num, gross_weight, unit, pack, flag, phone, source_address, arrive_part, car_name, car_no, china_car_name, china_car_no, remark, apply_unit, apply_people, apply_phone, apply_time, accept_people, accept_time, money from tb_disinfect  -->
	
	<!-- 通用映射：手动模式 -->
	<resultMap id="model" type="com.pj.project.tb_disinfect.TbDisinfect">
		<result property="id" column="id" />
		<result property="sendPeople" column="send_people" />
		<result property="receivePeople" column="receive_people" />
		<result property="goodsName" column="goods_name" />
		<result property="origin" column="origin" />
		<result property="num" column="num" />
		<result property="grossWeight" column="gross_weight" />
		<result property="unit" column="unit" />
		<result property="pack" column="pack" />
		<result property="flag" column="flag" />
		<result property="phone" column="phone" />
		<result property="sourceAddress" column="source_address" />
		<result property="arrivePart" column="arrive_part" />
		<result property="carName" column="car_name" />
		<result property="carNo" column="car_no" />
		<result property="chinaCarName" column="china_car_name" />
		<result property="chinaCarNo" column="china_car_no" />
		<result property="remark" column="remark" />
		<result property="applyUnit" column="apply_unit" />
		<result property="declarePeople" column="declare_people" />
		<result property="declarePhone" column="declare_phone" />
		<result property="applyTime" column="apply_time" />
		<result property="acceptPeople" column="accept_people" />
		<result property="acceptTime" column="accept_time" />
		<result property="money" column="money" />
	</resultMap>
	
	<!-- 公共查询sql片段 -->
	<sql id="select_sql">
		select * 
		from tb_disinfect 
	</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("customerId") '>and customer_id = #{customerId}</if>
			<if test=' this.has("sendPeople") '> and send_people = #{sendPeople} </if>
			<if test=' this.has("receivePeople") '> and receive_people = #{receivePeople} </if>
			<if test=' this.has("goodsName") '> and goods_name = #{goodsName} </if>
			<if test=' this.has("origin") '> and origin = #{origin} </if>
			<if test=' this.has("num") '> and num = #{num} </if>
			<if test=' this.has("grossWeight") '> and gross_weight = #{grossWeight} </if>
			<if test=' this.has("unit") '> and unit = #{unit} </if>
			<if test=' this.has("pack") '> and pack = #{pack} </if>
			<if test=' this.has("flag") '> and flag = #{flag} </if>
			<if test=' this.has("phone") '> and phone = #{phone} </if>
			<if test=' this.has("sourceAddress") '> and source_address = #{sourceAddress} </if>
			<if test=' this.has("arrivePart") '> and arrive_part = #{arrivePart} </if>
			<if test=' this.has("carName") '> and car_name = #{carName} </if>
			<if test=' this.has("carNo") '> and car_no = #{carNo} </if>
			<if test=' this.has("chinaCarName") '> and china_car_name = #{chinaCarName} </if>
			<if test=' this.has("chinaCarNo") '> and china_car_no = #{chinaCarNo} </if>
			<if test=' this.has("remark") '> and remark = #{remark} </if>
			<if test=' this.has("applyUnit") '> and apply_unit = #{applyUnit} </if>
			<if test=' this.has("declarePeople") '> and declare_people = #{declarePeople} </if>
			<if test=' this.has("declarePhone") '> and declare_phone = #{declarePhone} </if>
			<if test=' this.has("applyTime") '> and apply_time = #{applyTime} </if>
			<if test=' this.has("acceptPeople") '> and accept_people = #{acceptPeople} </if>
			<if test=' this.has("acceptTime") '> and accept_time = #{acceptTime} </if>
			<if test=' this.has("money") '> and money = #{money} </if>
		</where>
		order by
		<choose>
			<when test='sortType == 1'> id desc </when>
			<when test='sortType == 2'> send_people desc </when>
			<when test='sortType == 3'> receive_people desc </when>
			<when test='sortType == 4'> goods_name desc </when>
			<when test='sortType == 5'> origin desc </when>
			<when test='sortType == 6'> num desc </when>
			<when test='sortType == 7'> gross_weight desc </when>
			<when test='sortType == 8'> unit desc </when>
			<when test='sortType == 9'> pack desc </when>
			<when test='sortType == 10'> flag desc </when>
			<when test='sortType == 11'> phone desc </when>
			<when test='sortType == 12'> source_address desc </when>
			<when test='sortType == 13'> arrive_part desc </when>
			<when test='sortType == 14'> car_name desc </when>
			<when test='sortType == 15'> car_no desc </when>
			<when test='sortType == 16'> china_car_name desc </when>
			<when test='sortType == 17'> china_car_no desc </when>
			<when test='sortType == 18'> remark desc </when>
			<when test='sortType == 19'> apply_unit desc </when>
			<when test='sortType == 20'> declare_people desc </when>
			<when test='sortType == 21'> declare_phone desc </when>
			<when test='sortType == 22'> apply_time desc </when>
			<when test='sortType == 23'> accept_people desc </when>
			<when test='sortType == 24'> accept_time desc </when>
			<when test='sortType == 25'> money desc </when>
			<otherwise> id desc </otherwise>
		</choose>
	</select>
	
	
	
	
	
	
	
	
	

</mapper>
