|
@@ -154,7 +154,7 @@
|
|
and a.modify_time in (
|
|
and a.modify_time in (
|
|
SELECT modify_time from (SELECT MAX(modify_time) modify_time FROM care_event_order GROUP BY older_id) a
|
|
SELECT modify_time from (SELECT MAX(modify_time) modify_time FROM care_event_order GROUP BY older_id) a
|
|
)
|
|
)
|
|
- order by a.modify_time desc
|
|
|
|
|
|
+ order by a.status,a.modify_time desc
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<resultMap id="BigScreenOlderDetailVOMap" type="com.care.bigscreen.vo.BigScreenOlderDetailVO">
|
|
<resultMap id="BigScreenOlderDetailVOMap" type="com.care.bigscreen.vo.BigScreenOlderDetailVO">
|
|
@@ -172,6 +172,7 @@
|
|
<result column="phone" property="phone"/>
|
|
<result column="phone" property="phone"/>
|
|
<result column="has_our_door_device" property="hasOurDoorDevice"/>
|
|
<result column="has_our_door_device" property="hasOurDoorDevice"/>
|
|
<result column="older_status" property="olderStatus"/>
|
|
<result column="older_status" property="olderStatus"/>
|
|
|
|
+ <result column="older_event_status" property="olderEventStatus"/>
|
|
|
|
|
|
<collection property="olderContactList" ofType="com.care.bigscreen.vo.BigSreenOlderContactVO">
|
|
<collection property="olderContactList" ofType="com.care.bigscreen.vo.BigSreenOlderContactVO">
|
|
<id column="contact_id" property="contactId"/>
|
|
<id column="contact_id" property="contactId"/>
|
|
@@ -197,15 +198,23 @@
|
|
a.phone,
|
|
a.phone,
|
|
(case when (select count(1) from care_device b where b.dev_type='2' and b.id in (select c.dev_id from care_older_device_rel c where c.older_id = a.id)) > 0 then 'Y' else 'N' end) has_our_door_device,
|
|
(case when (select count(1) from care_device b where b.dev_type='2' and b.id in (select c.dev_id from care_older_device_rel c where c.older_id = a.id)) > 0 then 'Y' else 'N' end) has_our_door_device,
|
|
(select sdc.name from sys_dim_code sdc where sdc.dim_code = a.status and sdc.type_code='older_status') older_status,
|
|
(select sdc.name from sys_dim_code sdc where sdc.dim_code = a.status and sdc.type_code='older_status') older_status,
|
|
|
|
+ (select c.status from care_event_order c where c.older_id = a.id order by c.create_time desc limit 1) older_event_status,
|
|
d.id contact_id,
|
|
d.id contact_id,
|
|
d.name contact_name,
|
|
d.name contact_name,
|
|
d.phone contact_phone,
|
|
d.phone contact_phone,
|
|
(select sdc.name from sys_dim_code sdc where sdc.dim_code = d.relation_type and sdc.type_code='older_contact_relation_type') relation_type
|
|
(select sdc.name from sys_dim_code sdc where sdc.dim_code = d.relation_type and sdc.type_code='older_contact_relation_type') relation_type
|
|
- FROM care_older a left join care_older_contact d on a.id = d.older_id
|
|
|
|
- where a.id = #{olderId} and d.status='1'
|
|
|
|
|
|
+ FROM care_older a left join care_older_contact d on a.id = d.older_id and d.status='1'
|
|
|
|
+ where a.id = #{olderId}
|
|
order by a.id,d.contact_level
|
|
order by a.id,d.contact_level
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
+ <select id="selectStationBigScreenEventTotal" resultType="com.care.bigscreen.vo.BigScreenEventTotalVO">
|
|
|
|
+ SELECT
|
|
|
|
+ (select count(1) from care_event_order where station_id = #{stationId} and status in ('0','1') ) rtEventAmount,
|
|
|
|
+ (select count(1) from care_event_order where station_id = #{stationId} and status not in ('0','1') ) hisEventAmount
|
|
|
|
+ from dual
|
|
|
|
+ </select>
|
|
|
|
+
|
|
<select id="selectBigScreenRtEventList" resultType="com.care.bigscreen.vo.BigScreenEventVO">
|
|
<select id="selectBigScreenRtEventList" resultType="com.care.bigscreen.vo.BigScreenEventVO">
|
|
SELECT
|
|
SELECT
|
|
a.title,
|
|
a.title,
|
|
@@ -236,6 +245,13 @@
|
|
LIMIT #{pageUtil.start}, #{pageUtil.pageSize}
|
|
LIMIT #{pageUtil.start}, #{pageUtil.pageSize}
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
+ <select id="selectStationBigScreenOlderCardTotal" resultType="com.care.bigscreen.vo.BigScreenOlderCardTotalVO">
|
|
|
|
+ SELECT
|
|
|
|
+ (select count(1) from care_older where station_id = #{stationId} ) allOlderAmount,
|
|
|
|
+ (select count(1) from care_older where station_id = #{stationId} and status not in ('0','1') ) alarmOlderAmount
|
|
|
|
+ from dual
|
|
|
|
+ </select>
|
|
|
|
+
|
|
<select id="selectBigScreenOlderCardListByCount" resultType="int" >
|
|
<select id="selectBigScreenOlderCardListByCount" resultType="int" >
|
|
SELECT
|
|
SELECT
|
|
count(1)
|
|
count(1)
|
|
@@ -244,6 +260,9 @@
|
|
<if test="olderName != null and olderName != ''">
|
|
<if test="olderName != null and olderName != ''">
|
|
AND a.name like CONCAT('%',#{olderName},'%')
|
|
AND a.name like CONCAT('%',#{olderName},'%')
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="isAlarm == '1'.toString()">
|
|
|
|
+ AND a.status not in ('1','2')
|
|
|
|
+ </if>
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="selectBigScreenOlderCardListByPage" resultType="com.care.bigscreen.vo.BigScreenOlderDetailVO">
|
|
<select id="selectBigScreenOlderCardListByPage" resultType="com.care.bigscreen.vo.BigScreenOlderDetailVO">
|
|
@@ -261,12 +280,16 @@
|
|
a.addr,
|
|
a.addr,
|
|
a.phone,
|
|
a.phone,
|
|
(case when (select count(1) from care_device b where b.dev_type='2' and b.id in (select c.dev_id from care_older_device_rel c where c.older_id = a.id)) > 0 then 'Y' else 'N' end) has_our_door_device,
|
|
(case when (select count(1) from care_device b where b.dev_type='2' and b.id in (select c.dev_id from care_older_device_rel c where c.older_id = a.id)) > 0 then 'Y' else 'N' end) has_our_door_device,
|
|
- (select sdc.name from sys_dim_code sdc where sdc.dim_code = a.status and sdc.type_code='older_status') olderStatus
|
|
|
|
|
|
+ (select sdc.name from sys_dim_code sdc where sdc.dim_code = a.status and sdc.type_code='older_status') olderStatus,
|
|
|
|
+ (select c.status from care_event_order c where c.older_id = a.id order by c.create_time desc limit 1) olderEventStatus
|
|
FROM care_older a
|
|
FROM care_older a
|
|
where a.station_id = #{stationId}
|
|
where a.station_id = #{stationId}
|
|
<if test="olderName != null and olderName != ''">
|
|
<if test="olderName != null and olderName != ''">
|
|
AND a.name like CONCAT('%',#{olderName},'%')
|
|
AND a.name like CONCAT('%',#{olderName},'%')
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="isAlarm == '1'.toString()">
|
|
|
|
+ AND a.status not in ('1','2')
|
|
|
|
+ </if>
|
|
order by (case when a.status in ('1','2') then 2 else 1 end), a.modify_time desc
|
|
order by (case when a.status in ('1','2') then 2 else 1 end), a.modify_time desc
|
|
LIMIT #{pageUtil.start}, #{pageUtil.pageSize}
|
|
LIMIT #{pageUtil.start}, #{pageUtil.pageSize}
|
|
</select>
|
|
</select>
|