73 lines
3.1 KiB
XML
73 lines
3.1 KiB
XML
<?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.securityControl.system.mapper.ScheduleBallDao">
|
|
<!--当日施工球机-->
|
|
<select id="getSgDevice" resultType="com.securityControl.system.domain.vo.SystemDeviceVo">
|
|
select distinct td.device_name devName,td.mac_id macId,
|
|
td.puid puId,td.gb_code gbCode,t_code tCode,
|
|
t_name tName,tw_code twCode,td_code tdCode
|
|
from jj_class_meetting cm
|
|
left join jj_ball jbl ON jbl.id=cm.camera_id3
|
|
left join t_device td on jbl.camera_no=td.t_code AND td.is_flag=0
|
|
where cm.camera_id2 is not null and cm.current_constr_date=current_date()
|
|
and td.pass_way in(
|
|
<foreach collection="list" item="item" separator=",">
|
|
#{item}
|
|
</foreach>
|
|
)
|
|
</select>
|
|
<!--施工TY球机-->
|
|
<select id="getTYClassMettintState" resultType="com.securityControl.system.domain.vo.SystemDeviceVo">
|
|
select distinct td.device_name devName,td.mac_id macId,
|
|
td.puid puId,td.gb_code gbCode,t_code tCode,
|
|
t_name tName,tw_code twCode,td_code tdCode
|
|
from jj_class_meetting cm
|
|
left join jj_ball jbl ON jbl.id=cm.camera_id2
|
|
left join t_device td on jbl.camera_no=td.t_code AND td.is_flag=0
|
|
where cm.camera_id2 is not null and cm.current_constr_date=current_date()
|
|
and td.is_t='1' AND t_code is not null
|
|
</select>
|
|
<!--全部球机-->
|
|
<select id="getAllDeviceList" resultType="com.securityControl.system.domain.vo.SystemDeviceVo">
|
|
select td.device_name devName,td.mac_id macId,td.puid puId,td.gb_code gbCode,t_code tCode,t_name tName,tw_code twCode,td_code tdCode
|
|
from t_device td
|
|
where td.is_flag=0
|
|
</select>
|
|
<!--TY全部球机-->
|
|
<select id="getTyDeviceList" resultType="com.securityControl.system.domain.vo.SystemDeviceVo">
|
|
select td.device_name devName,td.mac_id macId,td.puid puId,td.gb_code gbCode,t_code tCode,t_name tName,tw_code twCode,td_code tdCode
|
|
from t_device td
|
|
where td.is_flag=0 and td.is_t='1'
|
|
AND t_code is not null
|
|
</select>
|
|
|
|
<!--更新球机状态 -->
|
|
<update id="updateDeviceState" >
|
|
UPDATE t_device SET state = #{param.OnlineFlag} , update_time=#{time}
|
|
WHERE puid = #{param.PUID}
|
|
</update>
|
|
|
|
<!--更新统一设备-->
|
|
<update id="refreshTyDevice" parameterType="com.securityControl.system.domain.vo.TYDeviceResultValue">
|
|
UPDATE t_device SET state = #{status}
|
|
WHERE t_code = #{devCode}
|
|
</update>
|
|
|
|
|
|
<update id="replaceUpdown" parameterType="String">
|
|
replace INTO t_device_updown
|
|
(puid, up_time,
|
|
<if test=" offlineTime!=null and offlineTime!=''">
|
|
down_time,
|
|
</if>
|
|
create_day
|
|
) values
|
|
(#{puid},#{onlineTime},
|
|
<if test=" offlineTime!=null and offlineTime!=''">
|
|
#{offlineTime},
|
|
</if>
|
|
#{day}
|
|
)
|
|
</update>
|
|
|
|
</mapper> |