You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
114 lines
6.0 KiB
XML
114 lines
6.0 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.aucma.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="productLineCode" column="product_line_code" />
|
|
<result property="productLineName" column="productLineName" />
|
|
<result property="isFlag" column="is_flag" />
|
|
<result property="createdBy" column="created_by" />
|
|
<result property="createdTime" column="created_time" />
|
|
<result property="updatedBy" column="updated_by" />
|
|
<result property="updatedTime" column="updated_time" />
|
|
</resultMap>
|
|
|
|
<sql id="selectBaseTeamMembersVo">
|
|
select tm.obj_id,
|
|
tm.team_code,
|
|
tm.team_name,
|
|
tm.team_head,
|
|
tm.product_line_code,
|
|
bpl.PRODUCT_LINE_NAME productLineName,
|
|
tm.is_flag,
|
|
tm.created_by,
|
|
tm.created_time,
|
|
tm.updated_by,
|
|
tm.updated_time
|
|
from base_teammembers tm
|
|
left join base_productline bpl on bpl.PRODUCT_LINE_CODE = tm.PRODUCT_LINE_CODE
|
|
</sql>
|
|
|
|
<select id="selectBaseTeamMembersList" parameterType="BaseTeamMembers" resultMap="BaseTeamMembersResult">
|
|
<include refid="selectBaseTeamMembersVo"/>
|
|
<where>
|
|
<if test="teamCode != null and teamCode != ''"> and tm.team_code = #{teamCode}</if>
|
|
<if test="teamName != null and teamName != ''"> and tm.team_name like concat(concat('%', #{teamName}), '%')</if>
|
|
<if test="teamHead != null and teamHead != ''"> and tm.team_head = #{teamHead}</if>
|
|
<if test="productLineCode != null and productLineCode != ''"> and tm.product_line_code = #{productLineCode}</if>
|
|
<if test="isFlag != null "> and tm.is_flag = #{isFlag}</if>
|
|
<if test="createdBy != null and createdBy != ''"> and tm.created_by = #{createdBy}</if>
|
|
<if test="createdTime != null "> and tm.created_time = #{createdTime}</if>
|
|
<if test="updatedBy != null and updatedBy != ''"> and tm.updated_by = #{updatedBy}</if>
|
|
<if test="updatedTime != null "> and tm.updated_time = #{updatedTime}</if>
|
|
</where>
|
|
</select>
|
|
|
|
<select id="selectBaseTeamMembersByObjId" parameterType="Long" resultMap="BaseTeamMembersResult">
|
|
<include refid="selectBaseTeamMembersVo"/>
|
|
where tm.obj_id = #{objId}
|
|
</select>
|
|
|
|
<insert id="insertBaseTeamMembers" parameterType="BaseTeamMembers">
|
|
<selectKey keyProperty="objId" resultType="long" order="BEFORE">
|
|
SELECT seq_base_teammembers.NEXTVAL as objId FROM DUAL
|
|
</selectKey>
|
|
insert into base_teammembers
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="objId != null">obj_id,</if>
|
|
<if test="teamCode != null">team_code,</if>
|
|
<if test="teamName != null">team_name,</if>
|
|
<if test="teamHead != null">team_head,</if>
|
|
<if test="productLineCode != null">product_line_code,</if>
|
|
<if test="isFlag != null">is_flag,</if>
|
|
<if test="createdBy != null">created_by,</if>
|
|
<if test="createdTime != null">created_time,</if>
|
|
<if test="updatedBy != null">updated_by,</if>
|
|
<if test="updatedTime != null">updated_time,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="objId != null">#{objId},</if>
|
|
<if test="teamCode != null">#{teamCode},</if>
|
|
<if test="teamName != null">#{teamName},</if>
|
|
<if test="teamHead != null">#{teamHead},</if>
|
|
<if test="productLineCode != null">#{productLineCode},</if>
|
|
<if test="isFlag != null">#{isFlag},</if>
|
|
<if test="createdBy != null">#{createdBy},</if>
|
|
<if test="createdTime != null">#{createdTime},</if>
|
|
<if test="updatedBy != null">#{updatedBy},</if>
|
|
<if test="updatedTime != null">#{updatedTime},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateBaseTeamMembers" parameterType="BaseTeamMembers">
|
|
update base_teammembers
|
|
<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="productLineCode != null">product_line_code = #{productLineCode},</if>
|
|
<if test="isFlag != null">is_flag = #{isFlag},</if>
|
|
<if test="createdBy != null">created_by = #{createdBy},</if>
|
|
<if test="createdTime != null">created_time = #{createdTime},</if>
|
|
<if test="updatedBy != null">updated_by = #{updatedBy},</if>
|
|
<if test="updatedTime != null">updated_time = #{updatedTime},</if>
|
|
</trim>
|
|
where obj_id = #{objId}
|
|
</update>
|
|
|
|
<delete id="deleteBaseTeamMembersByObjId" parameterType="Long">
|
|
delete from base_teammembers where obj_id = #{objId}
|
|
</delete>
|
|
|
|
<delete id="deleteBaseTeamMembersByObjIds" parameterType="String">
|
|
delete from base_teammembers where obj_id in
|
|
<foreach item="objId" collection="array" open="(" separator="," close=")">
|
|
#{objId}
|
|
</foreach>
|
|
</delete>
|
|
</mapper> |