123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500 |
- <?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="cn.ourwill.module.house.dao.daily.DailyRecordFoodbasicinfoFileDao">
- <resultMap type="cn.ourwill.module.house.entity.daily.DailyRecordFoodbasicinfoFile" id="baseMap">
- <result column="id" property="id"/>
- <result column="uuid" property="uuid"/>
- <result column="record_unite" property="recordUnite"/>
- <result column="keep_unite" property="keepUnite"/>
- <result column="location_num" property="locationNum"/>
- <result column="quality" property="quality"/>
- <result column="type" property="type"/>
- <result column="htype" property="htype"/>
- <result column="number" property="number"/>
- <result column="stand_number" property="standNumber"/>
- <result column="input_year" property="inputYear"/>
- <result column="output_year" property="outputYear"/>
- <result column="grow_year" property="growYear"/>
- <result column="keep_method" property="keepMethod"/>
- <result column="level" property="level"/>
- <result column="weight" property="weight"/>
- <result column="impurity" property="impurity"/>
- <result column="water" property="water"/>
- <result column="unsound" property="unsound"/>
- <result column="recorder" property="recorder"/>
- <result column="house_type" property="houseType"/>
- <result column="design_house_capacity" property="designHouseCapacity"/>
- <result column="valid_house_capacity" property="validHouseCapacity"/>
- <result column="price" property="price"/>
- <result column="place_of_origin" property="placeOfOrigin"/>
- <result column="storage_location" property="storageLocation"/>
- <result column="disperse_capacity" property="disperseCapacity"/>
- <result column="length" property="length"/>
- <result column="width" property="width"/>
- <result column="height" property="height"/>
- <result column="pack_num" property="packNum"/>
- <result column="pack_average_weight" property="packAverageWeight"/>
- <result column="filling_time" property="fillingTime"/>
- <result column="c_id" property="cId"/>
- <result column="c_time" property="cTime"/>
- <result column="u_id" property="uId"/>
- <result column="u_time" property="uTime"/>
- <result column="version" property="version"/>
- <result column="house_id" property="houseId"/>
- <result column="plan_num" property="planNum"/>
- <result column="responsible_user" property="responsibleUser"/>
- <result column="superior_user" property="superiorUser"/>
- <result column="line_height" property="lineHeight"/>
- <result column="file_date" property="fileDate"/>
- <result column="file_maker_uuid" property="fileMakerUuid"/>
- </resultMap>
- <sql id="columns">
- a.id ,
- a.uuid ,
- a.record_unite ,
- a.keep_unite ,
- a.location_num ,
- a.quality ,
- a.`type` ,
- a.htype ,
- a.`number` ,
- a.stand_number ,
- a.input_year ,
- a.output_year ,
- a.grow_year ,
- a.keep_method ,
- a.`level` ,
- a.weight ,
- a.impurity ,
- a.water ,
- a.unsound ,
- a.recorder ,
- a.house_type ,
- a.design_house_capacity ,
- a.valid_house_capacity ,
- a.price ,
- a.place_of_origin ,
- a.storage_location ,
- a.disperse_capacity ,
- a.`length` ,
- a.width ,
- a.height ,
- a.pack_num ,
- a.pack_average_weight ,
- a.filling_time ,
- a.c_id ,
- a.c_time ,
- a.u_id ,
- a.u_time ,
- a.version ,
- a.house_id ,
- a.line_height,
- a.file_date,
- a.file_maker_uuid
- </sql>
- <sql id="joinCols">
- </sql>
- <select id="get" resultMap="baseMap">
- SELECT
- <include refid="columns"/>
- FROM daily_record_foodbasicinfo_file a
- <include refid="joinCols"/>
- WHERE a.id = #{id}
- </select>
- <select id="findByHouseId" resultMap="baseMap">
- SELECT *
- FROM daily_record_foodbasicinfo_file a
- where house_id=#{houseId}
- order BY c_time DESC
- limit 1
- </select>
- <select id="findList" resultMap="baseMap">
- SELECT
- <include refid="columns"/>
- FROM daily_record_foodbasicinfo_file a
- <if test="cityId !=null">
- left join house_info hou on hou.id = a.house_id
- left join sys_grain sg on sg.id = hou.grain_id
- </if>
- <include refid="joinCols"/>
- <where>
- <if test="cityId !=null">
- and sg.parentId = #{cityId}
- </if>
- <if test="id !=null">
- and id = #{id}
- </if>
- <if test="uuid !=null">
- and uuid = #{uuid}
- </if>
- <if test="recordUnite !=null">
- and record_unite = #{recordUnite}
- </if>
- <if test="keepUnite !=null">
- and keep_unite = #{keepUnite}
- </if>
- <if test="locationNum !=null">
- and location_num = #{locationNum}
- </if>
- <if test="quality !=null">
- and quality = #{quality}
- </if>
- <if test="type !=null">
- and `type` = #{type}
- </if>
- <if test="htype !=null">
- and htype = #{htype}
- </if>
- <if test="number !=null">
- and `number` = #{number}
- </if>
- <if test="standNumber !=null">
- and stand_number = #{standNumber}
- </if>
- <if test="inputYear !=null">
- and input_year = #{inputYear}
- </if>
- <if test="searchStartDate !=null">
- and STR_TO_DATE(input_year, '%Y-%m-%d') <![CDATA[ >= ]]> #{searchStartDate}
- </if>
- <if test="searchEndDate !=null">
- and STR_TO_DATE(input_year, '%Y-%m-%d') <= #{searchEndDate}
- </if>
- <if test="outputYear !=null">
- and output_year = #{outputYear}
- </if>
- <if test="growYear !=null">
- and grow_year = #{growYear}
- </if>
- <if test="keepMethod !=null">
- and keep_method = #{keepMethod}
- </if>
- <if test="level !=null">
- and `level` = #{level}
- </if>
- <if test="weight !=null">
- and weight = #{weight}
- </if>
- <if test="impurity !=null">
- and impurity = #{impurity}
- </if>
- <if test="water !=null">
- and water = #{water}
- </if>
- <if test="unsound !=null">
- and unsound = #{unsound}
- </if>
- <if test="recorder !=null">
- and recorder = #{recorder}
- </if>
- <if test="houseType !=null">
- and house_type = #{houseType}
- </if>
- <if test="designHouseCapacity !=null">
- and design_house_capacity = #{designHouseCapacity}
- </if>
- <if test="validHouseCapacity !=null">
- and valid_house_capacity = #{validHouseCapacity}
- </if>
- <if test="price !=null">
- and price = #{price}
- </if>
- <if test="placeOfOrigin !=null">
- and place_of_origin = #{placeOfOrigin}
- </if>
- <if test="storageLocation !=null">
- and storage_location = #{storageLocation}
- </if>
- <if test="disperseCapacity !=null">
- and disperse_capacity = #{disperseCapacity}
- </if>
- <if test="length !=null">
- and `length` = #{length}
- </if>
- <if test="width !=null">
- and width = #{width}
- </if>
- <if test="height !=null">
- and height = #{height}
- </if>
- <if test="packNum !=null">
- and pack_num = #{packNum}
- </if>
- <if test="packAverageWeight !=null">
- and pack_average_weight = #{packAverageWeight}
- </if>
- <if test="fillingTime !=null">
- and filling_time = #{fillingTime}
- </if>
- <if test="cId !=null">
- and c_id = #{cId}
- </if>
- <if test="cTime !=null">
- and c_time = #{cTime}
- </if>
- <if test="uId !=null">
- and u_id = #{uId}
- </if>
- <if test="uTime !=null">
- and u_time = #{uTime}
- </if>
- <if test="version !=null">
- and version = #{version}
- </if>
- <if test="houseId !=null">
- and house_id = #{houseId}
- </if>
- <if test="lineHeight !=null">
- and line_height = #{lineHeight}
- </if>
- <if test="fileDate !=null">
- and file_date = #{fileDate}
- </if>
- <if test="fileMakerUuid !=null">
- and file_maker_uuid = #{fileMakerUuid}
- </if>
- </where>
- <choose>
- <when test="page !=null and page.count != null and page.orderBy != null and page.orderBy != ''">
- ORDER BY ${page.orderBy}
- </when>
- <otherwise>
- </otherwise>
- </choose>
- </select>
- <insert id="insert" keyColumn="id" keyProperty="id" useGeneratedKeys="true"
- parameterType="cn.ourwill.module.house.entity.daily.DailyRecordFoodbasicinfoFile">
- INSERT INTO daily_record_foodbasicinfo_file
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <!-- <if test=" id != null">
- id,
- </if>-->
- <if test=" uuid != null">
- uuid,
- </if>
- <if test=" recordUnite != null">
- record_unite,
- </if>
- <if test=" keepUnite != null">
- keep_unite,
- </if>
- <if test=" locationNum != null">
- location_num,
- </if>
- <if test=" quality != null">
- quality,
- </if>
- <if test=" type != null">
- type,
- </if>
- <if test=" htype != null">
- htype,
- </if>
- <if test=" number != null">
- number,
- </if>
- <if test=" standNumber != null">
- stand_number,
- </if>
- <if test=" inputYear != null">
- input_year,
- </if>
- <if test="outputYear !=null">
- output_year,
- </if>
- <if test=" growYear != null">
- grow_year,
- </if>
- <if test=" keepMethod != null">
- keep_method,
- </if>
- <if test=" level != null">
- level,
- </if>
- <if test=" weight != null">
- weight,
- </if>
- <if test=" impurity != null">
- impurity,
- </if>
- <if test=" water != null">
- water,
- </if>
- <if test=" unsound != null">
- unsound,
- </if>
- <if test=" recorder != null">
- recorder,
- </if>
- <if test=" houseType != null">
- house_type,
- </if>
- <if test=" designHouseCapacity != null">
- design_house_capacity,
- </if>
- <if test=" validHouseCapacity != null">
- valid_house_capacity,
- </if>
- <if test=" price != null">
- price,
- </if>
- <if test=" placeOfOrigin != null">
- place_of_origin,
- </if>
- <if test=" storageLocation != null">
- storage_location,
- </if>
- <if test=" disperseCapacity != null">
- disperse_capacity,
- </if>
- <if test=" length != null">
- length,
- </if>
- <if test=" width != null">
- width,
- </if>
- <if test=" height != null">
- height,
- </if>
- <if test=" packNum != null">
- pack_num,
- </if>
- <if test=" packAverageWeight != null">
- pack_average_weight,
- </if>
- <if test=" fillingTime != null">
- filling_time,
- </if>
- <if test=" cId != null">
- c_id,
- </if>
- <if test=" cTime != null">
- c_time,
- </if>
- <if test=" uId != null">
- u_id,
- </if>
- <if test=" uTime != null">
- u_time,
- </if>
- <if test=" version != null">
- version,
- </if>
- <if test=" houseId != null">
- house_id,
- </if>
- <if test="lineHeight !=null">
- line_height,
- </if>
- <if test=" fileDate != null">
- file_date,
- </if>
- <if test="fileMakerUuid !=null">
- file_maker_uuid
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <!--<if test="id !=null">
- #{id},
- </if>-->
- <if test=" uuid != null">
- #{uuid}, </if>
- <if test=" recordUnite != null">
- #{recordUnite}, </if>
- <if test=" keepUnite != null">
- #{keepUnite}, </if>
- <if test=" locationNum != null">
- #{locationNum}, </if>
- <if test=" quality != null">
- #{quality}, </if>
- <if test=" type != null">
- #{type}, </if>
- <if test=" htype != null">
- #{htype}, </if>
- <if test=" number != null">
- #{number}, </if>
- <if test=" standNumber != null">
- #{standNumber}, </if>
- <if test=" inputYear != null">
- #{inputYear}, </if>
- <if test="outputYear !=null">
- #{outputYear}, </if>
- <if test=" growYear != null">
- #{growYear}, </if>
- <if test=" keepMethod != null">
- #{keepMethod}, </if>
- <if test=" level != null">
- #{level}, </if>
- <if test=" weight != null">
- #{weight}, </if>
- <if test=" impurity != null">
- #{impurity}, </if>
- <if test=" water != null">
- #{water}, </if>
- <if test=" unsound != null">
- #{unsound}, </if>
- <if test=" recorder != null">
- #{recorder}, </if>
- <if test=" houseType != null">
- #{houseType}, </if>
- <if test=" designHouseCapacity != null">
- #{designHouseCapacity}, </if>
- <if test=" validHouseCapacity != null">
- #{validHouseCapacity}, </if>
- <if test=" price != null">
- #{price}, </if>
- <if test=" placeOfOrigin != null">
- #{placeOfOrigin}, </if>
- <if test=" storageLocation != null">
- #{storageLocation}, </if>
- <if test=" disperseCapacity != null">
- #{disperseCapacity}, </if>
- <if test=" length != null">
- #{length}, </if>
- <if test=" width != null">
- #{width}, </if>
- <if test=" height != null">
- #{height}, </if>
- <if test=" packNum != null">
- #{packNum}, </if>
- <if test=" packAverageWeight != null">
- #{packAverageWeight}, </if>
- <if test=" fillingTime != null">
- #{fillingTime}, </if>
- <if test=" cId != null">
- #{cId}, </if>
- <if test=" cTime != null">
- #{cTime}, </if>
- <if test=" uId != null">
- #{uId}, </if>
- <if test=" uTime != null">
- #{uTime}, </if>
- <if test=" version != null">
- #{version}, </if>
- <if test=" houseId != null">
- #{houseId}, </if>
- <if test="lineHeight !=null">
- #{lineHeight}, </if>
- <if test=" fileDate != null">
- #{fileDate}, </if>
- <if test="fileMakerUuid !=null">
- #{fileMakerUuid} </if>
- </trim>
- </insert>
- </mapper>
|