|
@@ -143,9 +143,9 @@
|
|
|
|
|
|
<select id="selectBigScreenAlarmOlderList" resultType="com.care.bigscreen.vo.BigScreenAlarmOlderVO">
|
|
<select id="selectBigScreenAlarmOlderList" resultType="com.care.bigscreen.vo.BigScreenAlarmOlderVO">
|
|
SELECT a.older_id olderId,
|
|
SELECT a.older_id olderId,
|
|
- CONCAT((select b.name from care_older b where b.id = a.older_id),'--', (select sdc.name from sys_dim_code sdc where sdc.dim_code = a.order_type and sdc.type_code='event_order_order_type')) nameType,
|
|
|
|
- a.status,
|
|
|
|
- (select sdc.name from sys_dim_code sdc where sdc.dim_code = a.status and sdc.type_code='event_order_status') statusName
|
|
|
|
|
|
+ CONCAT((select b.name from care_older b where b.id = a.older_id),'--', (select sdc.name from sys_dim_code sdc where sdc.dim_code = (select b.status from care_older b where b.id = a.older_id) and sdc.type_code='older_status')) nameOlderStatus,
|
|
|
|
+ a.status eventStatus,
|
|
|
|
+ (select sdc.name from sys_dim_code sdc where sdc.dim_code = a.status and sdc.type_code='event_order_status') eventStatusName
|
|
FROM care_event_order a
|
|
FROM care_event_order a
|
|
where a.station_id = #{stationId} and a.status in ('0','1')
|
|
where a.station_id = #{stationId} and a.status in ('0','1')
|
|
<if test="olderName != null and olderName != ''">
|
|
<if test="olderName != null and olderName != ''">
|
|
@@ -195,6 +195,7 @@
|
|
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,
|
|
d.id contact_id,
|
|
d.id contact_id,
|
|
d.name contact_name,
|
|
d.name contact_name,
|
|
d.phone contact_phone,
|
|
d.phone contact_phone,
|
|
@@ -233,4 +234,41 @@
|
|
order by a.create_time desc
|
|
order by a.create_time desc
|
|
LIMIT #{pageUtil.start}, #{pageUtil.pageSize}
|
|
LIMIT #{pageUtil.start}, #{pageUtil.pageSize}
|
|
</select>
|
|
</select>
|
|
|
|
+
|
|
|
|
+ <select id="selectBigScreenOlderCardListByCount" resultType="int" >
|
|
|
|
+ SELECT
|
|
|
|
+ count(1)
|
|
|
|
+ FROM care_older a
|
|
|
|
+ where a.station_id = #{stationId}
|
|
|
|
+ <if test="olderName != null and olderName != ''">
|
|
|
|
+ AND a.name like CONCAT('%',#{olderName},'%')
|
|
|
|
+ </if>
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="selectBigScreenOlderCardListByPage" resultType="com.care.bigscreen.vo.BigScreenOlderDetailVO">
|
|
|
|
+ SELECT
|
|
|
|
+ a.id older_id,
|
|
|
|
+ a.name,
|
|
|
|
+ (select sdc.name from sys_dim_code sdc where sdc.dim_code = a.gender and sdc.type_code='gender') gender,
|
|
|
|
+ ROUND(DATEDIFF(CURDATE(), a.birthday)/365.2422) age,
|
|
|
|
+ (select sdc.name from sys_dim_code sdc where sdc.dim_code = a.live_type and sdc.type_code='older_live_type') live_type,
|
|
|
|
+ a.bed_number,
|
|
|
|
+ a.safe_level,
|
|
|
|
+ a.Key_escrow_type,
|
|
|
|
+ a.breath_rate,
|
|
|
|
+ a.heart_rate,
|
|
|
|
+ a.addr,
|
|
|
|
+ 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,
|
|
|
|
+ (select sdc.name from sys_dim_code sdc where sdc.dim_code = a.status and sdc.type_code='older_status') olderStatus
|
|
|
|
+ FROM care_older a
|
|
|
|
+ where a.station_id = #{stationId}
|
|
|
|
+ <if test="olderName != null and olderName != ''">
|
|
|
|
+ AND a.name like CONCAT('%',#{olderName},'%')
|
|
|
|
+ </if>
|
|
|
|
+ order by (case when a.status in ('1','2') then 2 else 1 end), a.modify_time desc
|
|
|
|
+ LIMIT #{pageUtil.start}, #{pageUtil.pageSize}
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+
|
|
</mapper>
|
|
</mapper>
|