<?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.fzzy.igds.grain.mapper.GrainServiceMapper">
|
|
<!-- 基础查询字段 -->
|
<sql id="DATA_REPORT_COLUMN">
|
g
|
.
|
BATCH_ID_
|
AS batchId,
|
g.COMPANY_ID_ AS companyId,
|
g.DEPOT_ID_ AS depotId,
|
g.TEMP_MIN_ AS tempMin,
|
g.TEMP_MAX_ AS tempMax,
|
g.TEMP_AVE_ AS tempAve,
|
g.HUMIDITY_IN_ AS humidityIn,
|
g.TEMP_IN_ AS tempIn,
|
g.HUMIDITY_OUT_ AS humidityOut,
|
g.TEMP_OUT_ AS tempOut,
|
g.CABLE_ AS cable,
|
g.CABLE_CIR_ AS cableCir,
|
g.OIL_HEIGHT_ AS oilHeight,
|
g.WEATHER_ AS weather,
|
g.RECEIVE_DATE_ AS receiveDate,
|
g.CHECK_USER_ AS checkUser,
|
g.REMARK_ AS remark,
|
g.POINTS_ AS points,
|
g.PUSH_TAG_ AS pushTag,
|
|
d.STORE_KEEPER_NAME_ AS storeKeeperName,
|
d.PER_WET_ AS perWet,
|
d.PER_IMPURITY_ AS perImpurity,
|
d.DEPOT_TYPE_ AS depotType,
|
d.STORAGE_REAL_ AS storageReal,
|
d.FOOD_VARIETY_ AS foodVariety
|
</sql>
|
|
<sql id="DATA_COLUMN">
|
BATCH_ID_
|
AS batchId,
|
COMPANY_ID_ AS companyId,
|
DEPOT_ID_ AS depotId,
|
TEMP_MIN_ AS tempMin,
|
TEMP_MAX_ AS tempMax,
|
TEMP_AVE_ AS tempAve,
|
HUMIDITY_IN_ AS humidityIn,
|
TEMP_IN_ AS tempIn,
|
HUMIDITY_OUT_ AS humidityOut,
|
TEMP_OUT_ AS tempOut,
|
CABLE_ AS cable,
|
CABLE_CIR_ AS cableCir,
|
OIL_HEIGHT_ AS oilHeight,
|
WEATHER_ AS weather,
|
RECEIVE_DATE_ AS receiveDate,
|
CHECK_USER_ AS checkUser,
|
REMARK_ AS remark,
|
POINTS_ AS points,
|
PUSH_TAG_ AS pushTag
|
</sql>
|
|
|
<!-- 根据条件获取粮情信息 -->
|
<select id="listGrainData" resultType="com.fzzy.igds.grain.dto.GrainData"
|
parameterType="com.fzzy.igds.grain.dto.GrainParam">
|
select
|
<include refid="DATA_COLUMN"/>
|
from
|
D_GRAIN
|
<where>
|
<if test="param.companyId != null">AND COMPANY_ID_ =
|
#{param.companyId}
|
</if>
|
<if test="param.start != null">AND
|
RECEIVE_DATE_ <![CDATA[ >= ]]>
|
#{param.start,jdbcType=DATE}
|
</if>
|
<if test="param.end != null">AND
|
RECEIVE_DATE_ <![CDATA[ <= ]]>
|
#{param.end,jdbcType=DATE}
|
</if>
|
<if test="param.depotId != null">AND DEPOT_ID_ = #{param.depotId}</if>
|
</where>
|
ORDER BY BATCH_ID_ DESC
|
</select>
|
|
<!-- 根据条件获取粮情信息 -->
|
<select id="getGrainData" resultType="com.fzzy.igds.grain.dto.GrainData"
|
parameterType="com.fzzy.igds.grain.dto.GrainParam">
|
select
|
<include refid="DATA_COLUMN"/>
|
from
|
D_GRAIN
|
<where>
|
<if test="param.companyId != null">AND COMPANY_ID_ =
|
#{param.companyId}
|
</if>
|
<if test="param.depotId != null">AND DEPOT_ID_ = #{param.depotId}</if>
|
</where>
|
ORDER BY BATCH_ID_ DESC LIMIT 1
|
</select>
|
</mapper>
|