人员管理及班组管理---------jsk
This commit is contained in:
parent
13aca12c30
commit
1bf4daf421
|
|
@ -0,0 +1,152 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||||
|
<mapper namespace="com.securitycontrol.background.humanvehiclemanage.dao.HumanManageMapper">
|
||||||
|
<!--新增/修改 工程-->
|
||||||
|
<insert id="addHuman">
|
||||||
|
INSERT INTO t_team_people
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="teamId != null and teamId != ''">team_id,</if>
|
||||||
|
<if test="userName != null and userName != ''">user_name,</if>
|
||||||
|
<if test="idNumber != null and idNumber!=''">id_number,</if>
|
||||||
|
<if test="phone != null and phone!=''">phone,</if>
|
||||||
|
<if test="proCode != null and proCode!=''">user_type,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="teamId != null and teamId != ''">#{teamId},</if>
|
||||||
|
<if test="userName != null and userName != ''">#{userName},</if>
|
||||||
|
<if test="idNumber != null and idNumber!=''">#{idNumber},</if>
|
||||||
|
<if test="phone != null and phone!=''">#{phone},</if>
|
||||||
|
<if test="userType != null and userType!=''">#{userType},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
<update id="updateHuman">
|
||||||
|
UPDATE t_team_people
|
||||||
|
<set>
|
||||||
|
<if test="teamId != null and teamId != ''">team_id = #{teamId},</if>
|
||||||
|
<if test="userName != null and userName != ''">user_name = #{userName},</if>
|
||||||
|
<if test="idNumber != null and idNumber != ''">id_number = #{idNumber},</if>
|
||||||
|
<if test="phone != null and phone != ''">phone = #{phone},</if>
|
||||||
|
<if test="userType != null and userType != ''">user_type = #{userType},</if>
|
||||||
|
<if test="delFalge != null and delFalge != ''">del_falge = #{delFalge},</if>
|
||||||
|
</set>
|
||||||
|
WHERE user_id= #{userId}
|
||||||
|
</update>
|
||||||
|
<!--获取人员列表-->
|
||||||
|
<select id="getHumanLists" resultType="com.securitycontrol.background.humanvehiclemanage.entity.HumanManageVo">
|
||||||
|
SELECT
|
||||||
|
user_name as userName,
|
||||||
|
id_number as idnumber,
|
||||||
|
phone,
|
||||||
|
user_type as usertype
|
||||||
|
from
|
||||||
|
t_team_people ttp
|
||||||
|
<where>
|
||||||
|
<if test="keyWord !=null and keyWord!=''">
|
||||||
|
AND (
|
||||||
|
INSTR(ttp.user_name,#{keyWord}) > 0 OR
|
||||||
|
INSTR(tp.id_number,#{keyWord}) > 0
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
<!--人员图片-->
|
||||||
|
<select id="getProFiles" resultType="java.lang.Integer">
|
||||||
|
SELECT COUNT(*) FROM tb_resource_file WHERE source_id = #{proId} AND file_type = 1 AND source_type = '工程图片'
|
||||||
|
UNION ALL
|
||||||
|
SELECT COUNT(*) FROM tb_resource_file WHERE source_id = #{proId} AND file_type = 1 AND source_type = '工程平面图'
|
||||||
|
</select>
|
||||||
|
<!--工程详情-->
|
||||||
|
<select id="getProById" resultType="com.securitycontrol.entity.system.base.vo.ProVo">
|
||||||
|
SELECT tp.pro_id AS proId,
|
||||||
|
tp.user_id AS userId,
|
||||||
|
tp.sign_code AS signCode,
|
||||||
|
tp.bid_code AS bidCode,
|
||||||
|
tp.pro_code AS proCode,
|
||||||
|
tp.pro_name AS proName,
|
||||||
|
tp.pro_cost AS proCost,
|
||||||
|
tp.sg_unit AS sgUnit,
|
||||||
|
tp.jl_unit AS jlUnit,
|
||||||
|
tp.pro_type AS proType,
|
||||||
|
tp.pro_scale AS proScale,
|
||||||
|
tp.manager AS manager,
|
||||||
|
tp.pro_brief AS proBrief,
|
||||||
|
tp.now_gx AS nowGx,
|
||||||
|
tp.status,
|
||||||
|
tp.plan_start_time AS planStartTime,
|
||||||
|
tp.plan_end_time AS planEndTime,
|
||||||
|
tp.start_time AS startTime,
|
||||||
|
tp.end_time AS endTime,
|
||||||
|
tp.org
|
||||||
|
FROM tb_project tp
|
||||||
|
WHERE pro_id = #{proId}
|
||||||
|
</select>
|
||||||
|
<!--获取工程图片/平面图-->
|
||||||
|
<select id="getFiles" resultType="com.securitycontrol.entity.system.vo.ResourceFileVo">
|
||||||
|
SELECT id AS resourceId,
|
||||||
|
file_id AS fileId,
|
||||||
|
CASE source_type WHEN '工程图片' THEN '1' WHEN '工程平面图' THEN '2' END AS sourceType
|
||||||
|
FROM tb_resource_file WHERE source_id = #{proId}
|
||||||
|
</select>
|
||||||
|
<!--获取工序列表-->
|
||||||
|
<select id="getGxPlanLists" resultType="com.securitycontrol.entity.system.base.vo.GxPlanVo">
|
||||||
|
SELECT tgp.plan_id AS planId,
|
||||||
|
tgp.gx_weight AS gxWeight,
|
||||||
|
tgp.plan_start_time AS planStartTime,
|
||||||
|
tgp.plan_end_time AS planEndTime,
|
||||||
|
tgp.start_time AS startTime,
|
||||||
|
tgp.end_time AS endTime,
|
||||||
|
tgp.dela_reason AS delaReason,
|
||||||
|
tgp.bid_code AS bidCode,
|
||||||
|
<if test="proType == '变电'">
|
||||||
|
sd.dict_name AS gxName,
|
||||||
|
</if>
|
||||||
|
<if test="proType == '线路'">
|
||||||
|
tpg.gt_name AS gxName,
|
||||||
|
</if>
|
||||||
|
tgp.gx_id AS gxId
|
||||||
|
FROM tb_gx_plan tgp
|
||||||
|
<if test="proType == '变电'">
|
||||||
|
LEFT JOIN sys_dict sd ON sd.dict_code = tgp.gx_id
|
||||||
|
</if>
|
||||||
|
<if test="proType == '线路'">
|
||||||
|
LEFT JOIN t_pro_gt tpg ON tgp.gx_id = tpg.gt_id
|
||||||
|
</if>
|
||||||
|
WHERE tgp.bid_code = #{bidCode}
|
||||||
|
<if test="proType == '变电' and keyWord!='' and keyWord!=null">
|
||||||
|
AND INSTR(sd.dict_name,#{keyWord}) > 0
|
||||||
|
</if>
|
||||||
|
<if test="proType == '线路' and keyWord!='' and keyWord!=null">
|
||||||
|
AND INSTR(tpg.gt_name,#{keyWord}) > 0
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
<!--工序计划详情-->
|
||||||
|
<select id="getGxPlanById" resultType="com.securitycontrol.entity.system.base.vo.GxPlanVo">
|
||||||
|
SELECT tgp.plan_id AS planId,
|
||||||
|
gx_weight AS gxWeight,
|
||||||
|
tgp.plan_start_time AS planStartTime,
|
||||||
|
tgp.plan_end_time AS planEndTime,
|
||||||
|
tgp.start_time AS startTime,
|
||||||
|
tgp.end_time AS endTime,
|
||||||
|
tgp.dela_reason AS delaReason,
|
||||||
|
tgp.bid_code AS bidCode,
|
||||||
|
tgp.gx_id AS gxId
|
||||||
|
FROM tb_gx_plan tgp
|
||||||
|
WHERE tgp.bid_code = #{bidCode} AND tgp.plan_id =#{planId}
|
||||||
|
</select>
|
||||||
|
<!--工程是否包含工序计划-->
|
||||||
|
<select id="isHasGxPlan" resultType="java.lang.Integer">
|
||||||
|
SELECT COUNT(*) FROM tb_gx_plan WHERE bid_code = #{bidCode}
|
||||||
|
</select>
|
||||||
|
<!--当前工序计划是否存在进度填报数据-->
|
||||||
|
<select id="hasGxProgress" resultType="java.lang.Integer">
|
||||||
|
SELECT COUNT(*) FROM tb_project_progress WHERE plan_id = #{planId}
|
||||||
|
</select>
|
||||||
|
<select id="proIsExist" resultType="java.lang.Integer">
|
||||||
|
<if test="proId == null or proId == ''">
|
||||||
|
SELECT COUNT(*) FROM tb_project tp WHERE bid_code = #{bidCode}
|
||||||
|
</if>
|
||||||
|
<if test="proId != null and proId != ''">
|
||||||
|
SELECT COUNT(*) FROM tb_project tp WHERE bid_code = #{bidCode} AND pro_id != #{proId}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
|
|
@ -0,0 +1,56 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||||
|
<mapper namespace="com.securitycontrol.background.humanvehiclemanage.dao.TeamManageMapper">
|
||||||
|
<!--新增/修改 工程-->
|
||||||
|
<insert id="addTeam">
|
||||||
|
INSERT INTO tb_work_team
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="teamName != null and teamName != ''">team_name,</if>
|
||||||
|
<if test="teamLeader != null and teamLeader != ''">team_leader,</if>
|
||||||
|
<if test="bidCode != null and bidCode!=''">bid_code,</if>
|
||||||
|
<if test="teamLeaderPhone != null and teamLeaderPhone!=''">team_leader_phone,</if>
|
||||||
|
<if test="idNumber != null and idNumber!=''">id_number,</if>
|
||||||
|
<if test="proCode != null and proCode!=''">team_num,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="teamName != null and teamName != ''">#{teamName},</if>
|
||||||
|
<if test="teamLeader != null and teamLeader != ''">#{teamLeader},</if>
|
||||||
|
<if test="bidCode != null and bidCode!=''">#{bidCode},</if>
|
||||||
|
<if test="teamLeaderPhone != null and teamLeaderPhone!=''">#{teamLeaderPhone},</if>
|
||||||
|
<if test="idNumber != null and idNumber!=''">#{idNumber},</if>
|
||||||
|
<if test="teamNum != null and teamNum!=''">#{teamNum},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
<update id="updateTeam">
|
||||||
|
UPDATE tb_work_team
|
||||||
|
<set>
|
||||||
|
<if test="teamName != null and teamName != ''">team_name = #{teamName},</if>
|
||||||
|
<if test="teamLeader != null and teamLeader != ''">team_leader = #{teamLeader},</if>
|
||||||
|
<if test="bidCode != null and bidCode != ''">bid_code = #{bidCode},</if>
|
||||||
|
<if test="teamLeaderPhone != null and teamLeaderPhone != ''">team_leader_phone = #{teamLeaderPhone},</if>
|
||||||
|
<if test="idNumber != null and idNumber != ''">id_number = #{idNumber},</if>
|
||||||
|
<if test="teamNum != null and teamNum != ''">team_num = #{teamNum},</if>
|
||||||
|
</set>
|
||||||
|
WHERE team_id= #{teamId}
|
||||||
|
</update>
|
||||||
|
<!--获取人员列表-->
|
||||||
|
<select id="getTeamLists" resultType="com.securitycontrol.background.humanvehiclemanage.entity.TeamManageVo">
|
||||||
|
SELECT
|
||||||
|
team_name as teamname,
|
||||||
|
team_leader as teamleader,
|
||||||
|
team_leader_phone as teamleaderphone,
|
||||||
|
id_number as idnumber,
|
||||||
|
bid_code as bidcode,
|
||||||
|
team_num as teamnum
|
||||||
|
from
|
||||||
|
tb_work_team twt
|
||||||
|
<where>
|
||||||
|
<if test="keyWord !=null and keyWord!=''">
|
||||||
|
AND (
|
||||||
|
INSTR(twt.team_leader,#{keyWord}) > 0 OR
|
||||||
|
INSTR(twt.id_number,#{keyWord}) > 0
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
Loading…
Reference in New Issue