From 77d7257c02fc811a53b8d9207e4239f69c8a600c Mon Sep 17 00:00:00 2001 From: liusheng <337615773@qq.com> Date: 星期四, 15 六月 2023 14:33:36 +0800 Subject: [PATCH] 题目和标签代码提交 --- smartor/src/main/resources/mapper/smartor/BaseTagMapper.xml | 78 +++++++++++++++++++++++--------------- 1 files changed, 47 insertions(+), 31 deletions(-) diff --git a/smartor/src/main/resources/mapper/smartor/BaseTagMapper.xml b/smartor/src/main/resources/mapper/smartor/BaseTagMapper.xml index f966209..e305fb2 100644 --- a/smartor/src/main/resources/mapper/smartor/BaseTagMapper.xml +++ b/smartor/src/main/resources/mapper/smartor/BaseTagMapper.xml @@ -1,47 +1,60 @@ <?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=","> @@ -57,7 +70,7 @@ <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> @@ -71,7 +84,7 @@ <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"> @@ -94,13 +107,16 @@ </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> \ No newline at end of file -- Gitblit v1.9.3