|
@@ -37,6 +37,50 @@
|
|
<result column="pictures" property="pictures" jdbcType="VARCHAR" />
|
|
<result column="pictures" property="pictures" jdbcType="VARCHAR" />
|
|
<result column="flow_detail" property="flowDetail" jdbcType="VARCHAR" />
|
|
<result column="flow_detail" property="flowDetail" jdbcType="VARCHAR" />
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
+
|
|
|
|
+ <resultMap id="workFlowLogResultMap" type="com.huaxu.order.entity.WorkFlowLog">
|
|
|
|
+ <id column="id" property="id" jdbcType="INTEGER" />
|
|
|
|
+ <result column="flow_id" property="flowId" jdbcType="INTEGER" />
|
|
|
|
+ <result column="log_process_instance_id" property="processInstanceId" jdbcType="VARCHAR" />
|
|
|
|
+ <result column="task_id" property="taskId" jdbcType="VARCHAR" />
|
|
|
|
+ <result column="handle_user_id" property="handleUserId" jdbcType="VARCHAR" />
|
|
|
|
+ <result column="handle_user_name" property="handleUserName" jdbcType="VARCHAR" />
|
|
|
|
+ <result column="flow_type" property="flowType" jdbcType="INTEGER" />
|
|
|
|
+ <result column="flow_result" property="flowResult" jdbcType="VARCHAR" />
|
|
|
|
+ <result column="log_create_by" property="createBy" jdbcType="VARCHAR" />
|
|
|
|
+ <result column="log_date_create" property="dateCreate" jdbcType="TIMESTAMP" />
|
|
|
|
+ <result column="log_update_by" property="updateBy" jdbcType="VARCHAR" />
|
|
|
|
+ <result column="log_date_update" property="dateUpdate" jdbcType="TIMESTAMP" />
|
|
|
|
+ </resultMap>
|
|
|
|
+
|
|
|
|
+ <resultMap id="OrderResultMap" type="com.huaxu.order.entity.WorkOrderInfo" extends="BaseResultMap">
|
|
|
|
+ <association property="workFlowDetail" javaType="com.huaxu.order.entity.WorkFlowDetail">
|
|
|
|
+ <id column="id" property="id" jdbcType="INTEGER" />
|
|
|
|
+ <result column="flow_id" property="flowId" jdbcType="INTEGER" />
|
|
|
|
+ <result column="flow_type" property="flowType" jdbcType="INTEGER" />
|
|
|
|
+ <result column="flow_detail" property="flowDetail" jdbcType="VARCHAR" />
|
|
|
|
+ <result column="detail_create_by" property="createBy" jdbcType="VARCHAR" />
|
|
|
|
+ <result column="detail_date_create" property="dateCreate" jdbcType="TIMESTAMP" />
|
|
|
|
+ <result column="detail_update_by" property="updateBy" jdbcType="VARCHAR" />
|
|
|
|
+ <result column="detail_date_update" property="dateUpdate" jdbcType="TIMESTAMP" />
|
|
|
|
+ </association>
|
|
|
|
+ <collection property="workFlowLogList" ofType="com.huaxu.order.entity.WorkFlowLog" javaType="java.util.List" select="getWorkFlowLog" column="{flowId=id}">
|
|
|
|
+ <id column="id" property="id" jdbcType="INTEGER" />
|
|
|
|
+ <result column="flow_id" property="flowId" jdbcType="INTEGER" />
|
|
|
|
+ <result column="log_process_instance_id" property="processInstanceId" jdbcType="VARCHAR" />
|
|
|
|
+ <result column="task_id" property="taskId" jdbcType="VARCHAR" />
|
|
|
|
+ <result column="handle_user_id" property="handleUserId" jdbcType="VARCHAR" />
|
|
|
|
+ <result column="handle_user_name" property="handleUserName" jdbcType="VARCHAR" />
|
|
|
|
+ <result column="flow_type" property="flowType" jdbcType="INTEGER" />
|
|
|
|
+ <result column="flow_result" property="flowResult" jdbcType="VARCHAR" />
|
|
|
|
+ <result column="log_create_by" property="createBy" jdbcType="VARCHAR" />
|
|
|
|
+ <result column="log_date_create" property="dateCreate" jdbcType="TIMESTAMP" />
|
|
|
|
+ <result column="log_update_by" property="updateBy" jdbcType="VARCHAR" />
|
|
|
|
+ <result column="log_date_update" property="dateUpdate" jdbcType="TIMESTAMP" />
|
|
|
|
+ </collection>
|
|
|
|
+ </resultMap>
|
|
|
|
+
|
|
|
|
+
|
|
<sql id="Base_Column_List" >
|
|
<sql id="Base_Column_List" >
|
|
id, task_no, task_desc, order_user_id, send_time, send_by, plan_finish_date, finish_date,
|
|
id, task_no, task_desc, order_user_id, send_time, send_by, plan_finish_date, finish_date,
|
|
date_limit, urgency, address, contact_user, contact_phone, order_time, company_org_id,
|
|
date_limit, urgency, address, contact_user, contact_phone, order_time, company_org_id,
|
|
@@ -50,6 +94,13 @@
|
|
from sc_work_order_manage
|
|
from sc_work_order_manage
|
|
where id = #{id,jdbcType=INTEGER}
|
|
where id = #{id,jdbcType=INTEGER}
|
|
</select>
|
|
</select>
|
|
|
|
+
|
|
|
|
+ <select id="getWorkFlowLog" resultMap="workFlowLogResultMap" parameterType="map">
|
|
|
|
+ select t3.process_instance_id log_process_instance_id,t3.task_id,t3.handle_user_id,t3.handle_user_name,t3.flow_result,t3.create_by log_create_by,
|
|
|
|
+ t3.date_create log_date_create,t3.update_by log_update_by,t3.date_update log_date_update
|
|
|
|
+ from sc_work_flow_log t3
|
|
|
|
+ where t3.flow_id= #{flowId,jdbcType=INTEGER} and t3.flow_type=2
|
|
|
|
+ </select>
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
|
|
delete from sc_work_order_manage
|
|
delete from sc_work_order_manage
|
|
where id = #{id,jdbcType=INTEGER}
|
|
where id = #{id,jdbcType=INTEGER}
|
|
@@ -432,7 +483,6 @@
|
|
where find_in_set(#{userId},current_users) and tenant_id = #{tenantId}
|
|
where find_in_set(#{userId},current_users) and tenant_id = #{tenantId}
|
|
order by send_time
|
|
order by send_time
|
|
</select>
|
|
</select>
|
|
-
|
|
|
|
<select id="selectAppAll" resultMap="BaseResultMap">
|
|
<select id="selectAppAll" resultMap="BaseResultMap">
|
|
select id,task_no,send_time,address,order_type_id,current_task_name
|
|
select id,task_no,send_time,address,order_type_id,current_task_name
|
|
from sc_work_order_manage
|
|
from sc_work_order_manage
|
|
@@ -462,4 +512,74 @@
|
|
(CONCAT(DATE_FORMAT(now(), '%Y%m%d%H%i%s'),FLOOR(RAND()*8999)+1000) , #{item.taskDesc}, #{item.address}, #{item.orderTime}, #{item.companyOrgId}, #{item.departmentOrgId}, 0, 3, 0, #{item.tenantId}, '设备报警工单', 'system', now(), 'system', now(), #{item.geo})
|
|
(CONCAT(DATE_FORMAT(now(), '%Y%m%d%H%i%s'),FLOOR(RAND()*8999)+1000) , #{item.taskDesc}, #{item.address}, #{item.orderTime}, #{item.companyOrgId}, #{item.departmentOrgId}, 0, 3, 0, #{item.tenantId}, '设备报警工单', 'system', now(), 'system', now(), #{item.geo})
|
|
</foreach>
|
|
</foreach>
|
|
</insert>
|
|
</insert>
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ <!--分页查询-->
|
|
|
|
+ <select id="findPage" resultMap="OrderResultMap">
|
|
|
|
+ select
|
|
|
|
+ t1.id, t1.task_no, t1.task_desc, t1.order_user_id, t1.send_time, t1.send_by, t1.plan_finish_date, t1.finish_date,
|
|
|
|
+ t1.date_limit, t1.urgency, t1.address, t1.contact_user, t1.contact_phone, t1.order_time, t1.company_org_id,
|
|
|
|
+ t1.department_org_id, t1.order_status, t1.event_type, 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,
|
|
|
|
+ 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
|
|
|
|
+ <where>
|
|
|
|
+ <if test="order.tenantId != null and order.tenantId != ''">
|
|
|
|
+ and t1.tenant_id = #{order.tenantId}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="order.taskNo != null and order.taskNo != ''">
|
|
|
|
+ and t1.task_no like CONCAT('%',#{order.taskNo},'%')
|
|
|
|
+ </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
|
|
|
|
+ <foreach collection="order.programItems" item="item" open="(" close=")" separator=",">
|
|
|
|
+ #{item.orgId}
|
|
|
|
+ </foreach>
|
|
|
|
+ or
|
|
|
|
+ t1.COMPANY_ORG_ID in
|
|
|
|
+ <foreach collection="order.programItems" item="item" open="(" close=")" separator=",">
|
|
|
|
+ #{item.orgId}
|
|
|
|
+ </foreach>
|
|
|
|
+ )
|
|
|
|
+ </if>
|
|
|
|
+ <if test="order.permissonType == 4 or order.permissonType == 3">
|
|
|
|
+ and t1.DEPT_ORG_ID in
|
|
|
|
+ <foreach collection="order.programItems" item="item" open="(" close=")" separator=",">
|
|
|
|
+ #{item.orgId}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="plan.permissonType == 1">
|
|
|
|
+ and t1.COMPANY_ORG_ID in
|
|
|
|
+ <foreach collection="plan.programItems" item="item" open="(" close=")" separator=",">
|
|
|
|
+ #{item.orgId}
|
|
|
|
+ </foreach>
|
|
|
|
+ and (t1.DEPT_ORG_ID is null or t1.DEPT_ORG_ID =0)
|
|
|
|
+ </if>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="order.orderStatus != null">
|
|
|
|
+ and t1.order_status = #{order.orderStatus,jdbcType=INTEGER}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="order.orderStatus == null">
|
|
|
|
+ and t1.order_status != 0
|
|
|
|
+ </if>
|
|
|
|
+ <if test="order.orderTypeId != null">
|
|
|
|
+ and t1.order_type_id = #{plan.orderTypeId,jdbcType=INTEGER}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="order.eventType != null">
|
|
|
|
+ and t1.event_type = #{order.eventType,jdbcType=INTEGER}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="order.currentUsers != null">
|
|
|
|
+ and INSTR(t1.current_users,#{plan.currentUsers})
|
|
|
|
+ </if>
|
|
|
|
+ <if test="order.startDate != null and order.endDate != null">
|
|
|
|
+ and t1.date_create >= date_format(#{order.startDate,jdbcType=VARCHAR},'%Y-%c-%d')
|
|
|
|
+ and t1.date_create <= DATE_ADD(date_format(#{order.endDate,jdbcType=VARCHAR},'%Y-%c-%d'),INTERVAL 1 DAY)
|
|
|
|
+ </if>
|
|
|
|
+ </where>
|
|
|
|
+ order by t1.date_create
|
|
|
|
+ </select>
|
|
</mapper>
|
|
</mapper>
|