<?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.smartor.mapper.HeLibraryTagMapper"> 
 | 
  
 | 
    <resultMap type="com.smartor.domain.HeLibraryTag" id="HeLibraryTagResult"> 
 | 
        <result property="id" column="id"/> 
 | 
        <result property="tagcategoryid" column="tagcategoryid"/> 
 | 
        <result property="tagid" column="tagid"/> 
 | 
        <result property="orgid" column="orgid"/> 
 | 
        <result property="delFlag" column="del_flag"/> 
 | 
        <result property="updateBy" column="update_by"/> 
 | 
        <result property="updateTime" column="update_time"/> 
 | 
        <result property="createBy" column="create_by"/> 
 | 
        <result property="createTime" column="create_time"/> 
 | 
        <result property="isupload" column="isupload"/> 
 | 
        <result property="uploadTime" column="upload_time"/> 
 | 
        <result property="heid" column="heid"/> 
 | 
        <result property="pid" column="pid"/> 
 | 
        <result property="guid" column="guid"/> 
 | 
        <result property="tagname" column="tagname"/> 
 | 
    </resultMap> 
 | 
  
 | 
    <sql id="selectHeLibraryTagVo"> 
 | 
        select id, 
 | 
               tagcategoryid, 
 | 
               tagid, 
 | 
               orgid, 
 | 
               del_flag, 
 | 
               update_by, 
 | 
               update_time, 
 | 
               create_by, 
 | 
               create_time, 
 | 
               isupload, 
 | 
               upload_time, 
 | 
               heid, 
 | 
               pid, 
 | 
               guid, 
 | 
               tagname 
 | 
        from he_library_tag 
 | 
    </sql> 
 | 
  
 | 
    <select id="selectHeLibraryTagList" parameterType="com.smartor.domain.HeLibraryTag" resultMap="HeLibraryTagResult"> 
 | 
        <include refid="selectHeLibraryTagVo"/> 
 | 
        <where> 
 | 
            del_flag=0 
 | 
            <if test="tagcategoryid != null ">and tagcategoryid = #{tagcategoryid}</if> 
 | 
            <if test="tagid != null ">and tagid = #{tagid}</if> 
 | 
            <if test="orgid != null  and orgid != ''">and orgid = #{orgid}</if> 
 | 
            <if test="isupload != null ">and isupload = #{isupload}</if> 
 | 
            <if test="uploadTime != null ">and upload_time = #{uploadTime}</if> 
 | 
            <if test="heid != null ">and heid = #{heid}</if> 
 | 
            <if test="pid != null ">and pid = #{pid}</if> 
 | 
            <if test="guid != null  and guid != ''">and guid = #{guid}</if> 
 | 
            <if test="tagname != null  and tagname != ''">and tagname = #{tagname}</if> 
 | 
        </where> 
 | 
    </select> 
 | 
  
 | 
    <select id="selectHeLibraryTagById" parameterType="Long" resultMap="HeLibraryTagResult"> 
 | 
        <include refid="selectHeLibraryTagVo"/> 
 | 
        where id = #{id} 
 | 
    </select> 
 | 
  
 | 
    <insert id="insertHeLibraryTag" parameterType="com.smartor.domain.HeLibraryTag" useGeneratedKeys="true" 
 | 
            keyProperty="id"> 
 | 
        insert into he_library_tag 
 | 
        <trim prefix="(" suffix=")" suffixOverrides=","> 
 | 
            <if test="tagcategoryid != null">tagcategoryid,</if> 
 | 
            <if test="tagid != null">tagid,</if> 
 | 
            <if test="orgid != null">orgid,</if> 
 | 
            <if test="delFlag != null and delFlag != ''">del_flag,</if> 
 | 
            <if test="updateBy != null">update_by,</if> 
 | 
            <if test="updateTime != null">update_time,</if> 
 | 
            <if test="createBy != null">create_by,</if> 
 | 
            <if test="createTime != null">create_time,</if> 
 | 
            <if test="isupload != null">isupload,</if> 
 | 
            <if test="uploadTime != null">upload_time,</if> 
 | 
            <if test="heid != null">heid,</if> 
 | 
            <if test="pid != null">pid,</if> 
 | 
            <if test="guid != null">guid,</if> 
 | 
            <if test="tagname != null">tagname,</if> 
 | 
        </trim> 
 | 
        <trim prefix="values (" suffix=")" suffixOverrides=","> 
 | 
            <if test="tagcategoryid != null">#{tagcategoryid},</if> 
 | 
            <if test="tagid != null">#{tagid},</if> 
 | 
            <if test="orgid != null">#{orgid},</if> 
 | 
            <if test="delFlag != null and delFlag != ''">#{delFlag},</if> 
 | 
            <if test="updateBy != null">#{updateBy},</if> 
 | 
            <if test="updateTime != null">#{updateTime},</if> 
 | 
            <if test="createBy != null">#{createBy},</if> 
 | 
            <if test="createTime != null">#{createTime},</if> 
 | 
            <if test="isupload != null">#{isupload},</if> 
 | 
            <if test="uploadTime != null">#{uploadTime},</if> 
 | 
            <if test="heid != null">#{heid},</if> 
 | 
            <if test="pid != null">#{pid},</if> 
 | 
            <if test="guid != null">#{guid},</if> 
 | 
            <if test="tagname != null">#{tagname},</if> 
 | 
        </trim> 
 | 
    </insert> 
 | 
  
 | 
    <update id="updateHeLibraryTag" parameterType="com.smartor.domain.HeLibraryTag"> 
 | 
        update he_library_tag 
 | 
        <trim prefix="SET" suffixOverrides=","> 
 | 
            <if test="tagcategoryid != null">tagcategoryid = #{tagcategoryid},</if> 
 | 
            <if test="tagid != null">tagid = #{tagid},</if> 
 | 
            <if test="orgid != null">orgid = #{orgid},</if> 
 | 
            <if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if> 
 | 
            <if test="updateBy != null">update_by = #{updateBy},</if> 
 | 
            <if test="updateTime != null">update_time = #{updateTime},</if> 
 | 
            <if test="createBy != null">create_by = #{createBy},</if> 
 | 
            <if test="createTime != null">create_time = #{createTime},</if> 
 | 
            <if test="isupload != null">isupload = #{isupload},</if> 
 | 
            <if test="uploadTime != null">upload_time = #{uploadTime},</if> 
 | 
            <if test="heid != null">heid = #{heid},</if> 
 | 
            <if test="pid != null">pid = #{pid},</if> 
 | 
            <if test="guid != null">guid = #{guid},</if> 
 | 
            <if test="tagname != null">tagname = #{tagname},</if> 
 | 
        </trim> 
 | 
        where id = #{id} 
 | 
    </update> 
 | 
  
 | 
    <update id="deleteHeLibraryTagById" parameterType="Long"> 
 | 
        update he_library_tag 
 | 
        <trim prefix="SET" suffixOverrides=","> 
 | 
            del_flag = 1 
 | 
        </trim> 
 | 
        where id = #{id} 
 | 
    </update> 
 | 
  
 | 
    <delete id="deleteHeLibraryTagByIds" parameterType="String"> 
 | 
        delete from he_library_tag where id in 
 | 
        <foreach item="id" collection="array" open="(" separator="," close=")"> 
 | 
            #{id} 
 | 
        </foreach> 
 | 
    </delete> 
 | 
</mapper> 
 |