兴安访客小程序访客改造
This commit is contained in:
@@ -40,6 +40,10 @@
|
||||
<result property="visitingUnit" column="visiting_unit"/>
|
||||
<result property="reviewer2" column="reviewer2"/>
|
||||
<result property="reviewer3" column="reviewer3"/>
|
||||
<result property="examineState" column="examine_state"/>
|
||||
<result property="park" column="park"/>
|
||||
<result property="visitorType" column="visitor_type"/>
|
||||
<result property="currentNode" column="current_node"/>
|
||||
<association property="branch" column="dept_id" javaType="SysBranch" resultMap="branchResult"/>
|
||||
<association property="people" column="user_id" javaType="SysPeople" resultMap="peopleResult"/>
|
||||
<association property="examine" column="id" javaType="VisVisitorExamine" resultMap="examineResult"/>
|
||||
@@ -105,7 +109,11 @@
|
||||
vv.position visitorPosition,
|
||||
vv.visiting_unit,
|
||||
vv.reviewer2,
|
||||
vv.reviewer3
|
||||
vv.reviewer3,
|
||||
vv.current_node,
|
||||
vv.examine_state,
|
||||
vv.visitor_type,
|
||||
vv.park
|
||||
from vis_visitor vv
|
||||
left join vis_visitor_examine vve on vv.id = vve.visitor_id
|
||||
left join sys_branch sb on vv.dept_id = sb.id
|
||||
@@ -198,7 +206,11 @@
|
||||
vv1.position visitorPosition,
|
||||
vv1.visiting_unit visitingUnit,
|
||||
vv1.reviewer2,
|
||||
vv1.reviewer3
|
||||
vv1.reviewer3,
|
||||
vv1.examine_state,
|
||||
vv1.visitor_type,
|
||||
vv1.current_node,
|
||||
vv1.park
|
||||
from vis_visitor_review_process vvrp
|
||||
left join vis_visitor vv1 on vv1.id = vvrp.visitor_id
|
||||
left join sys_people s on vvrp.reviewer = s.id
|
||||
@@ -291,6 +303,7 @@
|
||||
<if test="visitorType != null">visitor_type,</if>
|
||||
<if test="park != null">park,</if>
|
||||
<if test="userName != null">user_name,</if>
|
||||
<if test="currentNode != null">current_node,</if>
|
||||
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
@@ -327,6 +340,7 @@
|
||||
<if test="visitorType != null">#{visitorType},</if>
|
||||
<if test="park != null">#{park},</if>
|
||||
<if test="userName != null">#{userName},</if>
|
||||
<if test="currentNode != null">#{currentNode},</if>
|
||||
|
||||
</trim>
|
||||
</insert>
|
||||
@@ -355,8 +369,22 @@
|
||||
</foreach>
|
||||
</insert>
|
||||
<insert id="saveVisitorReviewProcess">
|
||||
insert into vis_visitor_review_process (id, visitor_id, reviewer, type)
|
||||
VALUES (REPLACE(uuid(), '-', ''), #{id}, #{reviewer}, #{type})
|
||||
insert into vis_visitor_review_process (id, visitor_id, reviewer, type
|
||||
<if test="state != null and state != ''">
|
||||
,state
|
||||
</if>
|
||||
)
|
||||
VALUES (REPLACE(uuid(), '-', ''), #{id}, #{reviewer}, #{type}
|
||||
<if test="state != null and state != ''">
|
||||
,#{state}
|
||||
</if>)
|
||||
</insert>
|
||||
<insert id="saveVisitorReviewProcessList">
|
||||
insert into vis_visitor_review_process (id, visitor_id, reviewer, state)
|
||||
VALUES
|
||||
<foreach collection="list" item="i" index="index" separator=",">
|
||||
(REPLACE(uuid(), '-', ''), #{i.id}, #{i.reviewer}, #{i.state})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<update id="updateVisitor" parameterType="Visitor">
|
||||
@@ -394,6 +422,8 @@
|
||||
<if test="visitorPosition != null">position = #{visitorPosition},</if>
|
||||
<if test="reviewer2 != null">reviewer2 = #{reviewer2},</if>
|
||||
<if test="reviewer3 != null">reviewer3 = #{reviewer3},</if>
|
||||
<if test="examineState != null">examine_state = #{examineState},</if>
|
||||
<if test="currentNode != null">current_node = #{currentNode},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
@@ -477,6 +507,7 @@
|
||||
<if test="idCardAddress != null">id_card_address = #{idCardAddress},</if>
|
||||
<if test="visitingUnit != null">visiting_unit = #{visitingUnit},</if>
|
||||
<if test="userName != null">user_name = #{userName},</if>
|
||||
<if test="currentNode != null">current_node = #{currentNode},</if>
|
||||
</trim>
|
||||
where idcard = #{idcard} and out_time is null
|
||||
</update>
|
||||
@@ -488,6 +519,46 @@
|
||||
and reviewer = #{reviewer}
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateVisitorByParentId">
|
||||
update vis_visitor
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="name != null and name != ''">name = #{name},</if>
|
||||
<if test="phone != null">phone = #{phone},</if>
|
||||
<if test="sex != null">sex = #{sex},</if>
|
||||
<if test="avatar != null">avatar = #{avatar},</if>
|
||||
<if test="idcard != null">idcard = #{idcard},</if>
|
||||
<if test="carNo != null">car_no = #{carNo},</if>
|
||||
<if test="userId != null">user_id = #{userId},</if>
|
||||
<if test="deptId != null">dept_id = #{deptId},</if>
|
||||
<if test="flag != null">flag = #{flag},</if>
|
||||
<if test="startTime != null">start_time = #{startTime},</if>
|
||||
<if test="endTime != null">end_time = #{endTime},</if>
|
||||
<if test="matter != null">matter = #{matter},</if>
|
||||
<if test="res != null">res = #{res},</if>
|
||||
<if test="guid != null">guid = #{guid},</if>
|
||||
<if test="faceGuid != null">face_guid = #{faceGuid},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="parentId != null">parent_id = #{parentId},</if>
|
||||
<if test="inTime != null">in_time = #{inTime},</if>
|
||||
<if test="outTime != null">out_time = #{outTime},</if>
|
||||
<if test="type != null">type = #{type},</if>
|
||||
<if test="idCardStartTime != null">id_card_start_time = #{idCardStartTime},</if>
|
||||
<if test="idCardEndTime != null">id_card_end_time = #{idCardEndTime},</if>
|
||||
<if test="idCardAddress != null">id_card_address = #{idCardAddress},</if>
|
||||
<if test="visitingUnit != null">visiting_unit = #{visitingUnit},</if>
|
||||
<if test="userName != null">user_name = #{userName},</if>
|
||||
<if test="visitorPosition != null">position = #{visitorPosition},</if>
|
||||
<if test="reviewer2 != null">reviewer2 = #{reviewer2},</if>
|
||||
<if test="reviewer3 != null">reviewer3 = #{reviewer3},</if>
|
||||
<if test="examineState != null">examine_state = #{examineState},</if>
|
||||
<if test="currentNode != null">current_node = #{currentNode},</if>
|
||||
</trim>
|
||||
where parent_id = #{parentId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteVisitorById" parameterType="Long">
|
||||
delete
|
||||
@@ -794,8 +865,18 @@
|
||||
order by vvar.created_time desc
|
||||
limit 1
|
||||
</select>
|
||||
<select id="queryReviewProcess" resultType="java.lang.String">
|
||||
select reviewer from vis_visitor_review_process where visitor_id = #{id} and type = #{position}
|
||||
<select id="queryReviewProcess" resultType="com.dcsoft.system.visitor.domain.Visitor">
|
||||
select
|
||||
reviewer,
|
||||
state
|
||||
from vis_visitor_review_process
|
||||
where visitor_id = #{id}
|
||||
<if test="position != null and position != ''">
|
||||
and type = #{position}
|
||||
</if>
|
||||
<if test="reviewer != null and reviewer != ''">
|
||||
and reviewer = #{reviewer}
|
||||
</if>
|
||||
</select>
|
||||
<select id="queryVisitorReviewProcessCount" resultType="java.lang.Integer">
|
||||
select sum(if(state is null, 1, 0)) state from vis_visitor_review_process where visitor_id = #{id} group by visitor_id
|
||||
@@ -805,21 +886,11 @@
|
||||
select reviewer,
|
||||
state,
|
||||
sp.position type,
|
||||
date_format(updated_time, '%Y-%m-%d %H:%i:%s') createdTime,
|
||||
date_format(created_time, '%Y-%m-%d %H:%i:%s') createdTime,
|
||||
sp.name reviewerName
|
||||
from vis_visitor_review_process vvrp
|
||||
left join sys_people sp on vvrp.reviewer = sp.id and sp.del_flag = '0'
|
||||
where visitor_id = #{id}
|
||||
union all
|
||||
select reviewer,
|
||||
state,
|
||||
sp.position type,
|
||||
date_format(created_time, '%Y-%m-%d %H:%i:%s') createdTime,
|
||||
sp.name reviewerName
|
||||
from vis_visitor_audit_records vvar
|
||||
left join sys_people sp on vvar.reviewer = sp.id and sp.del_flag = '0'
|
||||
left join vis_visitor vv on vvar.visitor_id = vv.id
|
||||
where visitor_id = #{id} and vvar.reviewer = vv.user_id
|
||||
order by ifnull(createdTime, 'zzz')
|
||||
</select>
|
||||
|
||||
@@ -828,16 +899,13 @@
|
||||
vv.parent_id
|
||||
from vis_visitor vv left join vis_visitor vv1 on vv.parent_id = vv1.id
|
||||
where vv.parent_id is not null
|
||||
<choose>
|
||||
<when test="examineState != null and examineState == 3">
|
||||
and vv1.examine_state = '0'
|
||||
</when>
|
||||
<when test="examineState != null and examineState != 3">
|
||||
and vv1.examine_state = #{examineState}
|
||||
</when>
|
||||
</choose>
|
||||
and vv.phone = #{createBy}
|
||||
and vv1.park = #{park}
|
||||
<if test="examineState != null and examineState != 3">
|
||||
and vv1.examine_state = #{examineState}
|
||||
</if>
|
||||
<if test="park != null and park != ''">
|
||||
and vv1.park = #{park}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
@@ -881,14 +949,9 @@
|
||||
vv.visiting_unit,
|
||||
vv.reviewer2,
|
||||
vv.reviewer3,
|
||||
vv.instance_id,
|
||||
vv.examine_state,
|
||||
vv.visitor_type,
|
||||
vv.park,
|
||||
vv.current_node,
|
||||
vv.user_task_count,
|
||||
vv.procdef_id,
|
||||
vv.proc_id
|
||||
vv.park
|
||||
from vis_visitor vv
|
||||
left join vis_visitor_examine vve on vv.id = vve.visitor_id
|
||||
left join sys_branch sb on vv.dept_id = sb.id
|
||||
@@ -924,4 +987,15 @@
|
||||
</foreach>
|
||||
and vv.examine_state = 0
|
||||
</select>
|
||||
<select id="selectRecordsByPhone" resultType="java.lang.String">
|
||||
SELECT
|
||||
r.state
|
||||
FROM
|
||||
`vis_visitor_audit_records` r
|
||||
LEFT JOIN sys_people p ON r.reviewer = p.id
|
||||
WHERE
|
||||
r.visitor_id = #{id}
|
||||
AND p.phone = #{telephone}
|
||||
ORDER BY r.created_time desc LIMIT 1
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user