| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749 |
- <?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.chinaitop.depot.agent.temperature.mapper.BusinessAgentTemperatureMapper" >
- <resultMap id="BaseResultMap" type="com.chinaitop.depot.agent.temperature.model.BusinessAgentTemperature" >
- <id column="id" property="id" jdbcType="INTEGER" />
- <result column="agent_id" property="agentId" jdbcType="INTEGER" />
- <result column="agent_depot_id" property="agentDepotId" jdbcType="INTEGER" />
- <result column="storehouse_id" property="storehouseId" jdbcType="INTEGER" />
- <result column="weather" property="weather" jdbcType="VARCHAR" />
- <result column="actual_amount" property="actualAmount" jdbcType="VARCHAR" />
- <result column="lspz" property="lspz" jdbcType="INTEGER" />
- <result column="nature" property="nature" jdbcType="VARCHAR" />
- <result column="level" property="level" jdbcType="INTEGER" />
- <result column="harvest_year" property="harvestYear" jdbcType="INTEGER" />
- <result column="enter_time" property="enterTime" jdbcType="TIMESTAMP" />
- <result column="keeper" property="keeper" jdbcType="VARCHAR" />
- <result column="house_temperature" property="houseTemperature" jdbcType="DECIMAL" />
- <result column="house_humidity" property="houseHumidity" jdbcType="DECIMAL" />
- <result column="gas_temperature" property="gasTemperature" jdbcType="DECIMAL" />
- <result column="gas_humidity" property="gasHumidity" jdbcType="DECIMAL" />
- <result column="detection_time" property="detectionTime" jdbcType="TIMESTAMP" />
- <result column="max" property="max" jdbcType="DECIMAL" />
- <result column="min" property="min" jdbcType="DECIMAL" />
- <result column="avg" property="avg" jdbcType="DECIMAL" />
- <result column="org_id" property="orgId" jdbcType="INTEGER" />
- <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
- <result column="updatetime" property="updatetime" jdbcType="TIMESTAMP" />
- </resultMap>
- <resultMap id="ResultMapWithBLOBs" type="com.chinaitop.depot.agent.temperature.model.BusinessAgentTemperature" extends="BaseResultMap" >
- <result column="t_points" property="tPoints" jdbcType="LONGVARCHAR" />
- </resultMap>
- <sql id="Example_Where_Clause" >
- <where >
- <foreach collection="oredCriteria" item="criteria" separator="or" >
- <if test="criteria.valid" >
- <trim prefix="(" suffix=")" prefixOverrides="and" >
- <foreach collection="criteria.criteria" item="criterion" >
- <choose >
- <when test="criterion.noValue" >
- and ${criterion.condition}
- </when>
- <when test="criterion.singleValue" >
- and ${criterion.condition} #{criterion.value}
- </when>
- <when test="criterion.betweenValue" >
- and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
- </when>
- <when test="criterion.listValue" >
- and ${criterion.condition}
- <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
- #{listItem}
- </foreach>
- </when>
- </choose>
- </foreach>
- </trim>
- </if>
- </foreach>
- </where>
- </sql>
- <sql id="Update_By_Example_Where_Clause" >
- <where >
- <foreach collection="example.oredCriteria" item="criteria" separator="or" >
- <if test="criteria.valid" >
- <trim prefix="(" suffix=")" prefixOverrides="and" >
- <foreach collection="criteria.criteria" item="criterion" >
- <choose >
- <when test="criterion.noValue" >
- and ${criterion.condition}
- </when>
- <when test="criterion.singleValue" >
- and ${criterion.condition} #{criterion.value}
- </when>
- <when test="criterion.betweenValue" >
- and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
- </when>
- <when test="criterion.listValue" >
- and ${criterion.condition}
- <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
- #{listItem}
- </foreach>
- </when>
- </choose>
- </foreach>
- </trim>
- </if>
- </foreach>
- </where>
- </sql>
- <sql id="Base_Column_List" >
- id, agent_id, agent_depot_id, storehouse_id, weather, actual_amount, lspz, nature,
- level, harvest_year, enter_time, keeper, house_temperature, house_humidity, gas_temperature,
- gas_humidity, detection_time, max, min, avg, org_id, create_time, updatetime
- </sql>
- <sql id="Blob_Column_List" >
- t_points
- </sql>
- <select id="selectByExampleWithBLOBs" resultMap="ResultMapWithBLOBs" parameterType="com.chinaitop.depot.agent.temperature.model.BusinessAgentTemperatureExample" >
- select
- <if test="distinct" >
- distinct
- </if>
- <include refid="Base_Column_List" />
- ,
- <include refid="Blob_Column_List" />
- from business_agent_temperature
- <if test="_parameter != null" >
- <include refid="Example_Where_Clause" />
- </if>
- <if test="orderByClause != null" >
- order by ${orderByClause}
- </if>
- </select>
- <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.chinaitop.depot.agent.temperature.model.BusinessAgentTemperatureExample" >
- select
- <if test="distinct" >
- distinct
- </if>
- <include refid="Base_Column_List" />
- from business_agent_temperature
- <if test="_parameter != null" >
- <include refid="Example_Where_Clause" />
- </if>
- <if test="orderByClause != null" >
- order by ${orderByClause}
- </if>
- </select>
- <select id="selectByPrimaryKey" resultMap="ResultMapWithBLOBs" parameterType="java.lang.Integer" >
- select
- <include refid="Base_Column_List" />
- ,
- <include refid="Blob_Column_List" />
- from business_agent_temperature
- where id = #{id,jdbcType=INTEGER}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
- delete from business_agent_temperature
- where id = #{id,jdbcType=INTEGER}
- </delete>
- <delete id="deleteByExample" parameterType="com.chinaitop.depot.agent.temperature.model.BusinessAgentTemperatureExample" >
- delete from business_agent_temperature
- <if test="_parameter != null" >
- <include refid="Example_Where_Clause" />
- </if>
- </delete>
- <insert id="insert" useGeneratedKeys="true" keyProperty="id" parameterType="com.chinaitop.depot.agent.temperature.model.BusinessAgentTemperature" >
- insert into business_agent_temperature (id, agent_id, agent_depot_id,
- storehouse_id, weather, actual_amount,
- lspz, nature, level,
- harvest_year, enter_time, keeper,
- house_temperature, house_humidity, gas_temperature,
- gas_humidity, detection_time, max,
- min, avg, org_id, create_time,
- updatetime, t_points)
- values (#{id,jdbcType=INTEGER}, #{agentId,jdbcType=INTEGER}, #{agentDepotId,jdbcType=INTEGER},
- #{storehouseId,jdbcType=INTEGER}, #{weather,jdbcType=VARCHAR}, #{actualAmount,jdbcType=VARCHAR},
- #{lspz,jdbcType=INTEGER}, #{nature,jdbcType=VARCHAR}, #{level,jdbcType=INTEGER},
- #{harvestYear,jdbcType=INTEGER}, #{enterTime,jdbcType=TIMESTAMP}, #{keeper,jdbcType=VARCHAR},
- #{houseTemperature,jdbcType=DECIMAL}, #{houseHumidity,jdbcType=DECIMAL}, #{gasTemperature,jdbcType=DECIMAL},
- #{gasHumidity,jdbcType=DECIMAL}, #{detectionTime,jdbcType=TIMESTAMP}, #{max,jdbcType=DECIMAL},
- #{min,jdbcType=DECIMAL}, #{avg,jdbcType=DECIMAL}, #{orgId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
- #{updatetime,jdbcType=TIMESTAMP}, #{tPoints,jdbcType=LONGVARCHAR})
- </insert>
- <insert id="insertSelective" parameterType="com.chinaitop.depot.agent.temperature.model.BusinessAgentTemperature" >
- insert into business_agent_temperature
- <trim prefix="(" suffix=")" suffixOverrides="," >
- <if test="id != null" >
- id,
- </if>
- <if test="agentId != null" >
- agent_id,
- </if>
- <if test="agentDepotId != null" >
- agent_depot_id,
- </if>
- <if test="storehouseId != null" >
- storehouse_id,
- </if>
- <if test="weather != null" >
- weather,
- </if>
- <if test="actualAmount != null" >
- actual_amount,
- </if>
- <if test="lspz != null" >
- lspz,
- </if>
- <if test="nature != null" >
- nature,
- </if>
- <if test="level != null" >
- level,
- </if>
- <if test="harvestYear != null" >
- harvest_year,
- </if>
- <if test="enterTime != null" >
- enter_time,
- </if>
- <if test="keeper != null" >
- keeper,
- </if>
- <if test="houseTemperature != null" >
- house_temperature,
- </if>
- <if test="houseHumidity != null" >
- house_humidity,
- </if>
- <if test="gasTemperature != null" >
- gas_temperature,
- </if>
- <if test="gasHumidity != null" >
- gas_humidity,
- </if>
- <if test="detectionTime != null" >
- detection_time,
- </if>
- <if test="max != null" >
- max,
- </if>
- <if test="min != null" >
- min,
- </if>
- <if test="avg != null" >
- avg,
- </if>
- <if test="orgId != null" >
- org_id,
- </if>
- <if test="createTime != null" >
- create_time,
- </if>
- <if test="updatetime != null" >
- updatetime,
- </if>
- <if test="tPoints != null" >
- t_points,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides="," >
- <if test="id != null" >
- #{id,jdbcType=INTEGER},
- </if>
- <if test="agentId != null" >
- #{agentId,jdbcType=INTEGER},
- </if>
- <if test="agentDepotId != null" >
- #{agentDepotId,jdbcType=INTEGER},
- </if>
- <if test="storehouseId != null" >
- #{storehouseId,jdbcType=INTEGER},
- </if>
- <if test="weather != null" >
- #{weather,jdbcType=VARCHAR},
- </if>
- <if test="actualAmount != null" >
- #{actualAmount,jdbcType=VARCHAR},
- </if>
- <if test="lspz != null" >
- #{lspz,jdbcType=INTEGER},
- </if>
- <if test="nature != null" >
- #{nature,jdbcType=VARCHAR},
- </if>
- <if test="level != null" >
- #{level,jdbcType=INTEGER},
- </if>
- <if test="harvestYear != null" >
- #{harvestYear,jdbcType=INTEGER},
- </if>
- <if test="enterTime != null" >
- #{enterTime,jdbcType=TIMESTAMP},
- </if>
- <if test="keeper != null" >
- #{keeper,jdbcType=VARCHAR},
- </if>
- <if test="houseTemperature != null" >
- #{houseTemperature,jdbcType=DECIMAL},
- </if>
- <if test="houseHumidity != null" >
- #{houseHumidity,jdbcType=DECIMAL},
- </if>
- <if test="gasTemperature != null" >
- #{gasTemperature,jdbcType=DECIMAL},
- </if>
- <if test="gasHumidity != null" >
- #{gasHumidity,jdbcType=DECIMAL},
- </if>
- <if test="detectionTime != null" >
- #{detectionTime,jdbcType=TIMESTAMP},
- </if>
- <if test="max != null" >
- #{max,jdbcType=DECIMAL},
- </if>
- <if test="min != null" >
- #{min,jdbcType=DECIMAL},
- </if>
- <if test="avg != null" >
- #{avg,jdbcType=DECIMAL},
- </if>
- <if test="orgId != null" >
- #{orgId,jdbcType=INTEGER},
- </if>
- <if test="createTime != null" >
- #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="updatetime != null" >
- #{updatetime,jdbcType=TIMESTAMP},
- </if>
- <if test="tPoints != null" >
- #{tPoints,jdbcType=LONGVARCHAR},
- </if>
- </trim>
- </insert>
- <select id="countByExample" parameterType="com.chinaitop.depot.agent.temperature.model.BusinessAgentTemperatureExample" resultType="java.lang.Integer" >
- select count(*) from business_agent_temperature
- <if test="_parameter != null" >
- <include refid="Example_Where_Clause" />
- </if>
- </select>
- <update id="updateByExampleSelective" parameterType="map" >
- update business_agent_temperature
- <set >
- <if test="record.id != null" >
- id = #{record.id,jdbcType=INTEGER},
- </if>
- <if test="record.agentId != null" >
- agent_id = #{record.agentId,jdbcType=INTEGER},
- </if>
- <if test="record.agentDepotId != null" >
- agent_depot_id = #{record.agentDepotId,jdbcType=INTEGER},
- </if>
- <if test="record.storehouseId != null" >
- storehouse_id = #{record.storehouseId,jdbcType=INTEGER},
- </if>
- <if test="record.weather != null" >
- weather = #{record.weather,jdbcType=VARCHAR},
- </if>
- <if test="record.actualAmount != null" >
- actual_amount = #{record.actualAmount,jdbcType=VARCHAR},
- </if>
- <if test="record.lspz != null" >
- lspz = #{record.lspz,jdbcType=INTEGER},
- </if>
- <if test="record.nature != null" >
- nature = #{record.nature,jdbcType=VARCHAR},
- </if>
- <if test="record.level != null" >
- level = #{record.level,jdbcType=INTEGER},
- </if>
- <if test="record.harvestYear != null" >
- harvest_year = #{record.harvestYear,jdbcType=INTEGER},
- </if>
- <if test="record.enterTime != null" >
- enter_time = #{record.enterTime,jdbcType=TIMESTAMP},
- </if>
- <if test="record.keeper != null" >
- keeper = #{record.keeper,jdbcType=VARCHAR},
- </if>
- <if test="record.houseTemperature != null" >
- house_temperature = #{record.houseTemperature,jdbcType=DECIMAL},
- </if>
- <if test="record.houseHumidity != null" >
- house_humidity = #{record.houseHumidity,jdbcType=DECIMAL},
- </if>
- <if test="record.gasTemperature != null" >
- gas_temperature = #{record.gasTemperature,jdbcType=DECIMAL},
- </if>
- <if test="record.gasHumidity != null" >
- gas_humidity = #{record.gasHumidity,jdbcType=DECIMAL},
- </if>
- <if test="record.detectionTime != null" >
- detection_time = #{record.detectionTime,jdbcType=TIMESTAMP},
- </if>
- <if test="record.max != null" >
- max = #{record.max,jdbcType=DECIMAL},
- </if>
- <if test="record.min != null" >
- min = #{record.min,jdbcType=DECIMAL},
- </if>
- <if test="record.avg != null" >
- avg = #{record.avg,jdbcType=DECIMAL},
- </if>
- <if test="record.orgId != null" >
- org_id = #{record.orgId,jdbcType=INTEGER},
- </if>
- <if test="record.createTime != null" >
- create_time = #{record.createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="record.updatetime != null" >
- updatetime = #{record.updatetime,jdbcType=TIMESTAMP},
- </if>
- <if test="record.tPoints != null" >
- t_points = #{record.tPoints,jdbcType=LONGVARCHAR},
- </if>
- </set>
- <if test="_parameter != null" >
- <include refid="Update_By_Example_Where_Clause" />
- </if>
- </update>
- <update id="updateByExampleWithBLOBs" parameterType="map" >
- update business_agent_temperature
- set id = #{record.id,jdbcType=INTEGER},
- agent_id = #{record.agentId,jdbcType=INTEGER},
- agent_depot_id = #{record.agentDepotId,jdbcType=INTEGER},
- storehouse_id = #{record.storehouseId,jdbcType=INTEGER},
- weather = #{record.weather,jdbcType=VARCHAR},
- actual_amount = #{record.actualAmount,jdbcType=VARCHAR},
- lspz = #{record.lspz,jdbcType=INTEGER},
- nature = #{record.nature,jdbcType=VARCHAR},
- level = #{record.level,jdbcType=INTEGER},
- harvest_year = #{record.harvestYear,jdbcType=INTEGER},
- enter_time = #{record.enterTime,jdbcType=TIMESTAMP},
- keeper = #{record.keeper,jdbcType=VARCHAR},
- house_temperature = #{record.houseTemperature,jdbcType=DECIMAL},
- house_humidity = #{record.houseHumidity,jdbcType=DECIMAL},
- gas_temperature = #{record.gasTemperature,jdbcType=DECIMAL},
- gas_humidity = #{record.gasHumidity,jdbcType=DECIMAL},
- detection_time = #{record.detectionTime,jdbcType=TIMESTAMP},
- max = #{record.max,jdbcType=DECIMAL},
- min = #{record.min,jdbcType=DECIMAL},
- avg = #{record.avg,jdbcType=DECIMAL},
- org_id = #{record.orgId,jdbcType=INTEGER},
- create_time = #{record.createTime,jdbcType=TIMESTAMP},
- updatetime = #{record.updatetime,jdbcType=TIMESTAMP},
- t_points = #{record.tPoints,jdbcType=LONGVARCHAR}
- <if test="_parameter != null" >
- <include refid="Update_By_Example_Where_Clause" />
- </if>
- </update>
- <update id="updateByExample" parameterType="map" >
- update business_agent_temperature
- set id = #{record.id,jdbcType=INTEGER},
- agent_id = #{record.agentId,jdbcType=INTEGER},
- agent_depot_id = #{record.agentDepotId,jdbcType=INTEGER},
- storehouse_id = #{record.storehouseId,jdbcType=INTEGER},
- weather = #{record.weather,jdbcType=VARCHAR},
- actual_amount = #{record.actualAmount,jdbcType=VARCHAR},
- lspz = #{record.lspz,jdbcType=INTEGER},
- nature = #{record.nature,jdbcType=VARCHAR},
- level = #{record.level,jdbcType=INTEGER},
- harvest_year = #{record.harvestYear,jdbcType=INTEGER},
- enter_time = #{record.enterTime,jdbcType=TIMESTAMP},
- keeper = #{record.keeper,jdbcType=VARCHAR},
- house_temperature = #{record.houseTemperature,jdbcType=DECIMAL},
- house_humidity = #{record.houseHumidity,jdbcType=DECIMAL},
- gas_temperature = #{record.gasTemperature,jdbcType=DECIMAL},
- gas_humidity = #{record.gasHumidity,jdbcType=DECIMAL},
- detection_time = #{record.detectionTime,jdbcType=TIMESTAMP},
- max = #{record.max,jdbcType=DECIMAL},
- min = #{record.min,jdbcType=DECIMAL},
- avg = #{record.avg,jdbcType=DECIMAL},
- org_id = #{record.orgId,jdbcType=INTEGER},
- create_time = #{record.createTime,jdbcType=TIMESTAMP},
- updatetime = #{record.updatetime,jdbcType=TIMESTAMP}
- <if test="_parameter != null" >
- <include refid="Update_By_Example_Where_Clause" />
- </if>
- </update>
- <update id="updateByPrimaryKeySelective" parameterType="com.chinaitop.depot.agent.temperature.model.BusinessAgentTemperature" >
- update business_agent_temperature
- <set >
- <if test="agentId != null" >
- agent_id = #{agentId,jdbcType=INTEGER},
- </if>
- <if test="agentDepotId != null" >
- agent_depot_id = #{agentDepotId,jdbcType=INTEGER},
- </if>
- <if test="storehouseId != null" >
- storehouse_id = #{storehouseId,jdbcType=INTEGER},
- </if>
- <if test="weather != null" >
- weather = #{weather,jdbcType=VARCHAR},
- </if>
- <if test="actualAmount != null" >
- actual_amount = #{actualAmount,jdbcType=VARCHAR},
- </if>
- <if test="lspz != null" >
- lspz = #{lspz,jdbcType=INTEGER},
- </if>
- <if test="nature != null" >
- nature = #{nature,jdbcType=VARCHAR},
- </if>
- <if test="level != null" >
- level = #{level,jdbcType=INTEGER},
- </if>
- <if test="harvestYear != null" >
- harvest_year = #{harvestYear,jdbcType=INTEGER},
- </if>
- <if test="enterTime != null" >
- enter_time = #{enterTime,jdbcType=TIMESTAMP},
- </if>
- <if test="keeper != null" >
- keeper = #{keeper,jdbcType=VARCHAR},
- </if>
- <if test="houseTemperature != null" >
- house_temperature = #{houseTemperature,jdbcType=DECIMAL},
- </if>
- <if test="houseHumidity != null" >
- house_humidity = #{houseHumidity,jdbcType=DECIMAL},
- </if>
- <if test="gasTemperature != null" >
- gas_temperature = #{gasTemperature,jdbcType=DECIMAL},
- </if>
- <if test="gasHumidity != null" >
- gas_humidity = #{gasHumidity,jdbcType=DECIMAL},
- </if>
- <if test="detectionTime != null" >
- detection_time = #{detectionTime,jdbcType=TIMESTAMP},
- </if>
- <if test="max != null" >
- max = #{max,jdbcType=DECIMAL},
- </if>
- <if test="min != null" >
- min = #{min,jdbcType=DECIMAL},
- </if>
- <if test="avg != null" >
- avg = #{avg,jdbcType=DECIMAL},
- </if>
- <if test="orgId != null" >
- org_id = #{orgId,jdbcType=INTEGER},
- </if>
- <if test="createTime != null" >
- create_time = #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="updatetime != null" >
- updatetime = #{updatetime,jdbcType=TIMESTAMP},
- </if>
- <if test="tPoints != null" >
- t_points = #{tPoints,jdbcType=LONGVARCHAR},
- </if>
- </set>
- where id = #{id,jdbcType=INTEGER}
- </update>
- <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.chinaitop.depot.agent.temperature.model.BusinessAgentTemperature" >
- update business_agent_temperature
- set agent_id = #{agentId,jdbcType=INTEGER},
- agent_depot_id = #{agentDepotId,jdbcType=INTEGER},
- storehouse_id = #{storehouseId,jdbcType=INTEGER},
- weather = #{weather,jdbcType=VARCHAR},
- actual_amount = #{actualAmount,jdbcType=VARCHAR},
- lspz = #{lspz,jdbcType=INTEGER},
- nature = #{nature,jdbcType=VARCHAR},
- level = #{level,jdbcType=INTEGER},
- harvest_year = #{harvestYear,jdbcType=INTEGER},
- enter_time = #{enterTime,jdbcType=TIMESTAMP},
- keeper = #{keeper,jdbcType=VARCHAR},
- house_temperature = #{houseTemperature,jdbcType=DECIMAL},
- house_humidity = #{houseHumidity,jdbcType=DECIMAL},
- gas_temperature = #{gasTemperature,jdbcType=DECIMAL},
- gas_humidity = #{gasHumidity,jdbcType=DECIMAL},
- detection_time = #{detectionTime,jdbcType=TIMESTAMP},
- max = #{max,jdbcType=DECIMAL},
- min = #{min,jdbcType=DECIMAL},
- avg = #{avg,jdbcType=DECIMAL},
- org_id = #{orgId,jdbcType=INTEGER},
- create_time = #{createTime,jdbcType=TIMESTAMP},
- updatetime = #{updatetime,jdbcType=TIMESTAMP},
- t_points = #{tPoints,jdbcType=LONGVARCHAR}
- where id = #{id,jdbcType=INTEGER}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.chinaitop.depot.agent.temperature.model.BusinessAgentTemperature" >
- update business_agent_temperature
- set agent_id = #{agentId,jdbcType=INTEGER},
- agent_depot_id = #{agentDepotId,jdbcType=INTEGER},
- storehouse_id = #{storehouseId,jdbcType=INTEGER},
- weather = #{weather,jdbcType=VARCHAR},
- actual_amount = #{actualAmount,jdbcType=VARCHAR},
- lspz = #{lspz,jdbcType=INTEGER},
- nature = #{nature,jdbcType=VARCHAR},
- level = #{level,jdbcType=INTEGER},
- harvest_year = #{harvestYear,jdbcType=INTEGER},
- enter_time = #{enterTime,jdbcType=TIMESTAMP},
- keeper = #{keeper,jdbcType=VARCHAR},
- house_temperature = #{houseTemperature,jdbcType=DECIMAL},
- house_humidity = #{houseHumidity,jdbcType=DECIMAL},
- gas_temperature = #{gasTemperature,jdbcType=DECIMAL},
- gas_humidity = #{gasHumidity,jdbcType=DECIMAL},
- detection_time = #{detectionTime,jdbcType=TIMESTAMP},
- max = #{max,jdbcType=DECIMAL},
- min = #{min,jdbcType=DECIMAL},
- avg = #{avg,jdbcType=DECIMAL},
- org_id = #{orgId,jdbcType=INTEGER},
- create_time = #{createTime,jdbcType=TIMESTAMP},
- updatetime = #{updatetime,jdbcType=TIMESTAMP},
- t_points = #{tPoints,jdbcType=LONGVARCHAR}
- where id = #{id,jdbcType=INTEGER}
- </update>
- <select id="getDataByExample" parameterType="java.util.Map" resultType="java.util.HashMap">
- SELECT
- temperAll.*
- FROM
- (
- SELECT DISTINCT
- temper.id id,
- temper.org_id orgId,
- depot.depot_id agentOrgId,
- depot.depot_id agentStoreOrgId,
- '1' sign,
- agent.agent_name agentName,
- depot.agent_depot_name agentDepotName,
- store.storehouse_name storehouseName,
- temper.lspz lspz,
- temper.detection_time detectionTime,
- temper.house_temperature houseTemperature,
- temper.house_humidity houseHumidity,
- temper.max max,
- temper.min min,
- temper.avg avg,
- temper.t_points tPoints,
- store.storehouse_type storehouseType,
- store.design_capacity designCapacity,
- temper.enter_time enterTime,
- temper.nature nature,
- temper.level level,
- temper.actual_amount actualAmount,
- temper.harvest_year harvestYear,
- temper.gas_temperature gasTemperature,
- temper.gas_humidity gasHumidity,
- temper.keeper keeper,
- temper.updatetime updatetime
- FROM
- business_agent_temperature temper
- LEFT JOIN business_agent agent ON agent.id = temper.agent_id
- AND agent.org_id = #{orgId,jdbcType=INTEGER}
- LEFT JOIN business_agent_depot depot ON depot.id = temper.agent_depot_id
- AND depot.org_id = #{orgId,jdbcType=INTEGER}
- LEFT JOIN basic_storehouse store ON store.storehouse_id = temper.storehouse_id
- AND store.library_type = 1
- AND store.org_id = #{orgId,jdbcType=INTEGER}
- WHERE temper.org_id = #{orgId,jdbcType=INTEGER}
- <if test="agentId != null">
- AND temper.agent_id = #{agentId,jdbcType=INTEGER}
- </if>
- <if test="agentDepotId != null">
- AND temper.agent_depot_id = #{agentDepotId,jdbcType=INTEGER}
- </if>
- <if test="storehouseId != null">
- AND temper.storehouse_id = #{storehouseId,jdbcType=INTEGER}
- </if>
- <if test="startTime != null and endTime != null">
- AND temper.detection_time BETWEEN #{startTime} AND #{endTime}
- </if>
- <if test="temperId != null">
- AND temper.id = #{temperId,jdbcType=INTEGER}
- </if>
- UNION ALL
- SELECT DISTINCT
- tt.id id,
- tt.org_id orgId,
- depot.depot_id agentOrgId,
- depot.depot_id agentStoreOrgId,
- '0' sign,
- depot.agent_depot_name agentName,
- store.depot_name agentDepotName,
- store.storehouse_name storehouseName,
- tt.storehouse lspz,
- tt.time detectionTime,
- tt.inTemp houseTemperature,
- tt.inH houseHumidity,
- tt.max max,
- tt.min min,
- tt.avg avg,
- tt.t_points tPoints,
- store.storehouse_type storehouseType,
- store.design_capacity designCapacity,
- tt.storehouse enterTime,
- tt.storehouse nature,
- tt.storehouse level,
- tt.storehouse actualAmount,
- tt.storehouse harvestYear,
- tt.outTemp gasTemperature,
- tt.outH gasHumidity,
- tt.storehouse keeper,
- tt.updatetime updatetime
- FROM
- business_agent_depot depot
- LEFT JOIN business_agent_storehouse agentStore ON depot.id = agentStore.agent_depot_id
- AND agentStore.org_id = #{orgId,jdbcType=INTEGER}
- LEFT JOIN basic_storehouse store ON store.storehouse_id = agentStore.storehouse_id
- AND store.org_id = #{orgId,jdbcType=INTEGER}
- LEFT JOIN t_testdata tt ON depot.depot_id = tt.org_id
- AND tt.updatetime >= depot.updatetime
- WHERE
- tt.iLq_yq = '0'
- AND depot.org_id = #{orgId,jdbcType=INTEGER}
- AND depot.del_flag = 1
- <if test="agentId != null">
- AND agent.id = #{agentId,jdbcType=INTEGER}
- </if>
- <if test="agentDepotId != null">
- AND depot.id = #{agentDepotId,jdbcType=INTEGER}
- </if>
- <if test="storehouseId != null">
- AND store.storehouse_id = #{storehouseId,jdbcType=INTEGER}
- </if>
- <if test="startTime != null and endTime != null">
- AND tt.time BETWEEN #{startTime} AND #{endTime}
- </if>
- ) temperAll
- WHERE temperAll.orgId IS NOT NULL AND temperAll.id IS NOT NULL
- ORDER BY
- temperAll.updatetime DESC
- </select>
- <select id="getById" resultMap="ResultMapWithBLOBs" parameterType="java.lang.String">
- SELECT * FROM business_agent_temperature WHERE id = #{id}
- </select>
- <select id="getTestDataById" resultType="java.lang.String" parameterType="java.lang.String">
- SELECT t_points FROM t_testdata WHERE id = #{id}
- </select>
- <select id="getAgentStoreInfoMap" resultType="java.util.Map" parameterType="java.lang.Integer">
- SELECT
- t2.storehouse_type,
- t2.storehouse_code,
- t2.storehouse_name,
- t2.design_capacity,
- t2.house_doot_position,
- t2.storehouse_state,
- t2.dutyStoreman,
- t1.lkmc,
- t1.pz,
- t1.hwxz,
- t1.dj,
- t1.kcsl,
- DATE_FORMAT(t1.rq, '%Y') AS rq,
- DATE_FORMAT(t1.rq, '%Y-%m-%d') AS rcrq,
- DATE_FORMAT(t1.cjsj, '%Y-%m-%d') AS cjsj,
- t1.UnitID
- FROM
- `lsreport_ts`.`data_kcgl_kcsw_default` t1
- LEFT JOIN `depot_yunnan`.`basic_storehouse` t2 ON t1.UnitID = t2.org_id
- AND t1.ch = t2.storehouse_id
- AND t2.del_flag = 1
- AND t2.library_type = '0'
- WHERE
- t2.org_id IN (
- SELECT DISTINCT
- depot_id
- FROM
- `depot_yunnan`.`business_agent_depot`
- WHERE
- org_id = #{orgId,jdbcType=INTEGER}
- )
- GROUP BY
- t2.storehouse_code
- </select>
- </mapper>
|