|
@@ -38,10 +38,12 @@
|
|
|
|
|
|
<insert id="insertFillOrder"
|
|
|
parameterType="cn.iocoder.yudao.module.pms.dal.dataobject.iotopeationfill.IotOpeationFillDO">
|
|
|
- insert into rqiot.rq_iot_opeation_fill_order(dept_id,order_name,order_status,create_time,order_type)
|
|
|
+ insert into rqiot.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.deptId},#{item.orderName},#{item.orderStatus},
|
|
|
+ #{item.createTime},#{item.orderType},#{item.userName},#{item.userId})
|
|
|
</foreach>
|
|
|
|
|
|
</insert>
|
|
@@ -49,11 +51,11 @@
|
|
|
<insert id="insertLog"
|
|
|
parameterType="cn.iocoder.yudao.module.pms.dal.dataobject.iotdevicerunlog.IotDeviceRunLogDO">
|
|
|
insert into rqiot.rq_iot_device_run_log
|
|
|
- (dept_id,device_id,device_code,point_code,fill_content,create_time,point_name)
|
|
|
+ (dept_id,device_id,device_code,point_code,fill_content,create_time,point_name,total_run_time)
|
|
|
values
|
|
|
<foreach collection="list" item="item" separator=",">
|
|
|
(#{item.deptId},#{item.deviceId},#{item.deviceCode},
|
|
|
- #{item.pointCode},#{item.fillContent},#{item.createTime},#{item.pointName})
|
|
|
+ #{item.pointCode},#{item.fillContent},#{item.createTime},#{item.pointName},#{item.totalRunTime})
|
|
|
</foreach>
|
|
|
|
|
|
</insert>
|
|
@@ -92,13 +94,18 @@
|
|
|
|
|
|
<select id="fillListByUserId" parameterType="cn.iocoder.yudao.module.pms.controller.admin.iotopeationfill.vo.IotOpeationFillRespVO"
|
|
|
resultType="cn.iocoder.yudao.module.pms.dal.dataobject.iotopeationfill.IotOpeationFillDO">
|
|
|
- SELECT * FROM
|
|
|
- rqiot.rq_iot_opeation_fill
|
|
|
- WHERE DATE(create_time) = CURDATE()
|
|
|
+ SELECT a.*,
|
|
|
+ b.name org_name FROM
|
|
|
+ rqiot.rq_iot_opeation_fill a,
|
|
|
+ rqiot.system_dept b
|
|
|
+ WHERE DATE(a.create_time) = CURDATE()
|
|
|
<if test="userId != null and userId != ''">
|
|
|
and device_id in (select device_id from
|
|
|
rqiot.rq_iot_device_person where person_id = #{userId})
|
|
|
</if>
|
|
|
+ and
|
|
|
+ a.dept_id = b.id
|
|
|
+
|
|
|
</select>
|
|
|
|
|
|
<select id="fillListByDeptId" parameterType="cn.iocoder.yudao.module.pms.controller.admin.iotopeationfill.vo.IotOpeationFillRespVO"
|
|
@@ -116,6 +123,49 @@
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
|
+ <select id="rhList"
|
|
|
+ resultType="cn.iocoder.yudao.module.pms.dal.dataobject.iotopeationfill.IotOpeationFillDO">
|
|
|
+ SELECT d1.id dept_id
|
|
|
+ FROM system_dept d1
|
|
|
+ JOIN system_dept d2 ON d2.id = d1.parent_id
|
|
|
+ WHERE d2.parent_id = 157
|
|
|
+ union
|
|
|
+ select id from system_dept where id = 157
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="rdList"
|
|
|
+ resultType="cn.iocoder.yudao.module.pms.dal.dataobject.iotopeationfill.IotOpeationFillDO">
|
|
|
+ SELECT d1.id dept_id
|
|
|
+ FROM system_dept d1
|
|
|
+ JOIN system_dept d2 ON d2.id = d1.parent_id
|
|
|
+ WHERE d2.parent_id = 163
|
|
|
+ union
|
|
|
+ select id from system_dept where id = 163
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="ryList"
|
|
|
+ resultType="cn.iocoder.yudao.module.pms.dal.dataobject.iotopeationfill.IotOpeationFillDO">
|
|
|
+ SELECT d1.id dept_id
|
|
|
+ FROM system_dept d1
|
|
|
+ JOIN system_dept d2 ON d2.id = d1.parent_id
|
|
|
+ WHERE d2.parent_id = 158
|
|
|
+ union
|
|
|
+ select id from system_dept where id = 158
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="pdList" resultType="cn.iocoder.yudao.module.pms.dal.dataobject.iotopeationfill.IotOpeationFillDO">
|
|
|
+ select
|
|
|
+ distinct
|
|
|
+ a.id user_id,
|
|
|
+ a.nickname user_name,
|
|
|
+ a.dept_id
|
|
|
+ from
|
|
|
+ system_users a,
|
|
|
+ rq_iot_device_person b
|
|
|
+ where
|
|
|
+ a.id = b.person_id
|
|
|
+ </select>
|
|
|
+
|
|
|
<select id="fillList1" parameterType="cn.iocoder.yudao.module.pms.controller.admin.iotopeationfill.vo.IotOpeationFillRespVO"
|
|
|
resultType="cn.iocoder.yudao.module.pms.dal.dataobject.iotopeationfill.IotOpeationFillDO">
|
|
|
SELECT * FROM
|