|
@@ -0,0 +1,101 @@
|
|
|
+<?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.ruoyi.system.mapper.DragTableStyleMapper">
|
|
|
+
|
|
|
+ <resultMap type="com.ruoyi.system.entity.DragTableStyle" id="DragTableStyleResult">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="styleName" column="style_name" />
|
|
|
+ <result property="styleCode" column="style_code" />
|
|
|
+ <result property="tableKey" column="table_key" />
|
|
|
+ <result property="styleCondtion" column="style_condtion" />
|
|
|
+ <result property="styleField" column="style_field" />
|
|
|
+ <result property="styleType" column="style_type" />
|
|
|
+ <result property="styleDescription" column="style_description" />
|
|
|
+ <result property="spare1" column="spare1" />
|
|
|
+ <result property="spare2" column="spare2" />
|
|
|
+ <result property="delFlag" column="del_flag" />
|
|
|
+ <result property="createBy" column="create_by" />
|
|
|
+ <result property="createById" column="create_by_id" />
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
+ <result property="updateBy" column="update_by" />
|
|
|
+ <result property="updateById" column="update_by_id" />
|
|
|
+ <result property="updateTime" column="update_time" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectDragTableStyleVo">
|
|
|
+ select id, style_name, style_code, table_key, style_condtion, style_field, style_type, style_description, spare1, spare2, del_flag, create_by, create_by_id, create_time, update_by, update_by_id, update_time from drag_table_style
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectDragTableStyleList" parameterType="com.ruoyi.system.entity.DragTableStyle" resultMap="DragTableStyleResult">
|
|
|
+ <include refid="selectDragTableStyleVo"/>
|
|
|
+ where del_flag = '0'
|
|
|
+ <if test="styleName != null and styleName != ''"> and style_name like concat('%', #{styleName}, '%')</if>
|
|
|
+ <if test="styleCode != null and styleCode != ''"> and style_code = #{styleCode}</if>
|
|
|
+ <if test="tableKey != null and tableKey != ''"> and table_key = #{tableKey}</if>
|
|
|
+ <if test="styleCondtion != null and styleCondtion != ''"> and style_condtion = #{styleCondtion}</if>
|
|
|
+ <if test="styleField != null and styleField != ''"> and style_field = #{styleField}</if>
|
|
|
+ <if test="styleType != null "> and style_type = #{styleType}</if>
|
|
|
+ <if test="styleDescription != null and styleDescription != ''"> and style_description = #{styleDescription}</if>
|
|
|
+ <if test="spare1 != null and spare1 != ''"> and spare1 = #{spare1}</if>
|
|
|
+ <if test="spare2 != null and spare2 != ''"> and spare2 = #{spare2}</if>
|
|
|
+ <if test="createById != null "> and create_by_id = #{createById}</if>
|
|
|
+ <if test="updateById != null "> and update_by_id = #{updateById}</if>
|
|
|
+ order by create_time desc
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectDragTableStyleById" parameterType="Long" resultMap="DragTableStyleResult">
|
|
|
+ <include refid="selectDragTableStyleVo"/>
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="batchInsertDragTableStyle" parameterType="com.ruoyi.system.entity.DragTableStyle">
|
|
|
+ insert into drag_table_style
|
|
|
+ (style_name,style_code,table_key,style_condtion,style_field,style_type,style_description,spare1,spare2,create_by,create_by_id,create_time,del_flag)
|
|
|
+ values
|
|
|
+ <foreach collection="list" item="item" separator=",">
|
|
|
+ (#{item.styleName},#{item.styleCode},#{item.tableKey},#{item.styleCondtion},#{item.styleField},#{item.styleType},
|
|
|
+ #{item.styleDescription},#{item.spare1},#{item.spare2},#{item.createBy},#{item.createById},#{item.createTime},'0')
|
|
|
+ </foreach>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="batchUpdateDragTableStyle" parameterType="com.ruoyi.system.entity.DragTableStyle">
|
|
|
+ <foreach collection="list" item="item" separator=";">
|
|
|
+ update drag_table_style
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="item.styleName != null">style_name = #{item.styleName},</if>
|
|
|
+ <if test="item.styleCode != null">style_code = #{item.styleCode},</if>
|
|
|
+ <if test="item.tableKey != null">table_key = #{item.tableKey},</if>
|
|
|
+ <if test="item.styleCondtion != null and item.styleCondtion != ''">style_condtion = #{item.styleCondtion},</if>
|
|
|
+ <if test="item.styleField != null">style_field = #{item.styleField},</if>
|
|
|
+ <if test="item.styleType != null">style_type = #{item.styleType},</if>
|
|
|
+ <if test="item.styleDescription != null">style_description = #{item.styleDescription},</if>
|
|
|
+ <if test="item.spare1 != null">spare1 = #{item.spare1},</if>
|
|
|
+ <if test="item.spare2 != null">spare2 = #{item.spare2},</if>
|
|
|
+ <if test="item.updateBy != null">update_by = #{item.updateBy},</if>
|
|
|
+ <if test="item.updateById != null">update_by_id = #{item.updateById},</if>
|
|
|
+ <if test="item.updateTime != null">update_time = #{item.updateTime},</if>
|
|
|
+ </trim>
|
|
|
+ where id = #{item.id}
|
|
|
+ </foreach>
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <update id="deleteDragTableStyleByTableKeys" parameterType="String">
|
|
|
+ update drag_table_style set del_flag = '2' where table_key in
|
|
|
+ <foreach collection="list" item="tableKey" open="(" close=")" separator=",">
|
|
|
+ #{tableKey}
|
|
|
+ </foreach>
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <update id="deleteDragTableStyleByIds">
|
|
|
+ update drag_table_style set del_flag = '2' where id in
|
|
|
+ <foreach item="id" collection="list" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <select id="selectIdByTableKey" resultType="long">
|
|
|
+ select id from drag_table_style where del_flag = '0' and table_key = #{tableKey}
|
|
|
+ </select>
|
|
|
+</mapper>
|