|
@@ -4,18 +4,18 @@
|
|
|
|
|
|
<select id="getFeed" resultType="vip.xiaonuo.modular.feed.feedingfat.vo.FeedingFatVo">
|
|
|
select
|
|
|
- CONVERT(IFNULL(SUM(CASE WHEN DATE(create_date) =CURRENT_DATE THEN feed_value ELSE 0 END), '0'), DECIMAL(10, 2)) AS todayFeed,
|
|
|
- CONVERT(IFNULL(SUM(CASE WHEN DATE(create_date) =CURRENT_DATE THEN water_value ELSE 0 END), '0'), DECIMAL(10, 2)) AS todayWater,
|
|
|
- CONVERT(IFNULL(SUM(CASE WHEN DATE(create_date) =CURRENT_DATE THEN weigth_value ELSE 0 END), '0'), DECIMAL(10, 2)) AS dayWeight,
|
|
|
+ CONVERT(IFNULL(SUM(CASE WHEN DATE(create_time) =CURRENT_DATE THEN feed_value ELSE 0 END), '0'), DECIMAL(10, 2)) AS todayFeed,
|
|
|
+ CONVERT(IFNULL(SUM(CASE WHEN DATE(create_time) =CURRENT_DATE THEN water_value ELSE 0 END), '0'), DECIMAL(10, 2)) AS todayWater,
|
|
|
+ CONVERT(IFNULL(SUM(CASE WHEN DATE(create_time) =CURRENT_DATE THEN weigth_value ELSE 0 END), '0'), DECIMAL(10, 2)) AS dayWeight,
|
|
|
-- 昨日用量
|
|
|
CONVERT(IFNULL(SUM(CASE WHEN create_time=DATE_SUB(CURDATE(),INTERVAL 1 DAY) THEN water_value ELSE 0 END), '0'), DECIMAL(10, 2)) AS yesterdayWater,
|
|
|
CONVERT(IFNULL(SUM(CASE WHEN create_time=DATE_SUB(CURDATE(),INTERVAL 1 DAY) THEN feed_value ELSE 0 END), '0'), DECIMAL(10, 2)) AS yesterdayFeed
|
|
|
- FROM `feeding_fat` WHERE unit_id in ${unitId} AND org_id =${orgId}
|
|
|
+ FROM `feeding_fat` WHERE unit_id=${unitId} AND org_id =${orgId}
|
|
|
</select>
|
|
|
|
|
|
- <select id="listPage" resultType="vip.xiaonuo.modular.feed.feedingfat.vo.FeedingFatVo">
|
|
|
+ <select id="listFeedPage" resultType="vip.xiaonuo.modular.feed.feedingfat.vo.FeedingFatVo">
|
|
|
select
|
|
|
- create_time createDate,eartag_num eartagNum,device_code deviceCode,day_num dayNum,unit_name unitName
|
|
|
+ create_time createDate,eartag_num eartagNum,device_code deviceCode,
|
|
|
CONVERT(IFNULL(SUM(CASE WHEN DATE(create_time) =CURRENT_DATE THEN feed_value ELSE 0 END), '0'), DECIMAL(10, 2)) AS todayFeed,
|
|
|
CONVERT(IFNULL(SUM(CASE WHEN DATE(create_time) =CURRENT_DATE THEN water_value ELSE 0 END), '0'), DECIMAL(10, 2)) AS todayWater,
|
|
|
CONVERT(IFNULL(SUM(CASE WHEN DATE(create_time) =CURRENT_DATE THEN weigth_value ELSE 0 END), '0'), DECIMAL(10, 2)) AS dayWeight,
|
|
@@ -28,7 +28,7 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="listFeedDetail" resultType="vip.xiaonuo.modular.feed.feedingfat.vo.FeedingFatVo2">
|
|
|
- select create_time 'createTime',
|
|
|
+ select create_time 'createDate',
|
|
|
CONVERT(IFNULL(SUM(feed_value), '0'), DECIMAL(10, 2)) 'value'
|
|
|
FROM feeding_fat
|
|
|
${ew.customSqlSegment}
|
|
@@ -36,7 +36,7 @@
|
|
|
ORDER BY create_time ASC
|
|
|
</select>
|
|
|
<select id="listTempDetail" resultType="vip.xiaonuo.modular.feed.feedingfat.vo.FeedingFatVo2">
|
|
|
- select create_time 'createTime',
|
|
|
+ select create_time 'createDate',
|
|
|
CONVERT(IFNULL(SUM(temp), '0'), DECIMAL(10, 2)) 'value'
|
|
|
FROM feeding_fat
|
|
|
${ew.customSqlSegment}
|
|
@@ -44,7 +44,7 @@
|
|
|
ORDER BY create_time ASC
|
|
|
</select>
|
|
|
<select id="listActDetail" resultType="vip.xiaonuo.modular.feed.feedingfat.vo.FeedingFatVo2">
|
|
|
- select create_time 'createTime',
|
|
|
+ select create_time 'createDate',
|
|
|
CONVERT(IFNULL(SUM(feed_act), '0'), DECIMAL(10, 2)) 'value'
|
|
|
FROM feeding_fat
|
|
|
${ew.customSqlSegment}
|
|
@@ -52,7 +52,7 @@
|
|
|
ORDER BY create_time ASC
|
|
|
</select>
|
|
|
<select id="listWeightDetail" resultType="vip.xiaonuo.modular.feed.feedingfat.vo.FeedingFatVo2">
|
|
|
- select create_time 'createTime',
|
|
|
+ select create_time 'createDate',
|
|
|
CONVERT(IFNULL(SUM(weigth_value), '0'), DECIMAL(10, 2)) 'value'
|
|
|
FROM feeding_fat
|
|
|
${ew.customSqlSegment}
|