123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154 |
- <?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.SysTableSetMapper">
- <resultMap type="SysTableSet" id="SysTableSetResult">
- <result property="id" column="id"/>
- <result property="tableName" column="table_name"/>
- <result property="userId" column="user_id"/>
- <result property="surface" column="surface"/>
- <result property="label" column="label"/>
- <result property="name" column="name"/>
- <result property="checked" column="checked"/>
- <result property="width" column="width"/>
- <result property="fixed" column="fixed"/>
- <result property="changeable" column="changeable"/>
- <result property="operation" column="operation" />
- <result property="disabled" column="disabled" />
- <result property="onabort" column="onabort" />
- </resultMap>
- <sql id="selectSysTableSetVo">
- select id, table_name, user_id, surface, label, fixed, name, checked, width,changeable, operation, disabled, onabort from sys_table_set
- </sql>
- <select id="selectSysTableSetList" parameterType="SysTableSet" resultMap="SysTableSetResult">
- <include refid="selectSysTableSetVo"/>
- <where>
- <if test="tableName != null and tableName != ''">and table_name = #{tableName}</if>
- <if test="userId != null ">and user_id = #{userId}</if>
- <if test="surface != null ">and surface = #{surface}</if>
- <if test="label != null and label != ''">and label = #{label}</if>
- <if test="name != null and name != ''">and name like concat('%', #{name}, '%')</if>
- <if test="checked != null ">and checked = #{checked}</if>
- <if test="width != null ">and width = #{width}</if>
- <if test="fixed != null ">and fixed = #{fixed}</if>
- <if test="changeable != null "> and changeable = #{changeable}</if>
- <if test="operation != null "> and operation = #{operation}</if>
- <if test="disabled != null and disabled != ''"> and disabled = #{disabled}</if>
- <if test="onabort != null and onabort != ''"> and onabort = #{onabort}</if>
- </where>
- </select>
- <select id="selectSysTableSetById" parameterType="Long" resultMap="SysTableSetResult">
- <include refid="selectSysTableSetVo"/>
- where id = #{id}
- </select>
- <select id="selectMaxId" resultType="long">
- SELECT if(MAX(table_id) IS NULL,0,table_id) AS a FROM sys_table_set
- </select>
- <select id="selectMessage" resultType="com.ruoyi.system.domain.SysTableSet">
- SELECT
- id,surface,label,name,checked,width,changeable
- FROM
- `sys_table_set`
- WHERE
- user_id = #{userId}
- AND table_name = #{tableName}
- </select>
- <insert id="insertSysTableSet" parameterType="SysTableSet" useGeneratedKeys="true" keyProperty="id">
- insert into sys_table_set
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="tableName != null">table_name,</if>
- <if test="userId != null">user_id,</if>
- <if test="surface != null">surface,</if>
- <if test="label != null">label,</if>
- <if test="name != null">name,</if>
- <if test="checked != null">checked,</if>
- <if test="width != null">width,</if>
- <if test="fixed != null">fixed,</if>
- <if test="changeable != null">changeable,</if>
- <if test="operation != null">operation,</if>
- <if test="disabled != null">disabled,</if>
- <if test="onabort != null">onabort,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="tableName != null">#{tableName},</if>
- <if test="userId != null">#{userId},</if>
- <if test="surface != null">#{surface},</if>
- <if test="label != null">#{label},</if>
- <if test="name != null">#{name},</if>
- <if test="checked != null">#{checked},</if>
- <if test="width != null">#{width},</if>
- <if test="fixed != null">#{fixed},</if>
- <if test="changeable != null">#{changeable},</if>
- <if test="operation != null">#{operation},</if>
- <if test="disabled != null">#{disabled},</if>
- <if test="onabort != null">#{onabort},</if>
- </trim>
- </insert>
- <update id="updateSysTableSet" parameterType="SysTableSet">
- update sys_table_set
- <trim prefix="SET" suffixOverrides=",">
- <if test="tableName != null">table_name = #{tableName},</if>
- <if test="userId != null">user_id = #{userId},</if>
- <if test="surface != null">surface = #{surface},</if>
- <if test="label != null">label = #{label},</if>
- <if test="name != null">name = #{name},</if>
- <if test="checked != null">checked = #{checked},</if>
- <if test="width != null">width = #{width},</if>
- <if test="fixed != null">width = #{fixed},</if>
- <if test="changeable != null">changeable = #{changeable},</if>
- <if test="operation != null">operation = #{operation},</if>
- <if test="disabled != null">disabled = #{disabled},</if>
- <if test="onabort != null">onabort = #{onabort},</if>
- </trim>
- where id = #{id}
- </update>
- <update id="updateTableSetMessage" parameterType="object">
- UPDATE sys_table_set
- <set>
- <if test="table.surface != null">
- surface = #{table.surface},
- </if>
- <if test="table.label != '' || table.label != null">
- label = #{table.label},
- </if>
- <if test="table.name != '' || table.name != null">
- name = #{table.name},
- </if>
- <if test="table.checked != null">
- checked = #{table.checked},
- </if>
- <if test="table.width != null">
- width = #{table.width},
- </if>
- </set>
- WHERE
- user_id = #{table.userId}
- AND table_name = #{table.tableName}
- </update>
- <delete id="deleteSysTableSet" parameterType="SysTableSet">
- delete from sys_table_set where user_id = #{userId} and table_name = #{tableName}
- </delete>
- <delete id="deleteSysTableSetById" parameterType="Long">
- delete from sys_table_set where id = #{id}
- </delete>
- <delete id="deleteSysTableSetByIds" parameterType="String">
- delete from sys_table_set where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- </mapper>
|