|
@@ -7,32 +7,32 @@
|
|
resultType="cn.iocoder.yudao.module.pms.dal.dataobject.iotopeationfill.IotOpeationFillDO">
|
|
resultType="cn.iocoder.yudao.module.pms.dal.dataobject.iotopeationfill.IotOpeationFillDO">
|
|
|
|
|
|
select
|
|
select
|
|
- distinct
|
|
|
|
- c.id,
|
|
|
|
- c.dept_id,
|
|
|
|
- c.device_code,
|
|
|
|
- c.device_name,
|
|
|
|
- b.device_category_id,
|
|
|
|
- d.person_id user_id
|
|
|
|
|
|
+ distinct
|
|
|
|
+ c.id,
|
|
|
|
+ c.dept_id,
|
|
|
|
+ c.device_code,
|
|
|
|
+ c.device_name,
|
|
|
|
+ b.device_category_id,
|
|
|
|
+ d.person_id user_id
|
|
from
|
|
from
|
|
- rq_iot_model_template a,
|
|
|
|
- rq_iot_model_template_attrs b,
|
|
|
|
- rq_iot_device c,
|
|
|
|
- rq_iot_device_person d
|
|
|
|
|
|
+ rq_iot_model_template a,
|
|
|
|
+ rq_iot_model_template_attrs b,
|
|
|
|
+ rq_iot_device c,
|
|
|
|
+ rq_iot_device_person d
|
|
where
|
|
where
|
|
- a.device_category_id = b.device_category_id
|
|
|
|
- and
|
|
|
|
- a.device_category_id = c.asset_class
|
|
|
|
- and
|
|
|
|
- c.id = d.device_id
|
|
|
|
- and
|
|
|
|
- c.device_status in ('sg','dm')
|
|
|
|
- and
|
|
|
|
- a.deleted = 0
|
|
|
|
- and
|
|
|
|
- c.deleted = 0
|
|
|
|
- and
|
|
|
|
- d.deleted = 0
|
|
|
|
|
|
+ a.device_category_id = b.device_category_id
|
|
|
|
+ and
|
|
|
|
+ a.device_category_id = c.asset_class
|
|
|
|
+ and
|
|
|
|
+ c.id = d.device_id
|
|
|
|
+ and
|
|
|
|
+ c.device_status in ('sg','dm')
|
|
|
|
+ and
|
|
|
|
+ a.deleted = 0
|
|
|
|
+ and
|
|
|
|
+ c.deleted = 0
|
|
|
|
+ and
|
|
|
|
+ d.deleted = 0
|
|
<if test="deviceIds != null and !deviceIds.isEmpty()">
|
|
<if test="deviceIds != null and !deviceIds.isEmpty()">
|
|
and c.id in
|
|
and c.id in
|
|
<foreach collection="deviceIds" item="id" open="(" separator="," close=")">
|
|
<foreach collection="deviceIds" item="id" open="(" separator="," close=")">
|
|
@@ -50,25 +50,25 @@
|
|
<select id="getFillDevices1"
|
|
<select id="getFillDevices1"
|
|
resultType="cn.iocoder.yudao.module.pms.controller.admin.vo.IotDeviceRespVO">
|
|
resultType="cn.iocoder.yudao.module.pms.controller.admin.vo.IotDeviceRespVO">
|
|
select
|
|
select
|
|
- distinct
|
|
|
|
- c.id,
|
|
|
|
- c.dept_id,
|
|
|
|
- c.device_code,
|
|
|
|
- c.device_name,
|
|
|
|
- b.device_category_id,
|
|
|
|
- d.person_id user_id,
|
|
|
|
- e.name dept_name,
|
|
|
|
- f.nickname,
|
|
|
|
- g.name,
|
|
|
|
- c.device_status
|
|
|
|
|
|
+ distinct
|
|
|
|
+ c.id,
|
|
|
|
+ c.dept_id,
|
|
|
|
+ c.device_code,
|
|
|
|
+ c.device_name,
|
|
|
|
+ b.device_category_id,
|
|
|
|
+ d.person_id user_id,
|
|
|
|
+ e.name dept_name,
|
|
|
|
+ f.nickname,
|
|
|
|
+ g.name,
|
|
|
|
+ c.device_status
|
|
from
|
|
from
|
|
- rq_iot_model_template a,
|
|
|
|
- rq_iot_model_template_attrs b,
|
|
|
|
- rq_iot_device c,
|
|
|
|
- rq_iot_device_person d,
|
|
|
|
- system_dept e,
|
|
|
|
- system_users f,
|
|
|
|
- rq_iot_product_classify g
|
|
|
|
|
|
+ rq_iot_model_template a,
|
|
|
|
+ rq_iot_model_template_attrs b,
|
|
|
|
+ rq_iot_device c,
|
|
|
|
+ rq_iot_device_person d,
|
|
|
|
+ system_dept e,
|
|
|
|
+ system_users f,
|
|
|
|
+ rq_iot_product_classify g
|
|
where
|
|
where
|
|
a.device_category_id = b.device_category_id
|
|
a.device_category_id = b.device_category_id
|
|
and
|
|
and
|
|
@@ -154,31 +154,31 @@
|
|
|
|
|
|
|
|
|
|
<insert id="insertFill"
|
|
<insert id="insertFill"
|
|
- parameterType="cn.iocoder.yudao.module.pms.dal.dataobject.iotopeationfill.IotOpeationFillDO">
|
|
|
|
- insert into rq_iot_opeation_fill(device_id,device_code,device_name,device_category_id,create_time,dept_id,order_id,is_report)
|
|
|
|
- values
|
|
|
|
|
|
+ parameterType="cn.iocoder.yudao.module.pms.dal.dataobject.iotopeationfill.IotOpeationFillDO">
|
|
|
|
+ insert into rq_iot_opeation_fill(device_id,device_code,device_name,device_category_id,create_time,dept_id,order_id,is_report)
|
|
|
|
+ values
|
|
<foreach collection="list" item="item" separator=",">
|
|
<foreach collection="list" item="item" separator=",">
|
|
(#{item.deviceId},#{item.deviceCode},#{item.deviceName},
|
|
(#{item.deviceId},#{item.deviceCode},#{item.deviceName},
|
|
#{item.deviceCategoryId},#{item.createTime},#{item.deptId},#{item.orderId},#{item.isReport})
|
|
#{item.deviceCategoryId},#{item.createTime},#{item.deptId},#{item.orderId},#{item.isReport})
|
|
</foreach>
|
|
</foreach>
|
|
</insert>
|
|
</insert>
|
|
|
|
|
|
- <!-- <insert id="insertFillOrder"
|
|
|
|
- parameterType="cn.iocoder.yudao.module.pms.dal.dataobject.iotopeationfill.IotOpeationFillDO">
|
|
|
|
- insert into rq_iot_opeation_fill_order(dept_id,order_name,
|
|
|
|
- order_status,create_time,order_type,user_name,user_id)
|
|
|
|
- values
|
|
|
|
- <foreach collection="list" item="item" separator=",">
|
|
|
|
- (#{item.deptId},#{item.orderName},#{item.orderStatus},
|
|
|
|
- #{item.createTime},#{item.orderType},#{item.userName},#{item.userId})
|
|
|
|
- </foreach>
|
|
|
|
|
|
+ <!-- <insert id="insertFillOrder"
|
|
|
|
+ parameterType="cn.iocoder.yudao.module.pms.dal.dataobject.iotopeationfill.IotOpeationFillDO">
|
|
|
|
+ insert into rq_iot_opeation_fill_order(dept_id,order_name,
|
|
|
|
+ order_status,create_time,order_type,user_name,user_id)
|
|
|
|
+ values
|
|
|
|
+ <foreach collection="list" item="item" separator=",">
|
|
|
|
+ (#{item.deptId},#{item.orderName},#{item.orderStatus},
|
|
|
|
+ #{item.createTime},#{item.orderType},#{item.userName},#{item.userId})
|
|
|
|
+ </foreach>
|
|
|
|
|
|
- </insert>-->
|
|
|
|
|
|
+ </insert>-->
|
|
|
|
|
|
<insert id="insertLog"
|
|
<insert id="insertLog"
|
|
parameterType="cn.iocoder.yudao.module.pms.dal.dataobject.iotdevicerunlog.IotDeviceRunLogDO">
|
|
parameterType="cn.iocoder.yudao.module.pms.dal.dataobject.iotdevicerunlog.IotDeviceRunLogDO">
|
|
insert into rq_iot_device_run_log
|
|
insert into rq_iot_device_run_log
|
|
- (dept_id,device_id,device_code,point_code,fill_content,create_time,point_name,total_run_time,is_sum)
|
|
|
|
|
|
+ (dept_id,device_id,device_code,point_code,fill_content,create_time,point_name,total_run_time,is_sum)
|
|
values
|
|
values
|
|
<foreach collection="list" item="item" separator=",">
|
|
<foreach collection="list" item="item" separator=",">
|
|
(#{item.deptId},#{item.deviceId},#{item.deviceCode},
|
|
(#{item.deptId},#{item.deviceId},#{item.deviceCode},
|
|
@@ -192,22 +192,22 @@
|
|
insert into rq_iot_device_run_log
|
|
insert into rq_iot_device_run_log
|
|
(dept_id, device_id, device_code, point_code, fill_content, create_time, point_name, total_run_time,is_sum)
|
|
(dept_id, device_id, device_code, point_code, fill_content, create_time, point_name, total_run_time,is_sum)
|
|
values
|
|
values
|
|
- (#{deptId}, #{deviceId}, #{deviceCode},
|
|
|
|
- #{pointCode}, #{fillContent}, #{createTime}, #{pointName}, #{totalRunTime},#{isSum})
|
|
|
|
|
|
+ (#{deptId}, #{deviceId}, #{deviceCode},
|
|
|
|
+ #{pointCode}, #{fillContent}, #{createTime}, #{pointName}, #{totalRunTime},#{isSum})
|
|
</insert>
|
|
</insert>
|
|
|
|
|
|
<update id="updateLog" parameterType="cn.iocoder.yudao.module.pms.dal.dataobject.iotdevicerunlog.IotDeviceRunLogDO">
|
|
<update id="updateLog" parameterType="cn.iocoder.yudao.module.pms.dal.dataobject.iotdevicerunlog.IotDeviceRunLogDO">
|
|
update rq_iot_device_run_log
|
|
update rq_iot_device_run_log
|
|
set
|
|
set
|
|
- fill_content = #{fillContent}
|
|
|
|
|
|
+ fill_content = #{fillContent}
|
|
where
|
|
where
|
|
- device_code = #{deviceCode}
|
|
|
|
- and
|
|
|
|
|
|
+ device_id = #{deviceId}
|
|
|
|
+ and
|
|
point_name = #{pointName}
|
|
point_name = #{pointName}
|
|
- and
|
|
|
|
|
|
+ and
|
|
DATE(create_time) = #{createTime}
|
|
DATE(create_time) = #{createTime}
|
|
- and
|
|
|
|
- is_sum = 0
|
|
|
|
|
|
+ and
|
|
|
|
+ is_sum = 0
|
|
</update>
|
|
</update>
|
|
|
|
|
|
<update id="updateSumLog" parameterType="cn.iocoder.yudao.module.pms.dal.dataobject.iotdevicerunlog.IotDeviceRunLogDO">
|
|
<update id="updateSumLog" parameterType="cn.iocoder.yudao.module.pms.dal.dataobject.iotdevicerunlog.IotDeviceRunLogDO">
|
|
@@ -215,7 +215,7 @@
|
|
set
|
|
set
|
|
total_run_time = #{totalRunTime}
|
|
total_run_time = #{totalRunTime}
|
|
where
|
|
where
|
|
- device_code = #{deviceCode}
|
|
|
|
|
|
+ device_id = #{deviceId}
|
|
and
|
|
and
|
|
point_name = #{pointName}
|
|
point_name = #{pointName}
|
|
and
|
|
and
|
|
@@ -224,20 +224,20 @@
|
|
is_sum = 1
|
|
is_sum = 1
|
|
</update>
|
|
</update>
|
|
|
|
|
|
- <!-- <select id="fillList" parameterType="cn.iocoder.yudao.module.pms.controller.admin.iotopeationfill.vo.IotOpeationFillRespVO"
|
|
|
|
- resultType="cn.iocoder.yudao.module.pms.dal.dataobject.iotopeationfill.IotOpeationFillDO">
|
|
|
|
- SELECT * FROM
|
|
|
|
- rq_iot_opeation_fill
|
|
|
|
- WHERE DATE(create_time) = CURDATE()
|
|
|
|
- <if test="deptId != null and deptId != ''">
|
|
|
|
- and dept_id in (SELECT d1.id
|
|
|
|
- FROM system_dept d1
|
|
|
|
- JOIN system_dept d2 ON d2.id = d1.parent_id
|
|
|
|
- WHERE d2.parent_id = #{deptId}
|
|
|
|
- union
|
|
|
|
- select id from system_dept where id = #{deptId})
|
|
|
|
- </if>
|
|
|
|
- </select>-->
|
|
|
|
|
|
+ <!-- <select id="fillList" parameterType="cn.iocoder.yudao.module.pms.controller.admin.iotopeationfill.vo.IotOpeationFillRespVO"
|
|
|
|
+ resultType="cn.iocoder.yudao.module.pms.dal.dataobject.iotopeationfill.IotOpeationFillDO">
|
|
|
|
+ SELECT * FROM
|
|
|
|
+ rq_iot_opeation_fill
|
|
|
|
+ WHERE DATE(create_time) = CURDATE()
|
|
|
|
+ <if test="deptId != null and deptId != ''">
|
|
|
|
+ and dept_id in (SELECT d1.id
|
|
|
|
+ FROM system_dept d1
|
|
|
|
+ JOIN system_dept d2 ON d2.id = d1.parent_id
|
|
|
|
+ WHERE d2.parent_id = #{deptId}
|
|
|
|
+ union
|
|
|
|
+ select id from system_dept where id = #{deptId})
|
|
|
|
+ </if>
|
|
|
|
+ </select>-->
|
|
<select id="fillList" parameterType="cn.iocoder.yudao.module.pms.controller.admin.iotopeationfill.vo.IotOpeationFillRespVO"
|
|
<select id="fillList" parameterType="cn.iocoder.yudao.module.pms.controller.admin.iotopeationfill.vo.IotOpeationFillRespVO"
|
|
resultType="cn.iocoder.yudao.module.pms.dal.dataobject.iotopeationfill.IotOpeationFillDO">
|
|
resultType="cn.iocoder.yudao.module.pms.dal.dataobject.iotopeationfill.IotOpeationFillDO">
|
|
SELECT * FROM
|
|
SELECT * FROM
|
|
@@ -276,9 +276,9 @@
|
|
<update id="upFill1" parameterType="cn.iocoder.yudao.module.pms.controller.admin.iotopeationfill.vo.IotOpeationFillSaveReqVO">
|
|
<update id="upFill1" parameterType="cn.iocoder.yudao.module.pms.controller.admin.iotopeationfill.vo.IotOpeationFillSaveReqVO">
|
|
update rq_iot_opeation_fill_order
|
|
update rq_iot_opeation_fill_order
|
|
set order_status = '3',
|
|
set order_status = '3',
|
|
- reason = #{reason}
|
|
|
|
|
|
+ reason = #{reason}
|
|
where
|
|
where
|
|
- id = #{id}
|
|
|
|
|
|
+ id = #{id}
|
|
</update>
|
|
</update>
|
|
|
|
|
|
|
|
|
|
@@ -321,7 +321,7 @@
|
|
AND -->(
|
|
AND -->(
|
|
1=1
|
|
1=1
|
|
<if test="orderId != null and orderId != ''">
|
|
<if test="orderId != null and orderId != ''">
|
|
- and a.order_id = #{orderId}
|
|
|
|
|
|
+ and a.order_id = #{orderId}
|
|
</if>
|
|
</if>
|
|
<!--<if test="orgName != null and orgName != ''">
|
|
<!--<if test="orgName != null and orgName != ''">
|
|
(
|
|
(
|
|
@@ -343,18 +343,18 @@
|
|
<select id="getOrderIds" parameterType="cn.iocoder.yudao.module.pms.controller.admin.iotopeationfill.vo.IotOpeationFillRespVO"
|
|
<select id="getOrderIds" parameterType="cn.iocoder.yudao.module.pms.controller.admin.iotopeationfill.vo.IotOpeationFillRespVO"
|
|
resultType="cn.iocoder.yudao.module.pms.dal.dataobject.iotopeationfill.IotOpeationFillDO">
|
|
resultType="cn.iocoder.yudao.module.pms.dal.dataobject.iotopeationfill.IotOpeationFillDO">
|
|
select
|
|
select
|
|
- distinct a.order_id
|
|
|
|
|
|
+ distinct a.order_id
|
|
from
|
|
from
|
|
rq_iot_opeation_fill a,
|
|
rq_iot_opeation_fill a,
|
|
rq_iot_opeation_fill_order b
|
|
rq_iot_opeation_fill_order b
|
|
where
|
|
where
|
|
- a.order_id = b.id
|
|
|
|
|
|
+ a.order_id = b.id
|
|
and
|
|
and
|
|
- a.deleted = 0
|
|
|
|
|
|
+ a.deleted = 0
|
|
and
|
|
and
|
|
- b.deleted = 0
|
|
|
|
|
|
+ b.deleted = 0
|
|
and
|
|
and
|
|
- a.order_id is not null
|
|
|
|
|
|
+ a.order_id is not null
|
|
and(
|
|
and(
|
|
<if test="orgName != null and orgName != ''">
|
|
<if test="orgName != null and orgName != ''">
|
|
(
|
|
(
|
|
@@ -402,7 +402,7 @@
|
|
rq_iot_opeation_fill
|
|
rq_iot_opeation_fill
|
|
WHERE
|
|
WHERE
|
|
order_id = #{orderId}
|
|
order_id = #{orderId}
|
|
- and
|
|
|
|
|
|
+ and
|
|
dept_id IN (
|
|
dept_id IN (
|
|
SELECT id FROM (
|
|
SELECT id FROM (
|
|
SELECT d1.id FROM system_dept d1 WHERE d1.id = #{deptId}
|
|
SELECT d1.id FROM system_dept d1 WHERE d1.id = #{deptId}
|
|
@@ -414,7 +414,7 @@
|
|
SELECT d4.id FROM system_dept d1 JOIN system_dept d2 ON d2.parent_id = d1.id JOIN system_dept d3 ON d3.parent_id = d2.id JOIN system_dept d4 ON d4.parent_id = d3.id WHERE d1.id = #{deptId}
|
|
SELECT d4.id FROM system_dept d1 JOIN system_dept d2 ON d2.parent_id = d1.id JOIN system_dept d3 ON d3.parent_id = d2.id JOIN system_dept d4 ON d4.parent_id = d3.id WHERE d1.id = #{deptId}
|
|
) AS dept_hierarchy
|
|
) AS dept_hierarchy
|
|
)
|
|
)
|
|
- and device_name != '日报填报'
|
|
|
|
|
|
+ and device_name != '日报填报'
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<!-- -->
|
|
<!-- -->
|
|
@@ -532,22 +532,22 @@
|
|
|
|
|
|
<select id="pdList" resultType="cn.iocoder.yudao.module.pms.dal.dataobject.iotopeationfill.IotOpeationFillDO">
|
|
<select id="pdList" resultType="cn.iocoder.yudao.module.pms.dal.dataobject.iotopeationfill.IotOpeationFillDO">
|
|
select
|
|
select
|
|
- distinct
|
|
|
|
- b.id user_id,
|
|
|
|
- b.nickname user_name,
|
|
|
|
- c.id dept_id,
|
|
|
|
- b.mobile,
|
|
|
|
- c.name orgName
|
|
|
|
|
|
+ distinct
|
|
|
|
+ b.id user_id,
|
|
|
|
+ b.nickname user_name,
|
|
|
|
+ c.id dept_id,
|
|
|
|
+ b.mobile,
|
|
|
|
+ c.name orgName
|
|
from
|
|
from
|
|
- rq_iot_device_person a
|
|
|
|
- left join
|
|
|
|
- system_users b
|
|
|
|
- on
|
|
|
|
- a.person_id = b.id
|
|
|
|
- left join
|
|
|
|
- system_dept c
|
|
|
|
- on
|
|
|
|
- b.dept_id = c.id
|
|
|
|
|
|
+ rq_iot_device_person a
|
|
|
|
+ left join
|
|
|
|
+ system_users b
|
|
|
|
+ on
|
|
|
|
+ a.person_id = b.id
|
|
|
|
+ left join
|
|
|
|
+ system_dept c
|
|
|
|
+ on
|
|
|
|
+ b.dept_id = c.id
|
|
where b.id is not null
|
|
where b.id is not null
|
|
<if test="deviceIds != null and !deviceIds.isEmpty()">
|
|
<if test="deviceIds != null and !deviceIds.isEmpty()">
|
|
and a.device_id in
|
|
and a.device_id in
|
|
@@ -588,70 +588,70 @@
|
|
<select id="allOrder" resultType="cn.iocoder.yudao.module.pms.dal.dataobject.iotopeationfill.IotOpeationFillOrderDO">
|
|
<select id="allOrder" resultType="cn.iocoder.yudao.module.pms.dal.dataobject.iotopeationfill.IotOpeationFillOrderDO">
|
|
select distinct user_name
|
|
select distinct user_name
|
|
from
|
|
from
|
|
- rq_iot_opeation_fill_order
|
|
|
|
|
|
+ rq_iot_opeation_fill_order
|
|
where
|
|
where
|
|
- DATE(create_time) = DATE(#{localDateTime})
|
|
|
|
- <if test="userNames != null and !userNames.isEmpty()">
|
|
|
|
- and user_name in
|
|
|
|
- <foreach collection="userNames" item="userName" open="(" separator="," close=")">
|
|
|
|
- #{userName}
|
|
|
|
- </foreach>
|
|
|
|
- </if>
|
|
|
|
|
|
+ DATE(create_time) = DATE(#{localDateTime})
|
|
|
|
+ <if test="userNames != null and !userNames.isEmpty()">
|
|
|
|
+ and user_name in
|
|
|
|
+ <foreach collection="userNames" item="userName" open="(" separator="," close=")">
|
|
|
|
+ #{userName}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="pdList2" resultType="cn.iocoder.yudao.module.pms.dal.dataobject.iotopeationfill.IotOpeationFillDO">
|
|
<select id="pdList2" resultType="cn.iocoder.yudao.module.pms.dal.dataobject.iotopeationfill.IotOpeationFillDO">
|
|
select
|
|
select
|
|
- distinct
|
|
|
|
- b.id user_id,
|
|
|
|
- b.nickname user_name,
|
|
|
|
- c.id dept_id,
|
|
|
|
- b.mobile,
|
|
|
|
- c.name orgName
|
|
|
|
|
|
+ distinct
|
|
|
|
+ b.id user_id,
|
|
|
|
+ b.nickname user_name,
|
|
|
|
+ c.id dept_id,
|
|
|
|
+ b.mobile,
|
|
|
|
+ c.name orgName
|
|
from
|
|
from
|
|
- rq_iot_device_person a
|
|
|
|
- left join
|
|
|
|
- system_users b
|
|
|
|
- on
|
|
|
|
- a.person_id = b.id
|
|
|
|
- left join
|
|
|
|
- system_dept c
|
|
|
|
- on
|
|
|
|
- b.dept_id = c.id
|
|
|
|
|
|
+ rq_iot_device_person a
|
|
|
|
+ left join
|
|
|
|
+ system_users b
|
|
|
|
+ on
|
|
|
|
+ a.person_id = b.id
|
|
|
|
+ left join
|
|
|
|
+ system_dept c
|
|
|
|
+ on
|
|
|
|
+ b.dept_id = c.id
|
|
where
|
|
where
|
|
- b.id is not null
|
|
|
|
- and
|
|
|
|
- c.id is not null
|
|
|
|
|
|
+ b.id is not null
|
|
|
|
+ and
|
|
|
|
+ c.id is not null
|
|
<if test="deviceIds != null and !deviceIds.isEmpty()">
|
|
<if test="deviceIds != null and !deviceIds.isEmpty()">
|
|
and c.id in
|
|
and c.id in
|
|
<foreach collection="deviceIds" item="id" open="(" separator="," close=")">
|
|
<foreach collection="deviceIds" item="id" open="(" separator="," close=")">
|
|
#{id}
|
|
#{id}
|
|
</foreach>
|
|
</foreach>
|
|
</if>
|
|
</if>
|
|
- and
|
|
|
|
- a.person_id
|
|
|
|
- not in
|
|
|
|
- (select
|
|
|
|
- distinct
|
|
|
|
- d.person_id
|
|
|
|
- from
|
|
|
|
- rq_iot_model_template a,
|
|
|
|
- rq_iot_model_template_attrs b,
|
|
|
|
- rq_iot_device c,
|
|
|
|
- rq_iot_device_person d
|
|
|
|
- where
|
|
|
|
- a.device_category_id = b.device_category_id
|
|
|
|
- and
|
|
|
|
- a.device_category_id = c.asset_class
|
|
|
|
- and
|
|
|
|
- c.id = d.device_id
|
|
|
|
- and
|
|
|
|
- c.device_status in ('sg','dm')
|
|
|
|
- and
|
|
|
|
- a.deleted = 0
|
|
|
|
- and
|
|
|
|
- c.deleted = 0
|
|
|
|
- and
|
|
|
|
- d.deleted = 0)
|
|
|
|
|
|
+ and
|
|
|
|
+ a.person_id
|
|
|
|
+ not in
|
|
|
|
+ (select
|
|
|
|
+ distinct
|
|
|
|
+ d.person_id
|
|
|
|
+ from
|
|
|
|
+ rq_iot_model_template a,
|
|
|
|
+ rq_iot_model_template_attrs b,
|
|
|
|
+ rq_iot_device c,
|
|
|
|
+ rq_iot_device_person d
|
|
|
|
+ where
|
|
|
|
+ a.device_category_id = b.device_category_id
|
|
|
|
+ and
|
|
|
|
+ a.device_category_id = c.asset_class
|
|
|
|
+ and
|
|
|
|
+ c.id = d.device_id
|
|
|
|
+ and
|
|
|
|
+ c.device_status in ('sg','dm')
|
|
|
|
+ and
|
|
|
|
+ a.deleted = 0
|
|
|
|
+ and
|
|
|
|
+ c.deleted = 0
|
|
|
|
+ and
|
|
|
|
+ d.deleted = 0)
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="fillList1" parameterType="cn.iocoder.yudao.module.pms.controller.admin.iotopeationfill.vo.IotOpeationFillRespVO"
|
|
<select id="fillList1" parameterType="cn.iocoder.yudao.module.pms.controller.admin.iotopeationfill.vo.IotOpeationFillRespVO"
|
|
@@ -666,7 +666,7 @@
|
|
|
|
|
|
|
|
|
|
<select id="getAttrsById" parameterType="cn.iocoder.yudao.module.pms.controller.admin.vo.IotDeviceRespVO"
|
|
<select id="getAttrsById" parameterType="cn.iocoder.yudao.module.pms.controller.admin.vo.IotDeviceRespVO"
|
|
- resultType="cn.iocoder.yudao.module.pms.dal.dataobject.iotmodeltemplateattrs.IotModelTemplateAttrsDO">
|
|
|
|
|
|
+ resultType="cn.iocoder.yudao.module.pms.dal.dataobject.iotmodeltemplateattrs.IotModelTemplateAttrsDO">
|
|
select
|
|
select
|
|
id,
|
|
id,
|
|
name,
|
|
name,
|
|
@@ -685,16 +685,16 @@
|
|
|
|
|
|
<update id="updateFill" parameterType="cn.iocoder.yudao.module.pms.controller.admin.vo.IotOpeationModelPageReqVO">
|
|
<update id="updateFill" parameterType="cn.iocoder.yudao.module.pms.controller.admin.vo.IotOpeationModelPageReqVO">
|
|
update rq_iot_opeation_fill
|
|
update rq_iot_opeation_fill
|
|
- set is_fill = '1'
|
|
|
|
|
|
+ set is_fill = '1'
|
|
where device_id = #{deviceId}
|
|
where device_id = #{deviceId}
|
|
- and DATE(create_time) = DATE(#{createTime})
|
|
|
|
|
|
+ and DATE(create_time) = DATE(#{createTime})
|
|
</update>
|
|
</update>
|
|
|
|
|
|
<select id="getFillList" parameterType="cn.iocoder.yudao.module.pms.controller.admin.iotopeationfill.vo.IotOpeationFillRespVO"
|
|
<select id="getFillList" parameterType="cn.iocoder.yudao.module.pms.controller.admin.iotopeationfill.vo.IotOpeationFillRespVO"
|
|
resultType="cn.iocoder.yudao.module.pms.controller.admin.iotopeationfill.vo.IotOpeationFillRespVO">
|
|
resultType="cn.iocoder.yudao.module.pms.controller.admin.iotopeationfill.vo.IotOpeationFillRespVO">
|
|
select distinct b.* from
|
|
select distinct b.* from
|
|
- rq_iot_opeation_fill b,
|
|
|
|
- rq_iot_opeation_fill_order c
|
|
|
|
|
|
+ rq_iot_opeation_fill b,
|
|
|
|
+ rq_iot_opeation_fill_order c
|
|
where
|
|
where
|
|
c.id = #{orderId}
|
|
c.id = #{orderId}
|
|
and
|
|
and
|
|
@@ -708,7 +708,7 @@
|
|
|
|
|
|
|
|
|
|
<select id="getDeivceFillInfo" parameterType="cn.iocoder.yudao.module.pms.dal.dataobject.iotdevicerunlog.IotDeviceRunLogDO"
|
|
<select id="getDeivceFillInfo" parameterType="cn.iocoder.yudao.module.pms.dal.dataobject.iotdevicerunlog.IotDeviceRunLogDO"
|
|
- resultType="cn.iocoder.yudao.module.pms.dal.dataobject.iotdevicerunlog.IotDeviceRunLogDO">
|
|
|
|
|
|
+ resultType="cn.iocoder.yudao.module.pms.dal.dataobject.iotdevicerunlog.IotDeviceRunLogDO">
|
|
<!--SELECT * FROM rq_iot_device_run_log
|
|
<!--SELECT * FROM rq_iot_device_run_log
|
|
WHERE
|
|
WHERE
|
|
device_id = #{deviceId}
|
|
device_id = #{deviceId}
|
|
@@ -770,17 +770,17 @@
|
|
|
|
|
|
|
|
|
|
<select id="devList" parameterType="cn.iocoder.yudao.module.pms.dal.dataobject.iotopeationfill.IotOpeationFillDO"
|
|
<select id="devList" parameterType="cn.iocoder.yudao.module.pms.dal.dataobject.iotopeationfill.IotOpeationFillDO"
|
|
- resultType="cn.iocoder.yudao.module.pms.dal.dataobject.iotopeationfill.IotOpeationFillDO">
|
|
|
|
|
|
+ resultType="cn.iocoder.yudao.module.pms.dal.dataobject.iotopeationfill.IotOpeationFillDO">
|
|
select device_id from rq_iot_opeation_fill where order_id = #{orderId}
|
|
select device_id from rq_iot_opeation_fill where order_id = #{orderId}
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="orderList" parameterType="cn.iocoder.yudao.module.pms.dal.dataobject.iotopeationfill.IotOpeationFillDO"
|
|
<select id="orderList" parameterType="cn.iocoder.yudao.module.pms.dal.dataobject.iotopeationfill.IotOpeationFillDO"
|
|
resultType="cn.iocoder.yudao.module.pms.dal.dataobject.iotopeationfill.IotOpeationFillDO">
|
|
resultType="cn.iocoder.yudao.module.pms.dal.dataobject.iotopeationfill.IotOpeationFillDO">
|
|
select distinct order_id
|
|
select distinct order_id
|
|
- from
|
|
|
|
- rq_iot_opeation_fill
|
|
|
|
|
|
+ from
|
|
|
|
+ rq_iot_opeation_fill
|
|
where
|
|
where
|
|
- device_id = #{deviceId}
|
|
|
|
|
|
+ device_id = #{deviceId}
|
|
and DATE(create_time) = #{creDate}
|
|
and DATE(create_time) = #{creDate}
|
|
and order_id != #{orderId}
|
|
and order_id != #{orderId}
|
|
</select>
|
|
</select>
|
|
@@ -823,14 +823,14 @@
|
|
<select id="deviceCountList" parameterType="cn.iocoder.yudao.module.pms.dal.dataobject.iotdevicecountdata.IotDeviceCountData"
|
|
<select id="deviceCountList" parameterType="cn.iocoder.yudao.module.pms.dal.dataobject.iotdevicecountdata.IotDeviceCountData"
|
|
resultType="cn.iocoder.yudao.module.pms.dal.dataobject.iotdevicecountdata.IotDeviceCountData">
|
|
resultType="cn.iocoder.yudao.module.pms.dal.dataobject.iotdevicecountdata.IotDeviceCountData">
|
|
select
|
|
select
|
|
- distinct
|
|
|
|
- a.device_code,
|
|
|
|
- a.device_name,
|
|
|
|
- a.create_time,
|
|
|
|
- b.name dept_name,
|
|
|
|
- a.is_fill,
|
|
|
|
- d.nickname,
|
|
|
|
- e.order_name
|
|
|
|
|
|
+ distinct
|
|
|
|
+ a.device_code,
|
|
|
|
+ a.device_name,
|
|
|
|
+ a.create_time,
|
|
|
|
+ b.name dept_name,
|
|
|
|
+ a.is_fill,
|
|
|
|
+ d.nickname,
|
|
|
|
+ e.order_name
|
|
FROM rq_iot_opeation_fill a
|
|
FROM rq_iot_opeation_fill a
|
|
LEFT JOIN system_dept b
|
|
LEFT JOIN system_dept b
|
|
ON a.dept_id = b.id
|
|
ON a.dept_id = b.id
|
|
@@ -884,7 +884,7 @@
|
|
|
|
|
|
|
|
|
|
<select id="countList" parameterType="cn.iocoder.yudao.module.pms.dal.dataobject.iotcountdata.IotCountDataDO"
|
|
<select id="countList" parameterType="cn.iocoder.yudao.module.pms.dal.dataobject.iotcountdata.IotCountDataDO"
|
|
- resultType="cn.iocoder.yudao.module.pms.dal.dataobject.iotcountdata.IotCountDataDO">
|
|
|
|
|
|
+ resultType="cn.iocoder.yudao.module.pms.dal.dataobject.iotcountdata.IotCountDataDO">
|
|
-- 统计指定部门及其子部门的工单状态
|
|
-- 统计指定部门及其子部门的工单状态
|
|
SELECT
|
|
SELECT
|
|
dept_id,
|
|
dept_id,
|
|
@@ -1040,22 +1040,30 @@
|
|
|
|
|
|
|
|
|
|
<select id="childList" parameterType="cn.iocoder.yudao.module.pms.dal.dataobject.iotopeationfill.IotOpeationFillOrderDO"
|
|
<select id="childList" parameterType="cn.iocoder.yudao.module.pms.dal.dataobject.iotopeationfill.IotOpeationFillOrderDO"
|
|
- resultType="cn.iocoder.yudao.module.pms.dal.dataobject.iotopeationfill.IotOpeationFillOrderDO">
|
|
|
|
|
|
+ resultType="cn.iocoder.yudao.module.pms.dal.dataobject.iotopeationfill.IotOpeationFillOrderDO">
|
|
SELECT id dept_id
|
|
SELECT id dept_id
|
|
FROM system_dept
|
|
FROM system_dept
|
|
WHERE parent_id = #{deptId}
|
|
WHERE parent_id = #{deptId}
|
|
AND deleted = 0
|
|
AND deleted = 0
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
+ <select id="devStatus" parameterType="cn.iocoder.yudao.module.pms.dal.dataobject.IotDeviceDO"
|
|
|
|
+ resultType="cn.iocoder.yudao.module.pms.dal.dataobject.IotDeviceDO">
|
|
|
|
+ SELECT order_status
|
|
|
|
+ FROM rq_iot_device
|
|
|
|
+ WHERE dept_id = #{deptId}
|
|
|
|
+ AND asset_class in (159,160)
|
|
|
|
+ </select>
|
|
|
|
+
|
|
<select id="isReport" parameterType="cn.iocoder.yudao.module.pms.dal.dataobject.iotopeationfill.IotOpeationFillDO"
|
|
<select id="isReport" parameterType="cn.iocoder.yudao.module.pms.dal.dataobject.iotopeationfill.IotOpeationFillDO"
|
|
- resultType="cn.iocoder.yudao.module.pms.dal.dataobject.iotopeationfill.IotOpeationFillDO">
|
|
|
|
|
|
+ resultType="cn.iocoder.yudao.module.pms.dal.dataobject.iotopeationfill.IotOpeationFillDO">
|
|
select * from
|
|
select * from
|
|
rq_iot_opeation_fill
|
|
rq_iot_opeation_fill
|
|
where
|
|
where
|
|
device_id = #{deviceId}
|
|
device_id = #{deviceId}
|
|
- and
|
|
|
|
|
|
+ and
|
|
DATE(create_time) = DATE(#{createTime})
|
|
DATE(create_time) = DATE(#{createTime})
|
|
- LIMIT 1
|
|
|
|
|
|
+ LIMIT 1
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="orderDO" parameterType="cn.iocoder.yudao.module.pms.dal.dataobject.iotopeationfill.IotOpeationFillDO"
|
|
<select id="orderDO" parameterType="cn.iocoder.yudao.module.pms.dal.dataobject.iotopeationfill.IotOpeationFillDO"
|
|
@@ -1066,7 +1074,7 @@
|
|
rq_iot_opeation_fill
|
|
rq_iot_opeation_fill
|
|
where
|
|
where
|
|
device_id = #{deviceId}
|
|
device_id = #{deviceId}
|
|
- and
|
|
|
|
|
|
+ and
|
|
DATE(create_time) = #{createTime}
|
|
DATE(create_time) = #{createTime}
|
|
</select>
|
|
</select>
|
|
|
|
|
|
@@ -1080,34 +1088,34 @@
|
|
b.name AS org_name
|
|
b.name AS org_name
|
|
FROM
|
|
FROM
|
|
rq_iot_opeation_fill a
|
|
rq_iot_opeation_fill a
|
|
- INNER JOIN
|
|
|
|
|
|
+ INNER JOIN
|
|
rq_iot_model_template_attrs b
|
|
rq_iot_model_template_attrs b
|
|
- ON
|
|
|
|
- a.device_category_id = b.device_category_id
|
|
|
|
|
|
+ ON
|
|
|
|
+ a.device_category_id = b.device_category_id
|
|
WHERE
|
|
WHERE
|
|
a.order_id = #{orderId}
|
|
a.order_id = #{orderId}
|
|
- AND (
|
|
|
|
- -- 第一个查询的条件
|
|
|
|
|
|
+ AND (
|
|
|
|
+ -- 第一个查询的条件
|
|
(a.is_report = 1 AND b.daily_report = 0
|
|
(a.is_report = 1 AND b.daily_report = 0
|
|
- AND b.name NOT IN (
|
|
|
|
|
|
+ AND b.name NOT IN (
|
|
SELECT
|
|
SELECT
|
|
DISTINCT
|
|
DISTINCT
|
|
b2.name
|
|
b2.name
|
|
FROM
|
|
FROM
|
|
rq_iot_opeation_fill a2
|
|
rq_iot_opeation_fill a2
|
|
- INNER JOIN
|
|
|
|
|
|
+ INNER JOIN
|
|
rq_iot_model_template_attrs b2
|
|
rq_iot_model_template_attrs b2
|
|
- ON
|
|
|
|
- a2.device_category_id = b2.device_category_id
|
|
|
|
|
|
+ ON
|
|
|
|
+ a2.device_category_id = b2.device_category_id
|
|
WHERE
|
|
WHERE
|
|
- a2.order_id = #{orderId}
|
|
|
|
- AND
|
|
|
|
- a2.is_report = 0
|
|
|
|
- AND
|
|
|
|
- b2.daily_report = 1
|
|
|
|
|
|
+ a2.order_id = #{orderId}
|
|
|
|
+ AND
|
|
|
|
+ a2.is_report = 0
|
|
|
|
+ AND
|
|
|
|
+ b2.daily_report = 1
|
|
))
|
|
))
|
|
- -- 第二个查询的条件(通过OR代替UNION)
|
|
|
|
- OR (a.is_report is null AND b.daily_report = 1)
|
|
|
|
|
|
+ -- 第二个查询的条件(通过OR代替UNION)
|
|
|
|
+ OR (a.is_report is null AND b.daily_report = 1)
|
|
)
|
|
)
|
|
and a.device_code != ''
|
|
and a.device_code != ''
|
|
</select>
|
|
</select>
|