1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099 |
- <?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.DailyRecordFoodinfoDao">
- <resultMap type="cn.ourwill.module.house.entity.daily.DailyRecordFoodinfo" id="baseMap">
- <result column="id" property="id"/>
- <result column="uuid" property="uuid"/>
- <result column="house_id" property="houseId"/>
- <result column="type" property="type"/>
- <result column="content" property="content"/>
- <result column="htype" property="htype"/>
- <result column="check_date" property="checkDate"/>
- <result column="food_color" property="foodColor"/>
- <result column="pest_position" property="pestPosition"/>
- <result column="pest_type" property="pestType"/>
- <result column="pest_volum" property="pestVolum"/>
- <result column="pest_level" property="pestLevel"/>
- <result column="water_position" property="waterPosition"/>
- <result column="water_area" property="waterArea"/>
- <result column="water_depth" property="waterDepth"/>
- <result column="water_heightest" property="waterHeightest"/>
- <result column="in_temp" property="inTemp"/>
- <result column="out_temp" property="outTemp"/>
- <result column="in_water" property="inWater"/>
- <result column="out_water" property="outWater"/>
- <result column="max_temp" property="maxTemp"/>
- <result column="maxtemp_position" property="maxtempPosition"/>
- <result column="check_situation" property="checkSituation"/>
- <result column="treatment_advice" property="treatmentAdvice"/>
- <result column="check_sign" property="checkSign"/>
- <result column="custodian_sign" property="custodianSign"/>
- <result column="remark" property="remark"/>
- <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="xzflag" property="xzflag"/>
- <!--以下二期新增字段-->
- <result column="nonormal_type" property="nonormalType"/>
- <result column="nonormal_position" property="nonormalPosition"/>
- <result column="nonormal_domain" property="nonormalDomain"/>
- <result column="nonormal_temp" property="nonormalTemp"/>
- <result column="nonormal_water" property="nonormalWater"/>
- <result column="mouse_record" property="mouseRecord"/>
- <result column="sect_record" property="sectRecord"/>
- <result column="bad_record" property="badRecord"/>
- <result column="accident_record" property="accidentRecord"/>
- <result column="min_temp" property="minTemp"/>
- <result column="avg_temp" property="avgTemp"/>
- </resultMap>
- <resultMap type="cn.ourwill.module.house.entity.daily.DailyRecordFoodinfo" id="notbaseMap">
- <result column="id" property="id"/>
- <result column="uuid" property="uuid"/>
- <result column="houseId" property="houseId"/>
- <result column="type" property="type"/>
- <result column="content" property="content"/>
- <result column="htype" property="htype"/>
- <result column="checkDate" property="checkDate"/>
- <result column="foodColor" property="foodColor"/>
- <result column="pestPosition" property="pestPosition"/>
- <result column="pestType" property="pestType"/>
- <result column="pestVolum" property="pestVolum"/>
- <result column="pestLevel" property="pestLevel"/>
- <result column="waterPosition" property="waterPosition"/>
- <result column="waterArea" property="waterArea"/>
- <result column="waterDepth" property="waterDepth"/>
- <result column="waterHeightest" property="waterHeightest"/>
- <result column="inTemp" property="inTemp"/>
- <result column="outTemp" property="outTemp"/>
- <result column="inWater" property="inWater"/>
- <result column="outWater" property="outWater"/>
- <result column="maxTemp" property="maxTemp"/>
- <result column="maxtempPosition" property="maxtempPosition"/>
- <result column="checkSituation" property="checkSituation"/>
- <result column="treatmentAdvice" property="treatmentAdvice"/>
- <result column="checkSign" property="checkSign"/>
- <result column="custodianSign" property="custodianSign"/>
- <result column="remark" property="remark"/>
- <result column="cId" property="cId"/>
- <result column="cTime" property="cTime"/>
- <result column="uId" property="uId"/>
- <result column="uTime" property="uTime"/>
- <!--<result column="version" property="version"/>-->
- <result column="xzflag" property="xzflag"/>
- <result column="grainName" property="grainName"/>
- <result column="houseName" property="houseName"/>
- <result column="keeperName" property="keeperName"/>
- <result column="keeperPhone" property="keeperPhone"/>
- </resultMap>
- <sql id="columns">
- id ,
- uuid ,
- house_id ,
- `type` ,
- content ,
- htype ,
- check_date ,
- food_color ,
- pest_position ,
- pest_type ,
- pest_volum ,
- pest_level ,
- water_position ,
- water_area ,
- water_depth ,
- water_heightest ,
- in_temp ,
- out_temp ,
- in_water ,
- out_water ,
- max_temp ,
- min_temp,
- avg_temp,
- maxtemp_position ,
- check_situation ,
- treatment_advice ,
- check_sign ,
- custodian_sign ,
- remark ,
- c_id ,
- c_time ,
- u_id ,
- u_time ,
- version,
- xzflag,
- nonormal_type,
- nonormal_position,
- nonormal_domain,
- nonormal_temp,
- nonormal_water,
- mouse_record,
- sect_record,
- bad_record,
- accident_record
- </sql>
- <sql id="joinCols">
- </sql>
- <select id="get" resultMap="baseMap">
- SELECT
- <include refid="columns"/>
- FROM daily_record_foodcheckinfo a
- <include refid="joinCols"/>
- WHERE a.id = #{id}
- </select>
- <select id="getByUuid" resultMap="baseMap">
- SELECT
- <include refid="columns"/>
- FROM daily_record_foodcheckinfo a
- <include refid="joinCols"/>
- WHERE a.uuid = #{uuid}
- </select>
- <select id="findNoUuidList" resultMap="baseMap">
- SELECT
- <include refid="columns"/>
- FROM daily_record_foodcheckinfo a
- <include refid="joinCols"/>
- WHERE a.uuid is null or trim(a.uuid) = '';
- </select>
- <select id="findList" resultMap="baseMap">
- SELECT
- <include refid="columns"/>
- FROM daily_record_foodcheckinfo a
- <include refid="joinCols"/>
- <where>
- <if test="id !=null">
- and id = #{id}
- </if>
- <if test="searchStartDate !=null">
- and STR_TO_DATE(check_date, '%Y-%m-%d') <![CDATA[ >= ]]> #{searchStartDate}
- </if>
- <if test="searchEndDate !=null">
- and STR_TO_DATE(check_date, '%Y-%m-%d') <= #{searchEndDate}
- </if>
- <if test="uuid !=null">
- and uuid = #{uuid}
- </if>
- <if test="houseId !=null">
- and house_id = #{houseId}
- </if>
- <if test="type !=null">
- and `type` = #{type}
- </if>
- <if test="content !=null">
- and content = #{content}
- </if>
- <if test="htype !=null">
- and htype = #{htype}
- </if>
- <if test="checkDate !=null">
- and check_date = #{checkDate}
- </if>
- <if test="foodColor !=null">
- and food_color = #{foodColor}
- </if>
- <if test="pestPosition !=null">
- and pest_position = #{pestPosition}
- </if>
- <if test="pestType !=null">
- and pest_type = #{pestType}
- </if>
- <if test="pestVolum !=null">
- and pest_volum = #{pestVolum}
- </if>
- <if test="pestLevel !=null">
- and pest_level = #{pestLevel}
- </if>
- <if test="waterPosition !=null">
- and water_position = #{waterPosition}
- </if>
- <if test="waterArea !=null">
- and water_area = #{waterArea}
- </if>
- <if test="waterDepth !=null">
- and water_depth = #{waterDepth}
- </if>
- <if test="waterHeightest !=null">
- and water_heightest = #{waterHeightest}
- </if>
- <if test="inTemp !=null">
- and in_temp = #{inTemp}
- </if>
- <if test="outTemp !=null">
- and out_temp = #{outTemp}
- </if>
- <if test="inWater !=null">
- and in_water = #{inWater}
- </if>
- <if test="outWater !=null">
- and out_water = #{outWater}
- </if>
- <if test="maxTemp !=null">
- and max_temp = #{maxTemp}
- </if>
- <if test="maxtempPosition !=null">
- and maxtemp_position = #{maxtempPosition}
- </if>
- <if test="checkSituation !=null">
- and check_situation = #{checkSituation}
- </if>
- <if test="treatmentAdvice !=null">
- and treatment_advice = #{treatmentAdvice}
- </if>
- <if test="checkSign !=null">
- and check_sign = #{checkSign}
- </if>
- <if test="custodianSign !=null">
- and custodian_sign = #{custodianSign}
- </if>
- <if test="remark !=null">
- and remark = #{remark}
- </if>
- <if test="cId !=null">
- and c_id = #{cId}
- </if>
- <if test="uId !=null">
- and u_id = #{uId}
- </if>
- <if test="uTime !=null">
- and u_time = #{uTime}
- </if>
- </where>
- <choose>
- <when test="checkOrder !=null and checkOrder = 'true'">
- order by STR_TO_DATE(check_date, '%Y-%m-%d') desc,id desc
- </when>
- <when test="page !=null and page.orderBy != null and page.orderBy != ''">
- ORDER BY ${page.orderBy}
- </when>
- </choose>
- </select>
- <select id="findListTemp" resultMap="baseMap">
- SELECT
- <include refid="columns"/>
- FROM daily_record_foodcheckinfo a
- <include refid="joinCols"/>
- <where>
- <if test="beginDate !=null">
- and STR_TO_DATE(check_date, '%Y-%m-%d') <![CDATA[ >= ]]> #{beginDate}
- </if>
- <if test="endDate !=null">
- and STR_TO_DATE(check_date, '%Y-%m-%d') <= #{endDate}
- </if>
- <if test="houseId !=null">
- and house_id = #{houseId}
- </if>
- </where>
- order by STR_TO_DATE(check_date, '%Y-%m-%d') desc,id desc
- </select>
- <select id="findimgList" resultMap="baseMap">
- SELECT
- <include refid="columns"/>
- FROM daily_record_foodcheckinfo a
- <include refid="joinCols"/>
- <where>
- <if test="searchStartDate !=null">
- and STR_TO_DATE(check_date, '%Y-%m-%d') <![CDATA[ >= ]]> #{searchStartDate}
- </if>
- <if test="searchEndDate !=null">
- and STR_TO_DATE(check_date, '%Y-%m-%d') <= #{searchEndDate}
- </if>
- <if test="houseId !=null">
- and house_id = #{houseId}
- </if>
- </where>
- order by STR_TO_DATE(check_date, '%Y-%m-%d') desc,id desc
- </select>
- <select id="findAllList" resultMap="baseMap">
- SELECT
- <include refid="columns"/>
- FROM daily_record_foodcheckinfo a
- <include refid="joinCols"/>
- <where>
- <if test="id !=null">
- and id = #{id}
- </if>
- <if test="uuid !=null">
- and uuid = #{uuid}
- </if>
- <if test="houseId !=null">
- and house_id = #{houseId}
- </if>
- <if test="searchStartDate !=null">
- and check_date <![CDATA[ >= ]]> #{searchStartDate}
- </if>
- <if test="searchEndDate !=null">
- and check_date <= #{searchEndDate}
- </if>
- <if test="type !=null">
- and `type` = #{type}
- </if>
- <if test="content !=null">
- and content = #{content}
- </if>
- <if test="htype !=null">
- and htype = #{htype}
- </if>
- <if test="checkDate !=null">
- and check_date = #{checkDate}
- </if>
- <if test="foodColor !=null">
- and food_color = #{foodColor}
- </if>
- <if test="pestPosition !=null">
- and pest_position = #{pestPosition}
- </if>
- <if test="pestType !=null">
- and pest_type = #{pestType}
- </if>
- <if test="pestVolum !=null">
- and pest_volum = #{pestVolum}
- </if>
- <if test="pestLevel !=null">
- and pest_level = #{pestLevel}
- </if>
- <if test="waterPosition !=null">
- and water_position = #{waterPosition}
- </if>
- <if test="waterArea !=null">
- and water_area = #{waterArea}
- </if>
- <if test="waterDepth !=null">
- and water_depth = #{waterDepth}
- </if>
- <if test="waterHeightest !=null">
- and water_heightest = #{waterHeightest}
- </if>
- <if test="inTemp !=null">
- and in_temp = #{inTemp}
- </if>
- <if test="outTemp !=null">
- and out_temp = #{outTemp}
- </if>
- <if test="inWater !=null">
- and in_water = #{inWater}
- </if>
- <if test="outWater !=null">
- and out_water = #{outWater}
- </if>
- <if test="maxTemp !=null">
- and max_temp = #{maxTemp}
- </if>
- <if test="maxtempPosition !=null">
- and maxtemp_position = #{maxtempPosition}
- </if>
- <if test="checkSituation !=null">
- and check_situation = #{checkSituation}
- </if>
- <if test="treatmentAdvice !=null">
- and treatment_advice = #{treatmentAdvice}
- </if>
- <if test="checkSign !=null">
- and check_sign = #{checkSign}
- </if>
- <if test="custodianSign !=null">
- and custodian_sign = #{custodianSign}
- </if>
- <if test="remark !=null">
- and remark = #{remark}
- </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>
- </where>
- <choose>
- <when test="page !=null and page.orderBy != null and page.orderBy != ''">
- ORDER BY ${page.orderBy}
- </when>
- <otherwise>
- </otherwise>
- </choose>
- </select>
- <resultMap type="cn.ourwill.module.house.entity.daily.DailyRecordFoodinfo" id="statisticsMap" extends="baseMap">
- <result column="grainName" property="grainName"/>
- <result column="house_name" property="houseName"/>
- <result column="keeperName" property="keeperName"/>
- <result column="keeperPhone" property="keeperPhone"/>
- </resultMap>
- <select id="findTheLast" resultMap="statisticsMap">
- SELECT drfk.id , drfk.uuid , drfk.house_id , drfk.`type` , drfk.content , drfk.htype , drfk.check_date , drfk.food_color , drfk.pest_position ,
- drfk.pest_type , drfk.pest_volum ,drfk.pest_level , drfk.water_position , drfk.water_area , drfk.water_depth , drfk.water_heightest , drfk.in_temp ,
- drfk.out_temp , drfk.in_water , drfk.out_water , drfk.max_temp , drfk.maxtemp_position , drfk.check_situation , drfk.treatment_advice ,
- drfk.check_sign , drfk.custodian_sign ,
- drfk.remark , drfk.c_id , drfk.c_time , drfk.u_id , drfk.u_time , drfk.version ,
- sg.name as grainName ,house.house_name
- ,hk.name as keeperName ,hk.phone as keeperPhone
- from daily_record_foodcheckinfo drfk,
- (
- select max(drf.check_date) as max , drf.house_id as houseId , drf.type as type
- from daily_record_foodcheckinfo drf
- where drf.type = #{type} and drf.xzflag != 1
- <if test="beginDate !=null and beginDate!=''">
- and drf.check_date >= str_to_date(#{beginDate},'%Y-%m-%d')
- </if>
- <if test="endDate !=null and endDate!=''">
- and drf.check_date <str_to_date(#{endDate},'%Y-%m-%d')
- </if>
- GROUP BY drf.house_id
- ) d
- ,house_info house
- ,sys_grain sg
- ,house_keeper hk
- where drfk.house_id = d.houseId and drfk.check_date = d.max and drfk.type = d.type
- and drfk.house_id = house.id and house.grain_id = sg.id
- AND (SELECT max(keeperId)FROM house_keeper_house WHERE (houseId = drfk.house_id) GROUP BY houseId)= hk.id
- and drfk.xzflag != 1
- <if test="grainId !=null">
- and sg.id = #{grainId}
- </if>
- <if test="cityId !=null">
- and sg.parentId = #{cityId}
- </if>
- <if test="maxTemp !=null">
- and drfk.max_temp >= #{maxTemp}
- </if>
- <if test="pestLevel !=null">
- and drfk.pest_level = #{pestLevel}
- </if>
- <choose>
- <when test="page !=null and page.orderBy != null and page.orderBy != ''">
- ORDER BY ${page.orderBy}
- </when>
- <otherwise>
- ORDER BY drfk.house_id desc
- </otherwise>
- </choose>
- </select>
- <select id="findTheLasts" resultMap="notbaseMap">
- SELECT drfk.id , drfk.uuid , drfk.house_id , drfk.`type` , drfk.content , drfk.htype , drfk.check_date , drfk.food_color , drfk.pest_position ,
- drfk.pest_type , drfk.pest_volum ,drfk.pest_level , drfk.water_position , drfk.water_area , drfk.water_depth , drfk.water_heightest , drfk.in_temp ,
- drfk.out_temp , drfk.in_water , drfk.out_water , drfk.max_temp , drfk.maxtemp_position ,
- sg.name as grainName ,house.house_name
- from daily_record_foodcheckinfo drfk,
- (
- select max(drf.check_date) as max , drf.house_id as houseId , drf.type as type
- from daily_record_foodcheckinfo drf
- where drf.type = #{type} and drf.xzflag != 1
- <if test="beginDate !=null and beginDate!=''">
- and drf.check_date >= str_to_date(#{beginDate},'%Y-%m-%d')
- </if>
- <if test="endDate !=null and endDate!=''">
- and drf.check_date <str_to_date(#{endDate},'%Y-%m-%d')
- </if>
- GROUP BY drf.house_id
- ) d
- ,house_info house
- ,sys_grain sg
- where drfk.house_id = d.houseId and drfk.check_date = d.max and drfk.type = d.type
- and drfk.house_id = house.id and house.grain_id = sg.id
- and drfk.xzflag != 1
- <if test="grainId !=null">
- and sg.id = #{grainId}
- </if>
- <if test="cityId !=null">
- and sg.parentId = #{cityId}
- </if>
- <if test="maxTemp !=null">
- and drfk.max_temp <![CDATA[ >= ]]> #{maxTemp}
- </if>
- <if test="pestLevel !=null">
- and drfk.pest_level = #{pestLevel}
- </if>
- <choose>
- <when test="page !=null and page.orderBy != null and page.orderBy != ''">
- ORDER BY ${page.orderBy}
- </when>
- <otherwise>
- ORDER BY drfk.house_id desc
- </otherwise>
- </choose>
- </select>
- <select id="findListByHouseId" resultMap="baseMap" parameterType="Map">
- SELECT
- <include refid="columns"/>
- from daily_record_foodcheckinfo drfk
- where type = 0
- <if test="houseId !=null">
- and drfk.house_id = #{houseId}
- </if>
- <if test="beginDate !=null and beginDate!=''">
- and drfk.check_date >= str_to_date(#{beginDate},'%Y-%m-%d')
- </if>
- <if test="endDate !=null and endDate!=''">
- and drfk.check_date < str_to_date(#{endDate},'%Y-%m-%d')
- </if>
- order by str_to_date(drfk.check_date,'%Y-%m-%d') asc,drfk.id desc
- </select>
- <select id="getTempByHouseId" resultMap="baseMap" parameterType="Map">
- SELECT
- <include refid="columns"/>
- from daily_record_foodcheckinfo drf where drf.content is not null
- <if test="houseId !=null">
- and drf.house_id = #{houseId}
- </if>
- order by STR_TO_DATE(drf.check_date, '%Y-%m-%d') desc ,id desc limit 1
- </select>
- <select id="getTempComPare" resultMap="baseMap" parameterType="Map">
- SELECT
- <include refid="columns"/>
- from daily_record_foodcheckinfo drf where drf.content is not null
- <if test="houseIdOne !=null and houseIdTwo !=null">
- and (drf.house_id = #{houseIdOne} or drf.house_id = #{houseIdTwo})
- </if>
- <if test="beginDate !=null and beginDate!=''">
- and drf.check_date >= str_to_date(#{beginDate},'%Y-%m-%d')
- </if>
- <if test="endDate !=null and endDate!=''">
- and drf.check_date <= str_to_date(#{endDate},'%Y-%m-%d')
- </if>
- order by STR_TO_DATE(drf.check_date, '%Y-%m-%d') asc
- </select>
- <insert id="insert" keyColumn="id" keyProperty="id" useGeneratedKeys="true"
- parameterType="cn.ourwill.module.house.entity.daily.DailyRecordFoodinfo" >
- INSERT INTO daily_record_foodcheckinfo
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test=" id != null">
- id,
- </if>
- <if test=" uuid != null">
- uuid,
- </if>
- <if test=" houseId != null">
- house_id,
- </if>
- <if test=" type != null">
- `type`,
- </if>
- <if test=" content != null">
- content,
- </if>
- <if test=" htype != null">
- htype,
- </if>
- <if test=" checkDate != null">
- check_date,
- </if>
- <if test=" foodColor != null">
- food_color,
- </if>
- <if test=" pestPosition != null">
- pest_position,
- </if>
- <if test=" pestType != null">
- pest_type,
- </if>
- <if test=" pestVolum != null">
- pest_volum,
- </if>
- <if test="pestLevel !=null">
- pest_level,
- </if>
- <if test=" waterPosition != null">
- water_position,
- </if>
- <if test=" waterArea != null">
- water_area,
- </if>
- <if test=" waterDepth != null">
- water_depth,
- </if>
- <if test=" waterHeightest != null">
- water_heightest,
- </if>
- <if test="inTemp !=null">
- in_temp,
- </if>
- <if test="outTemp !=null">
- out_temp,
- </if>
- <if test="inWater !=null">
- in_water,
- </if>
- <if test="outWater !=null">
- out_water,
- </if>
- <if test="maxTemp !=null">
- max_temp,
- </if>
- <if test="maxtempPosition !=null">
- maxtemp_position,
- </if>
- <if test=" checkSituation != null">
- check_situation,
- </if>
- <if test=" treatmentAdvice != null">
- treatment_advice,
- </if>
- <if test=" checkSign != null">
- check_sign,
- </if>
- <if test=" custodianSign != null">
- custodian_sign,
- </if>
- <if test=" remark != null">
- remark,
- </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="xzflag !=null">
- xzflag,
- </if>
- <if test="nonormalType !=null">
- nonormal_type,
- </if>
- <if test="nonormalPosition !=null">
- nonormal_position,
- </if>
- <if test="nonormalDomain !=null">
- nonormal_domain,
- </if>
- <if test="nonormalTemp !=null">
- nonormal_temp,
- </if>
- <if test="nonormalWater !=null">
- nonormal_water,
- </if>
- <if test="mouseRecord !=null">
- mouse_record,
- </if>
- <if test="sectRecord !=null">
- sect_record,
- </if>
- <if test="badRecord !=null">
- bad_record,
- </if>
- <if test="accidentRecord !=null">
- accident_record,
- </if>
- <if test="minTemp !=null">
- min_temp,
- </if>
- <if test="avgTemp !=null">
- avg_temp
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test=" id != null">
- #{id}, </if>
- <if test=" uuid != null">
- #{uuid}, </if>
- <if test=" houseId != null">
- #{houseId}, </if>
- <if test=" type != null">
- #{type}, </if>
- <if test=" content != null">
- #{content}, </if>
- <if test=" htype != null">
- #{htype}, </if>
- <if test=" checkDate != null">
- #{checkDate}, </if>
- <if test=" foodColor != null">
- #{foodColor}, </if>
- <if test=" pestPosition != null">
- #{pestPosition}, </if>
- <if test=" pestType != null">
- #{pestType}, </if>
- <if test=" pestVolum != null">
- #{pestVolum}, </if>
- <if test="pestLevel !=null">
- #{pestLevel}, </if>
- <if test=" waterPosition != null">
- #{waterPosition}, </if>
- <if test=" waterArea != null">
- #{waterArea}, </if>
- <if test=" waterDepth != null">
- #{waterDepth}, </if>
- <if test=" waterHeightest != null">
- #{waterHeightest}, </if>
- <if test="inTemp !=null">
- #{inTemp}, </if>
- <if test="outTemp !=null">
- #{outTemp}, </if>
- <if test="inWater !=null">
- #{inWater}, </if>
- <if test="outWater !=null">
- #{outWater}, </if>
- <if test="maxTemp !=null">
- #{maxTemp}, </if>
- <if test="maxtempPosition !=null">
- #{maxtempPosition}, </if>
- <if test=" checkSituation != null">
- #{checkSituation}, </if>
- <if test=" treatmentAdvice != null">
- #{treatmentAdvice}, </if>
- <if test=" checkSign != null">
- #{checkSign}, </if>
- <if test=" custodianSign != null">
- #{custodianSign}, </if>
- <if test=" remark != null">
- #{remark}, </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=" xzflag != null">
- #{xzflag}, </if>
- <if test=" nonormalType != null">
- #{nonormalType},
- </if>
- <if test=" nonormalPosition != null">
- #{nonormalPosition},
- </if>
- <if test=" nonormalDomain != null">
- #{nonormalDomain},
- </if>
- <if test=" nonormalTemp != null">
- #{nonormalTemp},
- </if>
- <if test=" nonormalWater != null">
- #{nonormalWater},
- </if>
- <if test=" mouseRecord != null">
- #{mouseRecord},
- </if>
- <if test=" sectRecord != null">
- #{sectRecord},
- </if>
- <if test=" badRecord != null">
- #{badRecord},
- </if>
- <if test=" accidentRecord != null">
- #{accidentRecord},
- </if>
- <if test=" minTemp != null">
- #{minTemp},
- </if>
- <if test=" avgTemp != null">
- #{avgTemp}
- </if>
- </trim>
- </insert>
- <update id="update" parameterType="cn.ourwill.module.house.entity.daily.DailyRecordFoodinfo">
- UPDATE daily_record_foodcheckinfo <set>
- <if test="id != null">
- id= #{id} ,
- </if>
- <if test="uuid != null">
- uuid= #{uuid} ,
- </if>
- <if test="houseId != null">
- house_id= #{houseId} ,
- </if>
- <if test="type != null">
- `type`= #{type} ,
- </if>
- <if test="content != null">
- content= #{content} ,
- </if>
- <if test="htype != null">
- htype= #{htype} ,
- </if>
- <if test="checkDate != null">
- check_date= #{checkDate} ,
- </if>
- <if test="foodColor != null">
- food_color= #{foodColor} ,
- </if>
- <if test="pestPosition != null">
- pest_position= #{pestPosition} ,
- </if>
- <if test="pestType != null">
- pest_type= #{pestType} ,
- </if>
- <if test="pestVolum != null">
- pest_volum= #{pestVolum} ,
- </if>
- <if test="pestLevel !=null">
- pest_level = #{pestLevel} ,
- </if>
- <if test="waterPosition != null">
- water_position= #{waterPosition} ,
- </if>
- <if test="waterArea != null">
- water_area= #{waterArea} ,
- </if>
- <if test="waterDepth != null">
- water_depth= #{waterDepth} ,
- </if>
- <if test="waterHeightest != null">
- water_heightest= #{waterHeightest} ,
- </if>
- <if test="inTemp !=null">
- in_temp = #{inTemp} ,
- </if>
- <if test="outTemp !=null">
- out_temp = #{outTemp} ,
- </if>
- <if test="inWater !=null">
- in_water = #{inWater} ,
- </if>
- <if test="outWater !=null">
- out_water = #{outWater} ,
- </if>
- <if test="maxTemp !=null">
- max_temp = #{maxTemp} ,
- </if>
- <if test="maxtempPosition !=null">
- maxtemp_position = #{maxtempPosition} ,
- </if>
- <if test="checkSituation != null">
- check_situation= #{checkSituation} ,
- </if>
- <if test="treatmentAdvice != null">
- treatment_advice= #{treatmentAdvice} ,
- </if>
- <if test="checkSign != null">
- check_sign= #{checkSign} ,
- </if>
- <if test="custodianSign != null">
- custodian_sign= #{custodianSign} ,
- </if>
- <if test="remark != null">
- remark= #{remark} ,
- </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="xzflag != null">
- xzflag= #{xzflag},
- </if>
- # 二期增加字段
- <if test=" nonormalType != null">
- nonormal_type = #{nonormalType},
- </if>
- <if test=" nonormalPosition != null">
- nonormal_position = #{nonormalPosition},
- </if>
- <if test=" nonormalDomain != null">
- nonormal_domain = #{nonormalDomain},
- </if>
- <if test=" nonormalTemp != null">
- nonormal_temp = #{nonormalTemp},
- </if>
- <if test=" nonormalWater != null">
- nonormal_water = #{nonormalWater},
- </if>
- <if test=" mouseRecord != null">
- mouse_record = #{mouseRecord},
- </if>
- <if test=" sectRecord != null">
- sect_record = #{sectRecord},
- </if>
- <if test=" badRecord != null">
- bad_record = #{badRecord},
- </if>
- <if test=" accidentRecord != null">
- accident_record = #{accidentRecord},
- </if>
- <if test=" minTemp != null">
- min_temp = #{minTemp},
- </if>
- <if test=" avgTemp != null">
- avg_temp = #{avgTemp}
- </if>
- </set>
- WHERE id = #{id}
- </update>
- <update id="updateByUuid" parameterType="cn.ourwill.module.house.entity.daily.DailyRecordFoodinfo">
- UPDATE daily_record_foodcheckinfo <set>
- <if test="houseId != null">
- house_id= #{houseId} ,
- </if>
- <if test="type != null">
- `type`= #{type} ,
- </if>
- <if test="content != null">
- content= #{content} ,
- </if>
- <if test="htype != null">
- htype= #{htype} ,
- </if>
- <if test="checkDate != null">
- check_date= #{checkDate} ,
- </if>
- <if test="foodColor != null">
- food_color= #{foodColor} ,
- </if>
- <if test="pestPosition != null">
- pest_position= #{pestPosition} ,
- </if>
- <if test="pestType != null">
- pest_type= #{pestType} ,
- </if>
- <if test="pestVolum != null">
- pest_volum= #{pestVolum} ,
- </if>
- <if test="pestLevel !=null">
- pest_level = #{pestLevel} ,
- </if>
- <if test="waterPosition != null">
- water_position= #{waterPosition} ,
- </if>
- <if test="waterArea != null">
- water_area= #{waterArea} ,
- </if>
- <if test="waterDepth != null">
- water_depth= #{waterDepth} ,
- </if>
- <if test="waterHeightest != null">
- water_heightest= #{waterHeightest} ,
- </if>
- <if test="inTemp !=null">
- in_temp = #{inTemp} ,
- </if>
- <if test="outTemp !=null">
- out_temp = #{outTemp} ,
- </if>
- <if test="inWater !=null">
- in_water = #{inWater} ,
- </if>
- <if test="outWater !=null">
- out_water = #{outWater} ,
- </if>
- <if test="maxTemp !=null">
- max_temp = #{maxTemp} ,
- </if>
- <if test="maxtempPosition !=null">
- maxtemp_position = #{maxtempPosition} ,
- </if>
- <if test="checkSituation != null">
- check_situation= #{checkSituation} ,
- </if>
- <if test="treatmentAdvice != null">
- treatment_advice= #{treatmentAdvice} ,
- </if>
- <if test="checkSign != null">
- check_sign= #{checkSign} ,
- </if>
- <if test="custodianSign != null">
- custodian_sign= #{custodianSign} ,
- </if>
- <if test="remark != null">
- remark= #{remark} ,
- </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>
- </set>
- WHERE uuid = #{uuid}
- </update>
- <delete id="deleteById" parameterType="java.lang.Long">
- DELETE FROM daily_record_foodcheckinfo WHERE id = #{id}
- </delete>
- <delete id="deleteByIds" parameterType="java.util.List">
- DELETE FROM daily_record_foodcheckinfo WHERE id IN
- <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </delete>
- <select id="findByHouseIdNoPage" resultMap="baseMap">
- SELECT *
- FROM daily_record_foodcheckinfo a
- where house_id=#{houseId}
- <if test="cTime != null">
- AND check_date <![CDATA[ <= ]]> #{cTime}
- </if>
- </select>
- <delete id="deleteFoodInfoByHouseId">
- DELETE FROM daily_record_foodcheckinfo
- WHERE house_id = #{houseId}
- <if test="cTime != null">
- AND check_date <![CDATA[ <= ]]> #{cTime}
- </if>
- </delete>
- <select id="findHouseId" resultType="cn.ourwill.module.house.entity.daily.DailyRecordFoodinfo">
- SELECT *
- FROM daily_record_foodcheckinfo
- <where>
- <if test="houseId !=null">
- and house_id = #{houseId}
- </if>
- <if test="cTime !=null">
- and check_date like CONCAT('%',#{cTime},'%')
- </if>
- </where>
- order by check_date ASC limit #{num},#{size}
- </select>
- </mapper>
|