56 lines
2.7 KiB
XML
56 lines
2.7 KiB
XML
|
|
<?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>
|