| | |
| | | <?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"> |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.smartor.mapper.BaseTagMapper"> |
| | | |
| | | |
| | | <resultMap type="com.smartor.domain.BaseTag" id="BaseTagResult"> |
| | | <result property="tagid" column="tagid" /> |
| | | <result property="tagcategoryid" column="tagcategoryid" /> |
| | | <result property="tagname" column="tagname" /> |
| | | <result property="tagdescription" column="tagdescription" /> |
| | | <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="isenable" column="isenable" /> |
| | | <result property="tagid" column="tagid"/> |
| | | <result property="tagcategoryid" column="tagcategoryid"/> |
| | | <result property="tagname" column="tagname"/> |
| | | <result property="tagdescription" column="tagdescription"/> |
| | | <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="isenable" column="isenable"/> |
| | | </resultMap> |
| | | |
| | | <sql id="selectBaseTagVo"> |
| | | select tagid, tagcategoryid, tagname, tagdescription, orgid, del_flag, update_by, update_time, create_by, create_time, isupload, upload_time, isenable from base_tag |
| | | select tagid, |
| | | tagcategoryid, |
| | | tagname, |
| | | tagdescription, |
| | | orgid, |
| | | del_flag, |
| | | update_by, |
| | | update_time, |
| | | create_by, |
| | | create_time, |
| | | isupload, |
| | | upload_time, |
| | | isenable |
| | | from base_tag |
| | | </sql> |
| | | |
| | | <select id="selectBaseTagList" parameterType="com.smartor.domain.BaseTag" resultMap="BaseTagResult"> |
| | | <include refid="selectBaseTagVo"/> |
| | | <where> |
| | | <if test="tagcategoryid != null "> and tagcategoryid = #{tagcategoryid}</if> |
| | | <if test="tagname != null and tagname != ''"> and tagname like concat('%', #{tagname}, '%')</if> |
| | | <if test="tagdescription != null and tagdescription != ''"> and tagdescription = #{tagdescription}</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="isenable != null "> and isenable = #{isenable}</if> |
| | | <where> |
| | | <if test="tagcategoryid != null ">and tagcategoryid = #{tagcategoryid}</if> |
| | | <if test="tagname != null and tagname != ''">and tagname like concat('%', #{tagname}, '%')</if> |
| | | <if test="tagdescription != null and tagdescription != ''">and tagdescription = #{tagdescription}</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="isenable != null ">and isenable = #{isenable}</if> |
| | | </where> |
| | | </select> |
| | | |
| | | |
| | | <select id="selectBaseTagByTagid" parameterType="Long" resultMap="BaseTagResult"> |
| | | <include refid="selectBaseTagVo"/> |
| | | where tagid = #{tagid} |
| | | </select> |
| | | |
| | | |
| | | <insert id="insertBaseTag" parameterType="com.smartor.domain.BaseTag" useGeneratedKeys="true" keyProperty="tagid"> |
| | | insert into base_tag |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | |
| | | <if test="isupload != null">isupload,</if> |
| | | <if test="uploadTime != null">upload_time,</if> |
| | | <if test="isenable != null">isenable,</if> |
| | | </trim> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="tagcategoryid != null">#{tagcategoryid},</if> |
| | | <if test="tagname != null">#{tagname},</if> |
| | |
| | | <if test="isupload != null">#{isupload},</if> |
| | | <if test="uploadTime != null">#{uploadTime},</if> |
| | | <if test="isenable != null">#{isenable},</if> |
| | | </trim> |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateBaseTag" parameterType="com.smartor.domain.BaseTag"> |
| | |
| | | </update> |
| | | |
| | | <delete id="deleteBaseTagByTagid" parameterType="Long"> |
| | | delete from base_tag where tagid = #{tagid} |
| | | delete |
| | | from base_tag |
| | | where tagid = #{tagid} |
| | | </delete> |
| | | |
| | | <delete id="deleteBaseTagByTagids" parameterType="String"> |
| | | delete from base_tag where tagid in |
| | | delete from base_tag where tagid in |
| | | <foreach item="tagid" collection="array" open="(" separator="," close=")"> |
| | | #{tagid} |
| | | </foreach> |
| | | </delete> |
| | | |
| | | </mapper> |