|
@@ -0,0 +1,160 @@
|
|
|
+<?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.zkqy.business.mapper.DragTreeMapper">
|
|
|
+
|
|
|
+ <resultMap type="com.zkqy.business.entity.DragTree" id="DragTreeResult">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="menuId" column="menu_id" />
|
|
|
+ <result property="menuName" column="menu_name" />
|
|
|
+ <result property="treeDesc" column="tree_desc" />
|
|
|
+ <result property="treeTableName" column="tree_table_name" />
|
|
|
+ <result property="treeTablePrimaryKey" column="tree_table_primary_key" />
|
|
|
+ <result property="treeTableDgl" column="tree_table_dgl" />
|
|
|
+ <result property="treeTableCondition" column="tree_table_condition" />
|
|
|
+ <result property="treeTableJoinTable" column="tree_table_join_table" />
|
|
|
+ <result property="allJson" column="all_json" />
|
|
|
+ <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" />
|
|
|
+ <result property="tableId" column="table_id"/>
|
|
|
+ <result property="tableNameDes" column="table_name_des"/>
|
|
|
+ <result property="treeTableKey" column="tree_table_key"/>
|
|
|
+ <result property="treeShowLabel" column="tree_show_label"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectDragTreeVo">
|
|
|
+ select id, menu_id, menu_name, tree_desc, tree_table_name, tree_table_primary_key, tree_table_dgl, tree_table_condition, tree_table_join_table, table_name_des, del_flag, create_by, create_by_id, create_time, update_by, update_by_id, update_time,table_id,tree_table_key,tree_show_label from {DBNAME}.drag_tree
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectDragTreeList" parameterType="com.zkqy.business.entity.DragTree" resultMap="DragTreeResult">
|
|
|
+ <include refid="selectDragTreeVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="menuId != null "> and menu_id = #{menuId}</if>
|
|
|
+ <if test="menuName != null and menuName != ''"> and menu_name like concat('%', #{menuName}, '%')</if>
|
|
|
+ <if test="treeDesc != null and treeDesc != ''"> and tree_desc = #{treeDesc}</if>
|
|
|
+ <if test="treeTableName != null and treeTableName != ''"> and tree_table_name like concat('%', #{treeTableName}, '%')</if>
|
|
|
+ <if test="treeTablePrimaryKey != null and treeTablePrimaryKey != ''"> and tree_table_primary_key = #{treeTablePrimaryKey}</if>
|
|
|
+ <if test="treeTableDgl != null and treeTableDgl != ''"> and tree_table_dgl = #{treeTableDgl}</if>
|
|
|
+ <if test="treeTableCondition != null and treeTableCondition != ''"> and tree_table_condition = #{treeTableCondition}</if>
|
|
|
+ <if test="treeTableJoinTable != null and treeTableJoinTable != ''"> and tree_table_join_table = #{treeTableJoinTable}</if>
|
|
|
+ <if test="tableNameDes != null and tableNameDes != ''"> and table_name_des = #{tableNameDes}</if>
|
|
|
+ <if test="createById != null "> and create_by_id = #{createById}</if>
|
|
|
+ <if test="updateById != null "> and update_by_id = #{updateById}</if>
|
|
|
+ <if test="tableId != null">and table_id=#{tableId},</if>
|
|
|
+ <if test="treeTableKey!=null">and tree_table_key=#{treeTableKey}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectDragTreeById" parameterType="Long" resultMap="DragTreeResult">
|
|
|
+ <include refid="selectDragTreeVo"/>
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectDragTreeByTreeTableKey" resultType="com.zkqy.business.entity.DragTree">
|
|
|
+ <include refid="selectDragTreeVo"/>
|
|
|
+ where tree_table_key = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <select id="selectList" resultType="java.util.HashMap">
|
|
|
+ ${executeSql}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="allTabColumns" resultType="java.lang.String">
|
|
|
+ SELECT COLUMN_NAME
|
|
|
+ FROM INFORMATION_SCHEMA.COLUMNS
|
|
|
+ WHERE TABLE_SCHEMA = #{dbname}
|
|
|
+ AND TABLE_NAME = #{tableName}
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <insert id="insertDragTree" parameterType="com.zkqy.business.entity.DragTree" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ insert into {DBNAME}.drag_tree
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="menuId != null">menu_id,</if>
|
|
|
+ <if test="menuName != null and menuName != ''">menu_name,</if>
|
|
|
+ <if test="treeDesc != null and treeDesc != ''">tree_desc,</if>
|
|
|
+ <if test="treeTableName != null and treeTableName != ''">tree_table_name,</if>
|
|
|
+ <if test="treeTablePrimaryKey != null">tree_table_primary_key,</if>
|
|
|
+ <if test="treeTableDgl != null">tree_table_dgl,</if>
|
|
|
+ <if test="treeTableCondition != null">tree_table_condition,</if>
|
|
|
+ <if test="treeTableJoinTable != null">tree_table_join_table,</if>
|
|
|
+ <if test="tableNameDes != null">`table_name_des`,</if>
|
|
|
+ <if test="delFlag != null">del_flag,</if>
|
|
|
+ <if test="createBy != null">create_by,</if>
|
|
|
+ <if test="createById != null">create_by_id,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ <if test="updateBy != null">update_by,</if>
|
|
|
+ <if test="updateById != null">update_by_id,</if>
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
+ <if test="tableId != null">table_id,</if>
|
|
|
+ <if test="treeTableKey!=null">tree_table_key,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="menuId != null">#{menuId},</if>
|
|
|
+ <if test="menuName != null and menuName != ''">#{menuName},</if>
|
|
|
+ <if test="treeDesc != null and treeDesc != ''">#{treeDesc},</if>
|
|
|
+ <if test="treeTableName != null and treeTableName != ''">#{treeTableName},</if>
|
|
|
+ <if test="treeTablePrimaryKey != null">#{treeTablePrimaryKey},</if>
|
|
|
+ <if test="treeTableDgl != null">#{treeTableDgl},</if>
|
|
|
+ <if test="treeTableCondition != null">#{treeTableCondition},</if>
|
|
|
+ <if test="treeTableJoinTable != null">#{treeTableJoinTable},</if>
|
|
|
+ <if test="tableNameDes != null">#{tableNameDes},</if>
|
|
|
+ <if test="delFlag != null">#{delFlag},</if>
|
|
|
+ <if test="createBy != null">#{createBy},</if>
|
|
|
+ <if test="createById != null">#{createById},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ <if test="updateBy != null">#{updateBy},</if>
|
|
|
+ <if test="updateById != null">#{updateById},</if>
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
+ <if test="tableId != null">#{tableId},</if>
|
|
|
+ <if test="treeTableKey!=null">#{treeTableKey}</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateDragTree" parameterType="com.zkqy.business.entity.DragTree">
|
|
|
+ update {DBNAME}.drag_tree
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="menuId != null">menu_id = #{menuId},</if>
|
|
|
+ <if test="menuName != null and menuName != ''">menu_name = #{menuName},</if>
|
|
|
+ <if test="treeDesc != null and treeDesc != ''">tree_desc = #{treeDesc},</if>
|
|
|
+ <if test="treeTableName != null and treeTableName != ''">tree_table_name = #{treeTableName},</if>
|
|
|
+ <if test="treeTablePrimaryKey != null">tree_table_primary_key = #{treeTablePrimaryKey},</if>
|
|
|
+ <if test="treeTableDgl != null">tree_table_dgl = #{treeTableDgl},</if>
|
|
|
+ <if test="treeTableCondition != null">tree_table_condition = #{treeTableCondition},</if>
|
|
|
+ <if test="treeTableJoinTable != null">tree_table_join_table = #{treeTableJoinTable},</if>
|
|
|
+ <if test="tableNameDes != null">`table_name_des`= #{tableNameDes},</if>
|
|
|
+ <if test="delFlag != null">del_flag = #{delFlag},</if>
|
|
|
+ <if test="createBy != null">create_by = #{createBy},</if>
|
|
|
+ <if test="createById != null">create_by_id = #{createById},</if>
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
+ <if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
+ <if test="updateById != null">update_by_id = #{updateById},</if>
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
+ <if test="tableId != null">table_id=#{tableId},</if>
|
|
|
+ <if test="treeTableKey!=null">tree_table_key=#{treeTableKey}</if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteDragTreeById" parameterType="Long">
|
|
|
+ delete from {DBNAME}.drag_tree where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteDragTreeByIds" parameterType="String">
|
|
|
+ delete from {DBNAME}.drag_tree where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+
|
|
|
+</mapper>
|