|
|
|
<?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.os.mes.base.mapper.BaseTeamMembersMapper">
|
|
|
|
|
|
|
|
<resultMap type="BaseTeamMembers" id="BaseTeamMembersResult">
|
|
|
|
<result property="objId" column="obj_id"/>
|
|
|
|
<result property="teamCode" column="team_code"/>
|
|
|
|
<result property="teamName" column="team_name"/>
|
|
|
|
<result property="teamHead" column="team_head"/>
|
|
|
|
<result property="stationCode" column="station_code"/>
|
|
|
|
<result property="stationName" column="station_name"/>
|
|
|
|
<result property="classes" column="classes"/>
|
|
|
|
<result property="startTime" column="start_time"/>
|
|
|
|
<result property="endTime" column="end_time"/>
|
|
|
|
<result property="dineTime" column="dine_time"/>
|
|
|
|
<result property="isFlag" column="is_flag"/>
|
|
|
|
<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="machineCode" column="machine_code"/>
|
|
|
|
<result property="machineName" column="machine_name"/>
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
<sql id="selectBaseTeamMembersVo">
|
|
|
|
select btm.obj_id,
|
|
|
|
btm.team_code,
|
|
|
|
btm.team_name,
|
|
|
|
btm.team_head,
|
|
|
|
btm.station_code,
|
|
|
|
bpl.product_line_name station_name,
|
|
|
|
btm.classes,
|
|
|
|
btm.start_time,
|
|
|
|
btm.end_time,
|
|
|
|
btm.dine_time,
|
|
|
|
btm.is_flag,
|
|
|
|
btm.create_by,
|
|
|
|
btm.create_time,
|
|
|
|
btm.update_by,
|
|
|
|
btm.update_time,
|
|
|
|
btm.machine_code,
|
|
|
|
bdl.device_name machine_name
|
|
|
|
from base_team_members btm
|
|
|
|
left join base_product_line bpl on bpl.product_line_code = btm.station_code
|
|
|
|
left join base_device_ledger bdl on bdl.device_code = btm.machine_code
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
<select id="selectBaseTeamMembersList" parameterType="BaseTeamMembers" resultMap="BaseTeamMembersResult">
|
|
|
|
<include refid="selectBaseTeamMembersVo"/>
|
|
|
|
<where>
|
|
|
|
<if test="teamCode != null and teamCode != ''">and btm.team_code = #{teamCode}</if>
|
|
|
|
<if test="teamName != null and teamName != ''">and btm.team_name like concat('%', #{teamName}, '%')</if>
|
|
|
|
<if test="teamHead != null and teamHead != ''">and btm.team_head = #{teamHead}</if>
|
|
|
|
<if test="stationCode != null and stationCode != ''">and btm.station_code = #{stationCode}</if>
|
|
|
|
<if test="classes != null and classes != ''">and btm.classes = #{classes}</if>
|
|
|
|
<if test="startTime != null and startTime != ''">and btm.start_time = #{startTime}</if>
|
|
|
|
<if test="endTime != null and endTime != ''">and btm.end_time = #{endTime}</if>
|
|
|
|
<if test="dineTime != null and dineTime != ''">and btm.dine_time = #{dineTime}</if>
|
|
|
|
<if test="isFlag != null and isFlag != ''">and btm.is_flag = #{isFlag}</if>
|
|
|
|
<if test="machineCode != null and machineCode != ''">and btm.machine_code = #{machineCode}</if>
|
|
|
|
</where>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<select id="selectBaseTeamMembersByObjId" parameterType="Long" resultMap="BaseTeamMembersResult">
|
|
|
|
<include refid="selectBaseTeamMembersVo"/>
|
|
|
|
where btm.obj_id = #{objId}
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<insert id="insertBaseTeamMembers" parameterType="BaseTeamMembers" useGeneratedKeys="true" keyProperty="objId">
|
|
|
|
insert into base_team_members
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="teamCode != null">team_code,</if>
|
|
|
|
<if test="teamName != null">team_name,</if>
|
|
|
|
<if test="teamHead != null">team_head,</if>
|
|
|
|
<if test="stationCode != null">station_code,</if>
|
|
|
|
<if test="classes != null">classes,</if>
|
|
|
|
<if test="startTime != null">start_time,</if>
|
|
|
|
<if test="endTime != null">end_time,</if>
|
|
|
|
<if test="dineTime != null">dine_time,</if>
|
|
|
|
<if test="isFlag != null">is_flag,</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="machineCode != null">machine_code,</if>
|
|
|
|
</trim>
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="teamCode != null">#{teamCode},</if>
|
|
|
|
<if test="teamName != null">#{teamName},</if>
|
|
|
|
<if test="teamHead != null">#{teamHead},</if>
|
|
|
|
<if test="stationCode != null">#{stationCode},</if>
|
|
|
|
<if test="classes != null">#{classes},</if>
|
|
|
|
<if test="startTime != null">#{startTime},</if>
|
|
|
|
<if test="endTime != null">#{endTime},</if>
|
|
|
|
<if test="dineTime != null">#{dineTime},</if>
|
|
|
|
<if test="isFlag != null">#{isFlag},</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="machineCode != null">#{machineCode},</if>
|
|
|
|
</trim>
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
<update id="updateBaseTeamMembers" parameterType="BaseTeamMembers">
|
|
|
|
update base_team_members
|
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
|
<if test="teamCode != null">team_code = #{teamCode},</if>
|
|
|
|
<if test="teamName != null">team_name = #{teamName},</if>
|
|
|
|
<if test="teamHead != null">team_head = #{teamHead},</if>
|
|
|
|
<if test="stationCode != null">station_code = #{stationCode},</if>
|
|
|
|
<if test="classes != null">classes = #{classes},</if>
|
|
|
|
<if test="startTime != null">start_time = #{startTime},</if>
|
|
|
|
<if test="endTime != null">end_time = #{endTime},</if>
|
|
|
|
<if test="dineTime != null">dine_time = #{dineTime},</if>
|
|
|
|
<if test="isFlag != null">is_flag = #{isFlag},</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="machineCode != null">machine_code = #{machineCode},</if>
|
|
|
|
</trim>
|
|
|
|
where obj_id = #{objId}
|
|
|
|
</update>
|
|
|
|
|
|
|
|
<delete id="deleteBaseTeamMembersByObjId" parameterType="Long">
|
|
|
|
delete
|
|
|
|
from base_team_members
|
|
|
|
where obj_id = #{objId}
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
<delete id="deleteBaseTeamMembersByObjIds" parameterType="String">
|
|
|
|
delete from base_team_members where obj_id in
|
|
|
|
<foreach item="objId" collection="array" open="(" separator="," close=")">
|
|
|
|
#{objId}
|
|
|
|
</foreach>
|
|
|
|
</delete>
|
|
|
|
</mapper>
|