|
@@ -37,6 +37,10 @@
|
|
|
<result column="videos" property="videos" jdbcType="VARCHAR" />
|
|
|
<result column="pictures" property="pictures" jdbcType="VARCHAR" />
|
|
|
<result column="flow_detail" property="flowDetail" jdbcType="VARCHAR" />
|
|
|
+ <result column="device_id" property="deviceId" jdbcType="INTEGER" />
|
|
|
+ <result column="scenes_id" property="scenesId" jdbcType="INTEGER" />
|
|
|
+ <result column="device_name" property="deviceName" jdbcType="VARCHAR" />
|
|
|
+ <result column="scenes_name" property="scenesName" jdbcType="VARCHAR" />
|
|
|
</resultMap>
|
|
|
|
|
|
<resultMap id="workFlowLogResultMap" type="com.huaxu.order.entity.WorkFlowLog">
|
|
@@ -86,7 +90,8 @@
|
|
|
date_limit, urgency, address, contact_user, contact_phone, order_time, company_org_id,
|
|
|
department_org_id, order_status, event_type, order_type_id, order_pid, tenant_id,
|
|
|
process_instance_id, process_def_id, current_task_id, current_users, current_task_name,
|
|
|
- create_by, date_create, update_by, date_update, geo,videos,pictures
|
|
|
+ create_by, date_create, update_by, date_update, geo,videos, pictures, device_id, scenes_id,
|
|
|
+ device_name, scenes_name
|
|
|
</sql>
|
|
|
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
|
|
|
select
|
|
@@ -472,16 +477,15 @@
|
|
|
pictures = #{pictures,jdbcType=VARCHAR}
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</update>
|
|
|
-
|
|
|
<select id="selectAppTodo" resultMap="BaseResultMap">
|
|
|
- select id,task_no,send_time,address,order_type_id,create_by,update_by,task_desc,order_status
|
|
|
+ select id,task_no,send_time,address,order_type_id,create_by,update_by,task_desc,order_status,current_task_name
|
|
|
from sc_work_order_manage
|
|
|
where find_in_set(#{userId},current_users) and tenant_id = #{tenantId}
|
|
|
union
|
|
|
- select id,plan_id,plan_date,task_area_name,task_type,create_by,update_by,task_content,plan_status
|
|
|
+ select id,plan_id,plan_date,task_area_name,task_type,create_by,update_by,task_content,plan_status,current_task_name
|
|
|
from sc_plan_manage
|
|
|
where find_in_set(#{userId},current_users) and tenant_id = #{tenantId}
|
|
|
- order by send_time
|
|
|
+ order by send_time desc
|
|
|
</select>
|
|
|
<select id="selectAppAll" resultMap="BaseResultMap">
|
|
|
select id,task_no,send_time,address,order_type_id,current_task_name,create_by,update_by,task_desc,order_status
|
|
@@ -495,7 +499,7 @@
|
|
|
where (find_in_set(#{userId},current_users)
|
|
|
or id in(select flow_id from sc_work_flow_log where flow_type=1 and find_in_set(#{userId},handle_user_id)))
|
|
|
and tenant_id = #{tenantId}
|
|
|
- order by send_time
|
|
|
+ order by send_time desc
|
|
|
</select>
|
|
|
<select id="selectOrderDetail" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
|
|
|
select t1.*,t2.flow_detail
|
|
@@ -504,7 +508,6 @@
|
|
|
where t1.id = #{id,jdbcType=INTEGER} or t1.order_pid = #{orderPid,jdbcType=INTEGER}
|
|
|
order by t1.order_pid
|
|
|
</select>
|
|
|
-
|
|
|
<insert id="batchInsertByAlarms" >
|
|
|
insert into sc_work_order_manage( task_no, task_desc, address, order_time, company_org_id, department_org_id, order_status, event_type, order_pid, tenant_id, current_task_name, date_create, date_update, geo,scenes_id,scenes_name,device_id,device_name)
|
|
|
values
|
|
@@ -512,7 +515,6 @@
|
|
|
(#{item.taskNo} , #{item.taskDesc}, #{item.address}, #{item.orderTime}, #{item.companyOrgId}, #{item.departmentOrgId}, 0, 3, 0, #{item.tenantId}, '设备报警工单', now(), now(), #{item.geo}, #{item.parentSceneId}, #{item.parentSceneName}, #{item.deviceId}, #{item.deviceName})
|
|
|
</foreach>
|
|
|
</insert>
|
|
|
-
|
|
|
<delete id="batchDeleteByAlarms" >
|
|
|
delete from sc_work_order_manage
|
|
|
where order_status = 0 and device_id in
|
|
@@ -520,7 +522,6 @@
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
</delete>
|
|
|
-
|
|
|
<select id="findWorkOrderByDeviceIds" resultType="com.huaxu.order.dto.WorkOrderManageByAlarmDto">
|
|
|
select
|
|
|
id
|
|
@@ -546,6 +547,7 @@
|
|
|
t1.order_type_id, t1.order_pid, t1.tenant_id,
|
|
|
t1.process_instance_id, t1.process_def_id, t1.current_task_id, t1.current_users, t1.current_task_name,
|
|
|
t1.create_by, t1.date_create, t1.update_by, t1.date_update, t1.geo,t1.videos,t1.pictures,
|
|
|
+ t1.device_id, t1.scenes_id, t1.device_name, t1.scenes_name,
|
|
|
t2.flow_detail,t2.create_by detail_create_by,t2.date_create detail_date_create,t2.update_by detail_update_by,t2.date_update detail_date_update
|
|
|
from sc_work_order_manage t1 left join sc_work_flow_detail t2
|
|
|
on t1.id = t2.flow_id and t2.flow_type=2
|
|
@@ -558,7 +560,7 @@
|
|
|
</if>
|
|
|
<if test="order.userType!=null and order.userType!=-999 and order.userType!=-9999 and order.programItems != null and order.programItems.size() > 0">
|
|
|
<if test="order.permissonType == 5 or order.permissonType == 2">
|
|
|
- and ( t1.DEPT_ORG_ID in
|
|
|
+ and ( t1.department_org_id in
|
|
|
<foreach collection="order.programItems" item="item" open="(" close=")" separator=",">
|
|
|
#{item.orgId}
|
|
|
</foreach>
|
|
@@ -570,7 +572,7 @@
|
|
|
)
|
|
|
</if>
|
|
|
<if test="order.permissonType == 4 or order.permissonType == 3">
|
|
|
- and t1.DEPT_ORG_ID in
|
|
|
+ and t1.department_org_id in
|
|
|
<foreach collection="order.programItems" item="item" open="(" close=")" separator=",">
|
|
|
#{item.orgId}
|
|
|
</foreach>
|
|
@@ -580,7 +582,7 @@
|
|
|
<foreach collection="order.programItems" item="item" open="(" close=")" separator=",">
|
|
|
#{item.orgId}
|
|
|
</foreach>
|
|
|
- and (t1.DEPT_ORG_ID is null or t1.DEPT_ORG_ID =0)
|
|
|
+ and (t1.department_org_id is null or t1.department_org_id =0)
|
|
|
</if>
|
|
|
</if>
|
|
|
<if test="order.orderStatus != null">
|