|  | @@ -0,0 +1,66 @@
 | 
	
		
			
				|  |  | +<?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.fs.company.mapper.CompanyTagMapper">
 | 
	
		
			
				|  |  | +    
 | 
	
		
			
				|  |  | +    <resultMap type="CompanyTag" id="CompanyTagResult">
 | 
	
		
			
				|  |  | +        <result property="tagId"    column="tag_id"    />
 | 
	
		
			
				|  |  | +        <result property="companyId"    column="company_id"    />
 | 
	
		
			
				|  |  | +        <result property="tag"    column="tag"    />
 | 
	
		
			
				|  |  | +        <result property="createTime"    column="create_time"    />
 | 
	
		
			
				|  |  | +    </resultMap>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    <sql id="selectCompanyTagVo">
 | 
	
		
			
				|  |  | +        select tag_id, company_id, tag, create_time from company_tag
 | 
	
		
			
				|  |  | +    </sql>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    <select id="selectCompanyTagList" parameterType="CompanyTag" resultMap="CompanyTagResult">
 | 
	
		
			
				|  |  | +        <include refid="selectCompanyTagVo"/>
 | 
	
		
			
				|  |  | +        <where>  
 | 
	
		
			
				|  |  | +            <if test="companyId != null "> and company_id = #{companyId}</if>
 | 
	
		
			
				|  |  | +            <if test="tag != null  and tag != ''"> and tag = #{tag}</if>
 | 
	
		
			
				|  |  | +        </where>
 | 
	
		
			
				|  |  | +    </select>
 | 
	
		
			
				|  |  | +    
 | 
	
		
			
				|  |  | +    <select id="selectCompanyTagById" parameterType="Long" resultMap="CompanyTagResult">
 | 
	
		
			
				|  |  | +        <include refid="selectCompanyTagVo"/>
 | 
	
		
			
				|  |  | +        where tag_id = #{tagId}
 | 
	
		
			
				|  |  | +    </select>
 | 
	
		
			
				|  |  | +        
 | 
	
		
			
				|  |  | +    <insert id="insertCompanyTag" parameterType="CompanyTag" useGeneratedKeys="true" keyProperty="tagId">
 | 
	
		
			
				|  |  | +        insert into company_tag
 | 
	
		
			
				|  |  | +        <trim prefix="(" suffix=")" suffixOverrides=",">
 | 
	
		
			
				|  |  | +            <if test="companyId != null">company_id,</if>
 | 
	
		
			
				|  |  | +            <if test="tag != null">tag,</if>
 | 
	
		
			
				|  |  | +            <if test="createTime != null">create_time,</if>
 | 
	
		
			
				|  |  | +         </trim>
 | 
	
		
			
				|  |  | +        <trim prefix="values (" suffix=")" suffixOverrides=",">
 | 
	
		
			
				|  |  | +            <if test="companyId != null">#{companyId},</if>
 | 
	
		
			
				|  |  | +            <if test="tag != null">#{tag},</if>
 | 
	
		
			
				|  |  | +            <if test="createTime != null">#{createTime},</if>
 | 
	
		
			
				|  |  | +         </trim>
 | 
	
		
			
				|  |  | +    </insert>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    <update id="updateCompanyTag" parameterType="CompanyTag">
 | 
	
		
			
				|  |  | +        update company_tag
 | 
	
		
			
				|  |  | +        <trim prefix="SET" suffixOverrides=",">
 | 
	
		
			
				|  |  | +            <if test="companyId != null">company_id = #{companyId},</if>
 | 
	
		
			
				|  |  | +            <if test="tag != null">tag = #{tag},</if>
 | 
	
		
			
				|  |  | +            <if test="createTime != null">create_time = #{createTime},</if>
 | 
	
		
			
				|  |  | +        </trim>
 | 
	
		
			
				|  |  | +        where tag_id = #{tagId}
 | 
	
		
			
				|  |  | +    </update>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    <delete id="deleteCompanyTagById" parameterType="Long">
 | 
	
		
			
				|  |  | +        delete from company_tag where tag_id = #{tagId}
 | 
	
		
			
				|  |  | +    </delete>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    <delete id="deleteCompanyTagByIds" parameterType="String">
 | 
	
		
			
				|  |  | +        delete from company_tag where tag_id in 
 | 
	
		
			
				|  |  | +        <foreach item="tagId" collection="array" open="(" separator="," close=")">
 | 
	
		
			
				|  |  | +            #{tagId}
 | 
	
		
			
				|  |  | +        </foreach>
 | 
	
		
			
				|  |  | +    </delete>
 | 
	
		
			
				|  |  | +    
 | 
	
		
			
				|  |  | +</mapper>
 |