|
|
|
<?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.op.device.mapper.EquTeamMapper">
|
|
|
|
|
|
|
|
<resultMap type="EquTeam" id="EquTeamResult">
|
|
|
|
<result property="id" column="id" />
|
|
|
|
<result property="teamCode" column="team_code" />
|
|
|
|
<result property="teamName" column="team_name" />
|
|
|
|
<result property="teamType" column="team_type" />
|
|
|
|
<result property="teamPerson" column="team_person" />
|
|
|
|
<result property="createBy" column="create_by" />
|
|
|
|
<result property="createTime" column="create_time" />
|
|
|
|
<result property="updateBy" column="update_by" />
|
|
|
|
<result property="updateTime" column="update_time" />
|
|
|
|
<result property="delFlag" column="del_flag" />
|
|
|
|
<result property="factoryCode" column="factory_code" />
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
<sql id="selectEquTeamVo">
|
|
|
|
select id, team_code, team_name, team_type, team_person, create_by, create_time, update_by, update_time, del_flag, factory_code from equ_team
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
<select id="selectEquTeamList" parameterType="EquTeam" resultMap="EquTeamResult">
|
|
|
|
<include refid="selectEquTeamVo"/>
|
|
|
|
<where>
|
|
|
|
<if test="teamCode != null and teamCode != ''"> and team_code like concat('%', #{teamCode}, '%')</if>
|
|
|
|
<if test="teamName != null and teamName != ''"> and team_name like concat('%', #{teamName}, '%')</if>
|
|
|
|
<if test="teamType != null and teamType != ''"> and team_type = #{teamType}</if>
|
|
|
|
<if test="teamPerson != null and teamPerson != ''"> and team_person = #{teamPerson}</if>
|
|
|
|
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
|
|
|
|
and del_flag = '0'
|
|
|
|
</where>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<select id="selectEquTeamById" parameterType="String" resultMap="EquTeamResult">
|
|
|
|
<include refid="selectEquTeamVo"/>
|
|
|
|
where id = #{id}
|
|
|
|
and del_flag = '0'
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<insert id="insertEquTeam" parameterType="EquTeam">
|
|
|
|
insert into equ_team
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="id != null">id,</if>
|
|
|
|
<if test="teamCode != null">team_code,</if>
|
|
|
|
<if test="teamName != null">team_name,</if>
|
|
|
|
<if test="teamType != null">team_type,</if>
|
|
|
|
<if test="teamPerson != null">team_person,</if>
|
|
|
|
<if test="createBy != null">create_by,</if>
|
|
|
|
<if test="createTime != null">create_time,</if>
|
|
|
|
<if test="updateBy != null">update_by,</if>
|
|
|
|
<if test="updateTime != null">update_time,</if>
|
|
|
|
<if test="delFlag != null">del_flag,</if>
|
|
|
|
<if test="factoryCode != null">factory_code,</if>
|
|
|
|
</trim>
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="id != null">#{id},</if>
|
|
|
|
<if test="teamCode != null">#{teamCode},</if>
|
|
|
|
<if test="teamName != null">#{teamName},</if>
|
|
|
|
<if test="teamType != null">#{teamType},</if>
|
|
|
|
<if test="teamPerson != null">#{teamPerson},</if>
|
|
|
|
<if test="createBy != null">#{createBy},</if>
|
|
|
|
<if test="createTime != null">#{createTime},</if>
|
|
|
|
<if test="updateBy != null">#{updateBy},</if>
|
|
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
|
|
<if test="delFlag != null">#{delFlag},</if>
|
|
|
|
<if test="factoryCode != null">#{factoryCode},</if>
|
|
|
|
</trim>
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
<update id="updateEquTeam" parameterType="EquTeam">
|
|
|
|
update equ_team
|
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
|
<if test="teamCode != null">team_code = #{teamCode},</if>
|
|
|
|
<if test="teamName != null">team_name = #{teamName},</if>
|
|
|
|
<if test="teamType != null">team_type = #{teamType},</if>
|
|
|
|
<if test="teamPerson != null">team_person = #{teamPerson},</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="delFlag != null">del_flag = #{delFlag},</if>
|
|
|
|
<if test="factoryCode != null">factory_code = #{factoryCode},</if>
|
|
|
|
</trim>
|
|
|
|
where id = #{id}
|
|
|
|
and del_flag = '0'
|
|
|
|
</update>
|
|
|
|
|
|
|
|
<delete id="deleteEquTeamById" parameterType="String">
|
|
|
|
update equ_team
|
|
|
|
set del_flag = '1'
|
|
|
|
where id = #{id}
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
<delete id="deleteEquTeamByIds" parameterType="String">
|
|
|
|
update equ_team
|
|
|
|
set del_flag = '1'
|
|
|
|
where id in
|
|
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
|
#{id}
|
|
|
|
</foreach>
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
<select id="getMaintenanceTeamList" parameterType="EquTeam" resultMap="EquTeamResult">
|
|
|
|
<include refid="selectEquTeamVo"/>
|
|
|
|
where del_flag = '0'
|
|
|
|
and team_type = '维修班组'
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<select id="getMaintenancePerson" parameterType="EquTeam" resultType="com.op.device.domain.EquTeamUser">
|
|
|
|
select
|
|
|
|
user_id AS userId,
|
|
|
|
user_name AS userName,
|
|
|
|
nick_name AS nickName,
|
|
|
|
CONCAT(nick_name,user_name) AS teamUserName
|
|
|
|
from sys_user
|
|
|
|
where del_flag = '0'
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<select id="selectTeamMembers" parameterType="EquTeamUser" resultType="com.op.device.domain.EquTeamUser">
|
|
|
|
select
|
|
|
|
user_id AS userId,
|
|
|
|
user_name AS userName,
|
|
|
|
nick_name AS nickName,
|
|
|
|
CONCAT(nick_name,user_name) AS teamUserName
|
|
|
|
from sys_user
|
|
|
|
where del_flag = '0'
|
|
|
|
</select>
|
|
|
|
|
|
|
|
</mapper>
|