123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538 |
- <?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.DailyRecordHouseCheckNewDao" >
- <resultMap id="BaseResultMap" type="cn.ourwill.module.house.entity.daily.DailyRecordHouseCheckNew" >
- <id column="id" property="id"/>
- <result column="grain_id" property="grainId"/>
- <result column="house_id" property="houseId"/>
- <result column="location" property="location"/>
- <result column="house_type" property="houseType"/>
- <result column="type" property="type"/>
- <result column="number" property="number"/>
- <result column="prod_year" property="prodYear"/>
- <result column="in_time" property="inTime"/>
- <result column="level" property="level"/>
- <result column="water" property="water"/>
- <result column="impurity" property="impurity"/>
- <result column="lay_type" property="layType"/>
- <result column="temperature_max" property="temperatureMax"/>
- <result column="temperature_min" property="temperatureMin"/>
- <result column="temperature_avg" property="temperatureAvg"/>
- <result column="is_density" property="isDensity"/>
- <result column="is_hot" property="isHot"/>
- <result column="is_condensation" property="isCondensation"/>
- <result column="location_length" property="locationLength"/>
- <result column="location_widtn" property="locationWidtn"/>
- <result column="location_height" property="locationHeight"/>
- <result column="is_check" property="isCheck"/>
- <result column="is_warm" property="isWarm"/>
- <result column="is_lay" property="isLay"/>
- <result column="remark" property="remark"/>
- <result column="checker" property="checker"/>
- <result column="check_date" property="checkDate"/>
- <result column="charge" property="charge"/>
- <result column="uuid" property="uuid"/>
- <result column="c_id" property="cId"/>
- <result column="c_time" property="cTime" />
- <result column="u_id" property="uId"/>
- <result column="u_time" property="uTime" />
- </resultMap>
- <sql id="joinCols">
- </sql>
- <sql id="Base_Column_List" >
- id, grain_id, house_id, location, house_type, type, number, prod_year, in_time, level,
- water, impurity, lay_type, temperature_max, temperature_min, temperature_avg, is_density,
- is_hot, is_condensation, location_length, location_widtn, location_height, is_check,
- is_warm, is_lay, remark, checker,check_date,charge, uuid, c_id, c_time, u_id, u_time
- </sql>
- <select id="findList" resultMap="BaseResultMap">
- select
- a.*
- from daily_record_house_check_new a
- left join sys_grain sg on a.grain_id = sg.id
- <include refid="joinCols"/>
- <where>
- <if test="grainId !=null and grainId !=''" >
- and grain_id = #{grainId}
- </if>
- <!--<if test="grainList !=null" >
- and grain_id in
- <foreach item="item" index="index" collection="grainList" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>-->
- <if test="houseId !=null and houseId !=''">
- and house_id = #{houseId}
- </if>
- <if test="houseType !=null and houseType !=''">
- and house_type = #{houseType}
- </if>
- <if test="type !=null and type !=''">
- and type = #{type}
- </if>
- <if test="checkDate !=null and checkDate !=''">
- and check_date = #{checkDate}
- </if>
- </where>
- order by check_date desc
- <!-- <choose>
- <when test="page !=null and page.orderBy != null and page.orderBy != ''">
- ORDER BY ${page.orderBy}
- </when>
- <otherwise>
- </otherwise>
- </choose>-->
- </select>
- <select id="get" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from daily_record_house_check_new
- where id = #{id}
- </select>
- <delete id="deleteById" parameterType="java.lang.Long" >
- delete from daily_record_house_check_new
- where id = #{id}
- </delete>
- <insert id="insert" parameterType="cn.ourwill.module.house.entity.daily.DailyRecordHouseCheckNew" >
- insert into daily_record_house_check_new
- <trim prefix="(" suffix=")" suffixOverrides="," >
- <if test="id != null" >
- id,
- </if>
- <if test="grainId != null" >
- grain_id,
- </if>
- <if test="houseId != null" >
- house_id,
- </if>
- <if test="location != null" >
- location,
- </if>
- <if test="houseType != null" >
- house_type,
- </if>
- <if test="type != null" >
- type,
- </if>
- <if test="number != null" >
- number,
- </if>
- <if test="prodYear != null" >
- prod_year,
- </if>
- <if test="inTime != null" >
- in_time,
- </if>
- <if test="level != null" >
- level,
- </if>
- <if test="water != null" >
- water,
- </if>
- <if test="impurity != null" >
- impurity,
- </if>
- <if test="layType != null" >
- lay_type,
- </if>
- <if test="temperatureMax != null" >
- temperature_max,
- </if>
- <if test="temperatureMin != null" >
- temperature_min,
- </if>
- <if test="temperatureAvg != null" >
- temperature_avg,
- </if>
- <if test="isDensity != null" >
- is_density,
- </if>
- <if test="isHot != null" >
- is_hot,
- </if>
- <if test="isCondensation != null" >
- is_condensation,
- </if>
- <if test="locationLength != null" >
- location_length,
- </if>
- <if test="locationWidtn != null" >
- location_widtn,
- </if>
- <if test="locationHeight != null" >
- location_height,
- </if>
- <if test="isCheck != null" >
- is_check,
- </if>
- <if test="isWarm != null" >
- is_warm,
- </if>
- <if test="isLay != null" >
- is_lay,
- </if>
- <if test="remark != null" >
- remark,
- </if>
- <if test="checker != null" >
- checker,
- </if>
- <if test="checkDate != null" >
- check_date,
- </if>
- <if test="charge != null" >
- charge,
- </if>
- <if test="uuid != null" >
- uuid,
- </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>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides="," >
- <if test="id != null" >
- #{id},
- </if>
- <if test="grainId != null" >
- #{grainId},
- </if>
- <if test="houseId != null" >
- #{houseId},
- </if>
- <if test="location != null" >
- #{location},
- </if>
- <if test="houseType != null" >
- #{houseType},
- </if>
- <if test="type != null" >
- #{type},
- </if>
- <if test="number != null" >
- #{number},
- </if>
- <if test="prodYear != null" >
- #{prodYear},
- </if>
- <if test="inTime != null" >
- #{inTime},
- </if>
- <if test="level != null" >
- #{level},
- </if>
- <if test="water != null" >
- #{water},
- </if>
- <if test="impurity != null" >
- #{impurity},
- </if>
- <if test="layType != null" >
- #{layType},
- </if>
- <if test="temperatureMax != null" >
- #{temperatureMax},
- </if>
- <if test="temperatureMin != null" >
- #{temperatureMin},
- </if>
- <if test="temperatureAvg != null" >
- #{temperatureAvg},
- </if>
- <if test="isDensity != null" >
- #{isDensity},
- </if>
- <if test="isHot != null" >
- #{isHot},
- </if>
- <if test="isCondensation != null" >
- #{isCondensation},
- </if>
- <if test="locationLength != null" >
- #{locationLength},
- </if>
- <if test="locationWidtn != null" >
- #{locationWidtn},
- </if>
- <if test="locationHeight != null" >
- #{locationHeight},
- </if>
- <if test="isCheck != null" >
- #{isCheck},
- </if>
- <if test="isWarm != null" >
- #{isWarm},
- </if>
- <if test="isLay != null" >
- #{isLay},
- </if>
- <if test="remark != null" >
- #{remark},
- </if>
- <if test="checker != null" >
- #{checker},
- </if>
- <if test="checkDate != null" >
- #{checkDate},
- </if>
- <if test="charge != null" >
- #{charge},
- </if>
- <if test="uuid != null" >
- #{uuid},
- </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>
- </trim>
- </insert>
- <update id="update" parameterType="cn.ourwill.module.house.entity.daily.DailyRecordHouseCheckNew" >
- update daily_record_house_check_new
- <set >
- <if test="grainId != null" >
- grain_id = #{grainId},
- </if>
- <if test="houseId != null" >
- house_id = #{houseId},
- </if>
- <if test="location != null" >
- location = #{location},
- </if>
- <if test="houseType != null" >
- house_type = #{houseType},
- </if>
- <if test="type != null" >
- type = #{type},
- </if>
- <if test="number != null" >
- number = #{number},
- </if>
- <if test="prodYear != null" >
- prod_year = #{prodYear},
- </if>
- <if test="inTime != null" >
- in_time = #{inTime},
- </if>
- <if test="level != null" >
- level = #{level},
- </if>
- <if test="water != null" >
- water = #{water},
- </if>
- <if test="impurity != null" >
- impurity = #{impurity},
- </if>
- <if test="layType != null" >
- lay_type = #{layType},
- </if>
- <if test="temperatureMax != null" >
- temperature_max = #{temperatureMax},
- </if>
- <if test="temperatureMin != null" >
- temperature_min = #{temperatureMin},
- </if>
- <if test="temperatureAvg != null" >
- temperature_avg = #{temperatureAvg},
- </if>
- <if test="isDensity != null" >
- is_density = #{isDensity},
- </if>
- <if test="isHot != null" >
- is_hot = #{isHot},
- </if>
- <if test="isCondensation != null" >
- is_condensation = #{isCondensation},
- </if>
- <if test="locationLength != null" >
- location_length = #{locationLength},
- </if>
- <if test="locationWidtn != null" >
- location_widtn = #{locationWidtn},
- </if>
- <if test="locationHeight != null" >
- location_height = #{locationHeight},
- </if>
- <if test="isCheck != null" >
- is_check = #{isCheck},
- </if>
- <if test="isWarm != null" >
- is_warm = #{isWarm},
- </if>
- <if test="isLay != null" >
- is_lay = #{isLay},
- </if>
- <if test="remark != null" >
- remark = #{remark},
- </if>
- <if test="checker != null" >
- checker = #{checker},
- </if>
- <if test="checkDate != null" >
- check_date = #{checkDate},
- </if>
- <if test="charge != null" >
- charge = #{charge},
- </if>
- <if test="uuid != null" >
- uuid = #{uuid},
- </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 id = #{id}
- </update>
- <update id="updateByUUID" parameterType="cn.ourwill.module.house.entity.daily.DailyRecordHouseCheckNew" >
- update daily_record_house_check_new
- <set >
- <if test="grainId != null" >
- grain_id = #{grainId},
- </if>
- <if test="houseId != null" >
- house_id = #{houseId},
- </if>
- <if test="location != null" >
- location = #{location},
- </if>
- <if test="houseType != null" >
- house_type = #{houseType},
- </if>
- <if test="type != null" >
- type = #{type},
- </if>
- <if test="number != null" >
- number = #{number},
- </if>
- <if test="prodYear != null" >
- prod_year = #{prodYear},
- </if>
- <if test="inTime != null" >
- in_time = #{inTime},
- </if>
- <if test="level != null" >
- level = #{level},
- </if>
- <if test="water != null" >
- water = #{water},
- </if>
- <if test="impurity != null" >
- impurity = #{impurity},
- </if>
- <if test="layType != null" >
- lay_type = #{layType},
- </if>
- <if test="temperatureMax != null" >
- temperature_max = #{temperatureMax},
- </if>
- <if test="temperatureMin != null" >
- temperature_min = #{temperatureMin},
- </if>
- <if test="temperatureAvg != null" >
- temperature_avg = #{temperatureAvg},
- </if>
- <if test="isDensity != null" >
- is_density = #{isDensity},
- </if>
- <if test="isHot != null" >
- is_hot = #{isHot},
- </if>
- <if test="isCondensation != null" >
- is_condensation = #{isCondensation},
- </if>
- <if test="locationLength != null" >
- location_length = #{locationLength},
- </if>
- <if test="locationWidtn != null" >
- location_widtn = #{locationWidtn},
- </if>
- <if test="locationHeight != null" >
- location_height = #{locationHeight},
- </if>
- <if test="isCheck != null" >
- is_check = #{isCheck},
- </if>
- <if test="isWarm != null" >
- is_warm = #{isWarm},
- </if>
- <if test="isLay != null" >
- is_lay = #{isLay},
- </if>
- <if test="remark != null" >
- remark = #{remark},
- </if>
- <if test="checker != null" >
- checker = #{checker},
- </if>
- <if test="checkDate != null" >
- check_date = #{checkDate},
- </if>
- <if test="charge != null" >
- charge = #{charge},
- </if>
- <if test="uuid != null" >
- uuid = #{uuid},
- </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>
- <select id="findByHouseId" resultMap="BaseResultMap">
- SELECT *
- FROM daily_record_house_check_new a
- where house_id=#{houseId}
- <if test="cTime != null">
- AND c_time <![CDATA[ <= ]]> #{cTime}
- </if>
- </select>
- <select id="getByUuid" resultMap="BaseResultMap">
- SELECT *
- FROM daily_record_house_check_new a
- where uuid=#{uuid}
- </select>
- <delete id="deleteByHouseId" parameterType="java.lang.Long" >
- delete from daily_record_house_check_new
- where house_id=#{houseId}
- </delete>
- </mapper>
|