|
@@ -1,55 +1,75 @@
|
|
|
<?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.doc.biz.mapper.DocFavoriteLabelMapper">
|
|
|
-
|
|
|
+
|
|
|
<resultMap type="DocFavoriteLabel" id="DocFavoriteLabelResult">
|
|
|
- <result property="labelId" column="LABEL_ID" />
|
|
|
- <result property="labelName" column="LABEL_NAME" />
|
|
|
- <result property="owner" column="OWNER" />
|
|
|
- <result property="createBy" column="CREATE_BY" />
|
|
|
- <result property="createTime" column="CREATE_TIME" />
|
|
|
- <result property="updateBy" column="UPDATE_BY" />
|
|
|
- <result property="updateTime" column="UPDATE_TIME" />
|
|
|
- <result property="remark" column="REMARK" />
|
|
|
+ <result property="labelId" column="LABEL_ID"/>
|
|
|
+ <result property="labelName" column="LABEL_NAME"/>
|
|
|
+ <result property="owner" column="OWNER"/>
|
|
|
+ <result property="orderNum" column="ORDER_NUM"/>
|
|
|
+ <result property="createBy" column="CREATE_BY"/>
|
|
|
+ <result property="createTime" column="CREATE_TIME"/>
|
|
|
+ <result property="updateBy" column="UPDATE_BY"/>
|
|
|
+ <result property="updateTime" column="UPDATE_TIME"/>
|
|
|
+ <result property="remark" column="REMARK"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectDocFavoriteLabelVo">
|
|
|
- select LABEL_ID, LABEL_NAME, OWNER, CREATE_BY, CREATE_TIME, UPDATE_BY, UPDATE_TIME, REMARK from doc_favorite_label
|
|
|
+ select LABEL_ID,
|
|
|
+ LABEL_NAME,
|
|
|
+ OWNER,
|
|
|
+ ORDER_NUM,
|
|
|
+ CREATE_BY,
|
|
|
+ CREATE_TIME,
|
|
|
+ UPDATE_BY,
|
|
|
+ UPDATE_TIME,
|
|
|
+ REMARK
|
|
|
+ from doc_favorite_label
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectDocFavoriteLabelList" parameterType="DocFavoriteLabel" resultMap="DocFavoriteLabelResult">
|
|
|
<include refid="selectDocFavoriteLabelVo"/>
|
|
|
- <where>
|
|
|
+ <where>
|
|
|
+ <if test="labelName != null and labelName != ''">and LABEL_NAME like concat('%', #{labelName}, '%')</if>
|
|
|
+ <if test="owner != null ">and OWNER = #{owner}</if>
|
|
|
+ <if test="orderNum != null ">and ORDER_NUM = #{orderNum}</if>
|
|
|
+ <if test="createBy != null and createBy != ''">and CREATE_BY = #{createBy}</if>
|
|
|
+ <if test="createTime != null ">and CREATE_TIME = #{createTime}</if>
|
|
|
+ <if test="updateBy != null and updateBy != ''">and UPDATE_BY = #{updateBy}</if>
|
|
|
+ <if test="updateTime != null ">and UPDATE_TIME = #{updateTime}</if>
|
|
|
+ <if test="remark != null and remark != ''">and REMARK = #{remark}</if>
|
|
|
</where>
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<select id="selectDocFavoriteLabelByLabelId" parameterType="Long" resultMap="DocFavoriteLabelResult">
|
|
|
<include refid="selectDocFavoriteLabelVo"/>
|
|
|
where LABEL_ID = #{labelId}
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<insert id="insertDocFavoriteLabel" parameterType="DocFavoriteLabel" useGeneratedKeys="true" keyProperty="labelId">
|
|
|
insert into doc_favorite_label
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
<if test="labelName != null">LABEL_NAME,</if>
|
|
|
<if test="owner != null">OWNER,</if>
|
|
|
+ <if test="orderNum != null">ORDER_NUM,</if>
|
|
|
<if test="createBy != null">CREATE_BY,</if>
|
|
|
<if test="createTime != null">CREATE_TIME,</if>
|
|
|
<if test="updateBy != null">UPDATE_BY,</if>
|
|
|
<if test="updateTime != null">UPDATE_TIME,</if>
|
|
|
<if test="remark != null">REMARK,</if>
|
|
|
- </trim>
|
|
|
+ </trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="labelName != null">#{labelName},</if>
|
|
|
<if test="owner != null">#{owner},</if>
|
|
|
+ <if test="orderNum != null">#{orderNum},</if>
|
|
|
<if test="createBy != null">#{createBy},</if>
|
|
|
<if test="createTime != null">#{createTime},</if>
|
|
|
<if test="updateBy != null">#{updateBy},</if>
|
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
|
<if test="remark != null">#{remark},</if>
|
|
|
- </trim>
|
|
|
+ </trim>
|
|
|
</insert>
|
|
|
|
|
|
<update id="updateDocFavoriteLabel" parameterType="DocFavoriteLabel">
|
|
@@ -57,6 +77,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
<if test="labelName != null">LABEL_NAME = #{labelName},</if>
|
|
|
<if test="owner != null">OWNER = #{owner},</if>
|
|
|
+ <if test="orderNum != null">ORDER_NUM = #{orderNum},</if>
|
|
|
<if test="createBy != null">CREATE_BY = #{createBy},</if>
|
|
|
<if test="createTime != null">CREATE_TIME = #{createTime},</if>
|
|
|
<if test="updateBy != null">UPDATE_BY = #{updateBy},</if>
|
|
@@ -67,11 +88,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</update>
|
|
|
|
|
|
<delete id="deleteDocFavoriteLabelByLabelId" parameterType="Long">
|
|
|
- delete from doc_favorite_label where LABEL_ID = #{labelId}
|
|
|
+ delete
|
|
|
+ from doc_favorite_label
|
|
|
+ where LABEL_ID = #{labelId}
|
|
|
</delete>
|
|
|
|
|
|
<delete id="deleteDocFavoriteLabelByLabelIds" parameterType="String">
|
|
|
- delete from doc_favorite_label where LABEL_ID in
|
|
|
+ delete from doc_favorite_label where LABEL_ID in
|
|
|
<foreach item="labelId" collection="array" open="(" separator="," close=")">
|
|
|
#{labelId}
|
|
|
</foreach>
|