1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081 |
- <?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.DailyRecordFoodbasicinfoDao">
- <resultMap type="cn.ourwill.module.house.entity.daily.DailyRecordFoodbasicinfo" 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="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="status" property="status"/>
- <result column="diameter" property="diameter"/>
- <result column="kcvolume" property="kcvolume"/>
- <result column="management" property="management"/>
- </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.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.status,
- a.diameter,
- a.kcvolume,
- a.management
- </sql>
- <sql id="joinCols">
- </sql>
- <select id="get" resultMap="baseMap">
- SELECT
- <include refid="columns"/>
- FROM daily_record_foodbasicinfo a
- <include refid="joinCols"/>
- WHERE a.id = #{id}
- </select>
- <select id="findList" resultMap="baseMap">
- SELECT
- <include refid="columns"/>
- FROM daily_record_foodbasicinfo 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="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="status !=null">
- and status = #{status}
- </if>
- <if test="diameter !=null">
- and diameter = #{diameter}
- </if>
- <if test="kcvolume !=null">
- and kcvolume = #{kcvolume}
- </if>
- <if test="management !=null">
- and management = #{management}
- </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>
- <select id="findAllList" resultMap="baseMap">
- SELECT
- <include refid="columns"/>
- FROM daily_record_foodbasicinfo a
- <include refid="joinCols"/>
- <where>
- <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="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="status !=null">
- and status = #{status}
- </if>
- <if test="diameter !=null">
- and diameter = #{diameter}
- </if>
- <if test="kcvolume !=null">
- and kcvolume = #{kcvolume}
- </if>
- <if test="management !=null">
- and management = #{management}
- </if>
- </where>
- <choose>
- <when test="page !=null and page.orderBy != null and page.orderBy != ''">
- ORDER BY ${page.orderBy}
- </when>
- <otherwise>
- </otherwise>
- </choose>
- </select>
- <resultMap id="StatisticUsed" type="cn.ourwill.module.house.entity.daily.DailyRecordFoodbasicinfo" extends="baseMap">
- <result column="houseName" property="houseName"/>
- <result column="grainName" property="grainName"/>
- <result column="store_num" property="storeNum"/>
- <result column="plan_num" property="planNum"/>
- <result column="responsible_user" property="responsibleUser"/>
- <result column="superior_user" property="superiorUser"/>
- <result column="grainType" property="grainType"/>
- <result column="sumDesignHouseCapacity" property="sumDesignHouseCapacity"/>
- <result column="sumNumber" property="sumNumber"/>
- </resultMap>
- <select id="findByHouseId" resultMap="StatisticUsed">
- select
- drf.house_id ,
- gra.name as grainName,
- hou.house_name as houseName,
- drf.Design_house_capacity as sumDesignHouseCapacity,
- drf.valid_house_capacity as sumValidHouseCapacity,
- drf.house_type ,
- drf.type ,
- drf.quality ,
- drf.level ,
- dri.store_num ,
- drf.place_of_origin ,
- dri.plan_num ,
- drf.grow_year,
- hk.name as responsible_user,
- drt.superior_user
- from daily_record_foodbasicinfo drf
- left join house_info hou on drf.house_id = hou.id
- left join house_keeper_house hkh on drf.house_id = hkh.houseId
- left join house_keeper hk on hkh.keeperId = hk.id
- left join sys_grain gra on hou.grain_id = gra.id
- left join daily_record_inoutput dri on drf.house_id = dri.house_id and (dri.id = (SELECT id from daily_record_inoutput where house_id = dri.house_id order by record_date desc,id desc limit 1))
- left join daily_record_transfer drt on drf.house_id = drt.house_id and (drt.id = (select id from daily_record_transfer where house_id = drt.house_id order by trans_time desc,id desc limit 1))
- <where>
- and drf.htype = '0'
- <if test="grainId!=null and grainId!=''">
- and gra.id = #{grainId}
- </if>
- <if test="cityId!=null and cityId!=''">
- and gra.parentId = #{cityId}
- </if>
- <if test="houseId!=null and houseId!=''">
- and drf.house_id = #{houseId}
- </if>
- </where>
- order by gra.id,CONCAT(GetNum(hou.house_name),hou.house_name)+0,drf.valid_house_capacity
- </select>
- <select id="getSumByGrainType" resultMap="StatisticUsed">
- select sg.type as grainType,
- sum(convert(drf.design_house_capacity, decimal(14,4))) as sumDesignHouseCapacity,
- sum(convert(dri.store_num, decimal(14,4)))/1000 as sumNumber
- from daily_record_foodbasicinfo drf
- left join daily_record_inoutput dri on drf.house_id = dri.house_id
- and dri.id = (select id from daily_record_inoutput where house_id = dri.house_id order by record_date desc,id desc limit 1)
- left join house_info hou on drf.house_id = hou.id
- left join sys_grain sg on sg.id = hou.grain_id
- left join sys_dic_data sdd on sdd.id = sg.type
- <where>
- and drf.htype = '0'
- <if test="quailty!=null and quailty!=''">
- and drf.quality = #{quailty}
- </if>
- </where>
- group by sg.type
- order by sg.type
- </select>
- <insert id="insert" keyColumn="id" keyProperty="id" useGeneratedKeys="true"
- parameterType="cn.ourwill.module.house.entity.daily.DailyRecordFoodbasicinfo">
- INSERT INTO daily_record_foodbasicinfo
- <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=" 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="status !=null">
- status,
- </if>
- <if test="diameter !=null">
- diameter,
- </if>
- <if test="kcvolume !=null">
- kcvolume,
- </if>
- <if test="management !=null">
- management
- </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=" 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="status !=null">
- #{status} , </if>
- <if test="diameter !=null">
- #{diameter},
- </if>
- <if test="kcvolume !=null">
- #{kcvolume},
- </if>
- <if test="management !=null">
- #{management}
- </if>
- </trim>
- </insert>
- <update id="update" parameterType="cn.ourwill.module.house.entity.daily.DailyRecordFoodbasicinfo">
- UPDATE daily_record_foodbasicinfo <set>
- <if test="id != null">
- id= #{id} ,
- </if>
- <if test="uuid != null">
- uuid= #{uuid} ,
- </if>
- <if test="recordUnite != null">
- record_unite= #{recordUnite} ,
- </if>
- <if test="keepUnite != null">
- keep_unite= #{keepUnite} ,
- </if>
- <if test="locationNum != null">
- location_num= #{locationNum} ,
- </if>
- <if test="quality != null">
- quality= #{quality} ,
- </if>
- <if test="type != null">
- `type`= #{type} ,
- </if>
- <if test="htype != null">
- htype= #{htype} ,
- </if>
- <if test="number != null">
- `number`= #{number} ,
- </if>
- <if test="standNumber != null">
- stand_number= #{standNumber} ,
- </if>
- <if test="inputYear != null">
- input_year= #{inputYear} ,
- </if>
- <if test="growYear != null">
- grow_year= #{growYear} ,
- </if>
- <if test="keepMethod != null">
- keep_method= #{keepMethod} ,
- </if>
- <if test="level != null">
- `level`= #{level} ,
- </if>
- <if test="weight != null">
- weight= #{weight} ,
- </if>
- <if test="impurity != null">
- impurity= #{impurity} ,
- </if>
- <if test="water != null">
- water= #{water} ,
- </if>
- <if test="unsound != null">
- unsound= #{unsound} ,
- </if>
- <if test="recorder != null">
- recorder= #{recorder} ,
- </if>
- <if test="houseType != null">
- house_type= #{houseType} ,
- </if>
- <if test="designHouseCapacity != null">
- design_house_capacity= #{designHouseCapacity} ,
- </if>
- <if test="validHouseCapacity != null">
- valid_house_capacity= #{validHouseCapacity} ,
- </if>
- <if test="price != null">
- price= #{price} ,
- </if>
- <if test="placeOfOrigin != null">
- place_of_origin= #{placeOfOrigin} ,
- </if>
- <if test="storageLocation != null">
- storage_location= #{storageLocation} ,
- </if>
- <if test="disperseCapacity != null">
- disperse_capacity= #{disperseCapacity} ,
- </if>
- <if test="length != null">
- `length`= #{length} ,
- </if>
- <if test="width != null">
- width= #{width} ,
- </if>
- <if test="height != null">
- height= #{height} ,
- </if>
- <if test="packNum != null">
- pack_num= #{packNum} ,
- </if>
- <if test="packAverageWeight != null">
- pack_average_weight= #{packAverageWeight} ,
- </if>
- <if test="fillingTime != null">
- filling_time= #{fillingTime} ,
- </if>
- <if test="cId != null">
- c_id= #{cId} ,
- </if>
- <if test="cTime != null">
- c_time= #{cTime} ,
- </if>
- <if test="uId != null">
- u_id= #{uId} ,
- </if>
- <if test="uTime != null">
- u_time= #{uTime} ,
- </if>
- <if test="version != null">
- version= #{version} ,
- </if>
- <if test="houseId != null">
- house_id= #{houseId} ,
- </if>
- <if test="lineHeight !=null">
- line_height = #{lineHeight},
- </if>
- <if test="status !=null">
- status = #{status},
- </if>
- <if test="diameter !=null">
- diameter = #{diameter},
- </if>
- <if test="kcvolume !=null">
- kcvolume = #{kcvolume},
- </if>
- <if test="management !=null">
- management = #{management}
- </if>
- </set>
- <where>
- <if test="id != null ">
- id = #{id}
- </if>
- <if test="houseId != null ">
- and house_id = #{houseId}
- </if>
- </where>
- </update>
- <update id="updateStatusByHouseId" parameterType="cn.ourwill.module.house.entity.daily.DailyRecordFoodbasicinfo">
- UPDATE daily_record_foodbasicinfo <set>
- <if test="id != null">
- id= #{id} ,
- </if>
- <if test="uuid != null">
- uuid= #{uuid} ,
- </if>
- <if test="recordUnite != null">
- record_unite= #{recordUnite} ,
- </if>
- <if test="keepUnite != null">
- keep_unite= #{keepUnite} ,
- </if>
- <if test="locationNum != null">
- location_num= #{locationNum} ,
- </if>
- <if test="quality != null">
- quality= #{quality} ,
- </if>
- <if test="type != null">
- `type`= #{type} ,
- </if>
- <if test="htype != null">
- htype= #{htype} ,
- </if>
- <if test="number != null">
- `number`= #{number} ,
- </if>
- <if test="standNumber != null">
- stand_number= #{standNumber} ,
- </if>
- <if test="inputYear != null">
- input_year= #{inputYear} ,
- </if>
- <if test="outputYear != null">
- output_year= #{outputYear} ,
- </if>
- <if test="growYear != null">
- grow_year= #{growYear} ,
- </if>
- <if test="keepMethod != null">
- keep_method= #{keepMethod} ,
- </if>
- <if test="level != null">
- `level`= #{level} ,
- </if>
- <if test="weight != null">
- weight= #{weight} ,
- </if>
- <if test="impurity != null">
- impurity= #{impurity} ,
- </if>
- <if test="water != null">
- water= #{water} ,
- </if>
- <if test="unsound != null">
- unsound= #{unsound} ,
- </if>
- <if test="recorder != null">
- recorder= #{recorder} ,
- </if>
- <if test="houseType != null">
- house_type= #{houseType} ,
- </if>
- <if test="designHouseCapacity != null">
- design_house_capacity= #{designHouseCapacity} ,
- </if>
- <if test="validHouseCapacity != null">
- valid_house_capacity= #{validHouseCapacity} ,
- </if>
- <if test="price != null">
- price= #{price} ,
- </if>
- <if test="placeOfOrigin != null">
- place_of_origin= #{placeOfOrigin} ,
- </if>
- <if test="storageLocation != null">
- storage_location= #{storageLocation} ,
- </if>
- <if test="disperseCapacity != null">
- disperse_capacity= #{disperseCapacity} ,
- </if>
- <if test="length != null">
- `length`= #{length} ,
- </if>
- <if test="width != null">
- width= #{width} ,
- </if>
- <if test="height != null">
- height= #{height} ,
- </if>
- <if test="packNum != null">
- pack_num= #{packNum} ,
- </if>
- <if test="packAverageWeight != null">
- pack_average_weight= #{packAverageWeight} ,
- </if>
- <if test="fillingTime != null">
- filling_time= #{fillingTime} ,
- </if>
- <if test="cId != null">
- c_id= #{cId} ,
- </if>
- <if test="cTime != null">
- c_time= #{cTime} ,
- </if>
- <if test="uId != null">
- u_id= #{uId} ,
- </if>
- <if test="uTime != null">
- u_time= #{uTime} ,
- </if>
- <if test="version != null">
- version= #{version} ,
- </if>
- <if test="houseId != null">
- house_id= #{houseId} ,
- </if>
- <if test="lineHeight !=null">
- line_height = #{lineHeight},
- </if>
- <if test="status !=null">
- status = #{status},
- </if>
- <if test="diameter !=null">
- diameter = #{diameter},
- </if>
- <if test="kcvolume !=null">
- kcvolume = #{kcvolume},
- </if>
- <if test="management !=null">
- management = #{management}
- </if>
- </set>
- <where>
- <if test="id != null ">
- id = #{id}
- </if>
- <if test="houseId != null ">
- and house_id = #{houseId}
- </if>
- </where>
- </update>
- <update id="updateList" parameterType="cn.ourwill.module.house.entity.daily.DailyRecordFoodbasicinfo">
- UPDATE daily_record_foodbasicinfo set htype=0
- where
- id =#{id}
- </update>
- <delete id="deleteById" parameterType="java.lang.Long">
- DELETE FROM daily_record_foodbasicinfo WHERE id = #{id}
- </delete>
- <delete id="deleteByIds" parameterType="java.util.List">
- DELETE FROM daily_record_foodbasicinfo WHERE id IN
- <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </delete>
- <select id="getLastId" resultType="java.lang.Integer">
- SELECT
- IFNULL(MAX(id),0)AS id
- FROM daily_record_foodbasicinfo a
- where
- house_id=#{houseId} order by id desc limit 1
- </select>
- <select id="getDailyRecodrFoodBasicInfo" resultType="int">
- SELECT
- id
- FROM
- daily_record_foodbasicinfo
- WHERE
- house_id = #{houseId}
- ORDER BY
- DATE_FORMAT(input_year, '%Y-%m-%d') DESC,
- id DESC
- LIMIT 1
- </select>
- <select id="findByHouseIdNoPage" resultMap="baseMap">
- SELECT *
- FROM daily_record_foodbasicinfo a
- where house_id=#{houseId}
- </select>
- <select id="findByHouseIdAndCtimes" resultMap="baseMap">
- SELECT *
- FROM daily_record_foodbasicinfo a
- where house_id=#{houseId}
- order BY c_time DESC
- limit 1
- </select>
- <select id="getByHouseId" resultMap="baseMap">
- SELECT *
- FROM daily_record_foodbasicinfo a
- where house_id=#{houseId}
- order BY c_time DESC
- limit 1
- </select>
- <select id="getByUuid" resultMap="baseMap">
- SELECT *
- FROM daily_record_foodbasicinfo a
- where uuid=#{uuid}
- order BY c_time DESC
- limit 1
- </select>
- <select id="findByHouseIdAndCtime" resultMap="baseMap">
- SELECT *
- FROM daily_record_foodbasicinfo a
- where house_id=#{houseId}
- <if test="cTime != null">
- AND input_year <![CDATA[ <= ]]> #{cTime}
- </if>
- order BY c_time DESC
- limit 1
- </select>
- <delete id="deleteFoodbaseicInfoByHouseId">
- DELETE FROM daily_record_foodbasicinfo
- WHERE house_id = #{houseId}
- <if test="cTime != null">
- AND input_year <![CDATA[ <= ]]> #{cTime}
- </if>
- </delete>
- </mapper>
|