12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- <?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.business.mapper.DragTableStatisticMapper">
-
- <resultMap type="com.ruoyi.business.entity.DragTableStatistic" id="DragTableStatisticResult">
- <result property="id" column="id" />
- <result property="statisticTitle" column="statistic_title" />
- <result property="tableKey" column="table_key" />
- <result property="statisticDescription" column="statistic_description" />
- <result property="statisticType" column="statistic_type" />
- <result property="statisticField" column="statistic_field" />
- <result property="statisticObject" column="statistic_object" />
- <result property="sqlKey" column="sql_key" />
- <result property="delFlag" column="del_flag" />
- <result property="createBy" column="create_by" />
- <result property="createTime" column="create_time" />
- <result property="updateBy" column="update_by" />
- <result property="updateTime" column="update_time" />
- </resultMap>
- <sql id="selectDragTableStatisticVo">
- select id, statistic_title, table_key, statistic_description, statistic_type, statistic_field, statistic_object, sql_key, del_flag, create_by, create_time, update_by, update_time from {DBNAME}.drag_table_statistic
- </sql>
- <select id="selectDragTableStatisticList" parameterType="com.ruoyi.business.entity.DragTableStatistic" resultMap="DragTableStatisticResult">
- <include refid="selectDragTableStatisticVo"/>
- where del_flag = '0'
- <if test="statisticTitle != null and statisticTitle != ''"> and statistic_title = #{statisticTitle}</if>
- <if test="tableKey != null and tableKey != ''"> and table_key = #{tableKey}</if>
- <if test="statisticDescription != null and statisticDescription != ''"> and statistic_description = #{statisticDescription}</if>
- <if test="statisticType != null "> and statistic_type = #{statisticType}</if>
- <if test="statisticField != null and statisticField != ''"> and statistic_field = #{statisticField}</if>
- <if test="statisticObject != null and statisticObject != ''"> and statistic_object = #{statisticObject}</if>
- </select>
- <select id="selectDragTableStatisticById" parameterType="Long" resultMap="DragTableStatisticResult">
- <include refid="selectDragTableStatisticVo"/>
- where id = #{id}
- </select>
-
- <insert id="batchInsertDragTableStatistic" useGeneratedKeys="true" keyProperty="id">
- insert into drag_table_statistic
- (statistic_title,table_key,statistic_description,statistic_type,statistic_field,statistic_object,sql_key,create_by_id,create_by,create_time,del_flag)
- values
- <foreach collection="list" item="item" index="index" separator=",">
- (#{item.statisticTitle},#{item.tableKey},#{item.statisticDescription},#{item.statisticType},#{item.statisticField},#{item.statisticObject},
- #{item.sqlKey},#{item.createById},#{item.createBy},#{item.createTime},'0')
- </foreach>
- </insert>
- <update id="updateDragTableStatistic">
- update drag_table_statistic
- <trim prefix="SET" suffixOverrides=",">
- <if test="statisticTitle != null">statistic_title = #{statisticTitle},</if>
- <if test="tableKey != null">table_key = #{tableKey},</if>
- <if test="statisticDescription != null">statistic_description = #{statisticDescription},</if>
- <if test="statisticType != null">statistic_type = #{statisticType},</if>
- <if test="statisticField != null">statistic_field = #{statisticField},</if>
- <if test="statisticObject != null">statistic_object = #{statisticObject},</if>
- <if test="sqlKey != null">sql_key = #{sqlKey},</if>
- <if test="updateBy != null">update_by = #{updateBy},</if>
- <if test="updateTime != null">update_time = #{updateTime},</if>
- </trim>
- where id = #{id}
- </update>
- <update id="deleteDragTableStatisticByTableKey" parameterType="String">
- update drag_table_statistic set del_flag = '2' where table_key = #{tableKey}
- </update>
- <update id="deleteDragTableStatisticByTableKeys" parameterType="String">
- update drag_table_statistic set del_flag = '2' where table_key in
- <foreach collection="list" item="tableKey" open="(" close=")" separator=",">
- #{tableKey}
- </foreach>
- </update>
- <delete id="deleteDragTableStatisticByIds">
- update drag_table_statistic set del_flag = '2' where id in
- <foreach item="id" collection="list" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- <select id="selectIdsByTableKey" parameterType="String" resultType="Long">
- select id from drag_table_statistic where del_flag = '0' and table_key = #{tableKey}
- </select>
- <select id="selectSqlKeyByTableKey" parameterType="String" resultType="String">
- select sql_key from drag_table_statistic where del_flag = '0' and table_key = #{tableKey}
- </select>
- </mapper>
|