|
@@ -0,0 +1,197 @@
|
|
|
|
+<?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.jeeplus.modules.sys.dao.HelpDao">
|
|
|
|
+
|
|
|
|
+ <resultMap id="BaseResultMap" type="com.jeeplus.modules.sys.entity.Help">
|
|
|
|
+ <id property="id" column="id" jdbcType="VARCHAR"/>
|
|
|
|
+ <result property="createBy.id" column="create_by" jdbcType="VARCHAR"/>
|
|
|
|
+ <result property="createDate" column="create_date" jdbcType="TIMESTAMP"/>
|
|
|
|
+ <result property="updateBy.id" column="update_by" jdbcType="VARCHAR"/>
|
|
|
|
+ <result property="updateDate" column="update_date" jdbcType="TIMESTAMP"/>
|
|
|
|
+ <result property="remarks" column="remarks" jdbcType="VARCHAR"/>
|
|
|
|
+ <result property="delFlag" column="del_flag" jdbcType="CHAR"/>
|
|
|
|
+ <result property="number" column="number" jdbcType="VARCHAR"/>
|
|
|
|
+ <result property="menuId" column="menu_id" jdbcType="VARCHAR"/>
|
|
|
|
+ <result property="features" column="features" jdbcType="VARCHAR"/>
|
|
|
|
+ <result property="description" column="description" jdbcType="VARCHAR"/>
|
|
|
|
+ <result property="menuName" column="menu_name" jdbcType="VARCHAR"/>
|
|
|
|
+ </resultMap>
|
|
|
|
+
|
|
|
|
+ <sql id="Base_Column_List">
|
|
|
|
+ sh.id,
|
|
|
|
+ sh.create_by,
|
|
|
|
+ sh.create_date,
|
|
|
|
+ sh.update_by,
|
|
|
|
+ sh.update_date,
|
|
|
|
+ sh.remarks,
|
|
|
|
+ sh.del_flag,
|
|
|
|
+ sh.number,
|
|
|
|
+ sh.menu_id,
|
|
|
|
+ sh.features,
|
|
|
|
+ sh.description
|
|
|
|
+ </sql>
|
|
|
|
+
|
|
|
|
+ <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.jeeplus.modules.sys.entity.Help" useGeneratedKeys="true">
|
|
|
|
+ insert into sys_help
|
|
|
|
+ (id,
|
|
|
|
+ create_by,
|
|
|
|
+ create_date,
|
|
|
|
+ update_by,
|
|
|
|
+ update_date,
|
|
|
|
+ remarks,
|
|
|
|
+ del_flag,
|
|
|
|
+ number,
|
|
|
|
+ menu_id,
|
|
|
|
+ features,
|
|
|
|
+ description)
|
|
|
|
+ values
|
|
|
|
+ (#{id,jdbcType=VARCHAR},
|
|
|
|
+ #{createBy.id,jdbcType=VARCHAR},
|
|
|
|
+ #{createDate,jdbcType=TIMESTAMP},
|
|
|
|
+ #{updateBy.id,jdbcType=VARCHAR},
|
|
|
|
+ #{updateDate,jdbcType=TIMESTAMP},
|
|
|
|
+ #{remarks,jdbcType=VARCHAR},
|
|
|
|
+ #{delFlag,jdbcType=CHAR},
|
|
|
|
+ #{number,jdbcType=VARCHAR},
|
|
|
|
+ #{menuId,jdbcType=VARCHAR},
|
|
|
|
+ #{features,jdbcType=VARCHAR},
|
|
|
|
+ #{description,jdbcType=VARCHAR})
|
|
|
|
+ </insert>
|
|
|
|
+ <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.jeeplus.modules.sys.entity.Help" useGeneratedKeys="true">
|
|
|
|
+ insert into sys_help
|
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
+ <if test="id != null">id,</if>
|
|
|
|
+ <if test="createBy != null">create_by,</if>
|
|
|
|
+ <if test="createDate != null">create_date,</if>
|
|
|
|
+ <if test="updateBy != null">update_by,</if>
|
|
|
|
+ <if test="updateDate != null">update_date,</if>
|
|
|
|
+ <if test="remarks != null">remarks,</if>
|
|
|
|
+ <if test="delFlag != null">del_flag,</if>
|
|
|
|
+ <if test="number != null">number,</if>
|
|
|
|
+ <if test="menuId != null">menu_id,</if>
|
|
|
|
+ <if test="features != null">features,</if>
|
|
|
|
+ <if test="description != null">description,</if>
|
|
|
|
+ </trim>
|
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
+ <if test="id != null"> #{id,jdbcType=VARCHAR},</if>
|
|
|
|
+ <if test="createBy.id != null"> #{createBy.id,jdbcType=VARCHAR},</if>
|
|
|
|
+ <if test="createDate != null"> #{createDate,jdbcType=TIMESTAMP},</if>
|
|
|
|
+ <if test="updateBy.id != null"> #{updateBy.id,jdbcType=VARCHAR},</if>
|
|
|
|
+ <if test="updateDate != null"> #{updateDate,jdbcType=TIMESTAMP},</if>
|
|
|
|
+ <if test="remarks != null"> #{remarks,jdbcType=VARCHAR},</if>
|
|
|
|
+ <if test="delFlag != null"> #{delFlag,jdbcType=CHAR},</if>
|
|
|
|
+ <if test="number != null"> #{number,jdbcType=VARCHAR},</if>
|
|
|
|
+ <if test="menuId != null"> #{menuId,jdbcType=VARCHAR},</if>
|
|
|
|
+ <if test="features != null"> #{features,jdbcType=VARCHAR},</if>
|
|
|
|
+ <if test="description != null"> #{description,jdbcType=VARCHAR},</if>
|
|
|
|
+ </trim>
|
|
|
|
+ </insert>
|
|
|
|
+ <update id="update" parameterType="com.jeeplus.modules.sys.entity.Help">
|
|
|
|
+ update sys_help
|
|
|
|
+ <set>
|
|
|
|
+ <if test="createBy != null and createBy.id != null and createBy.id != ''">
|
|
|
|
+ create_by = #{createBy.id,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="createDate != null">
|
|
|
|
+ create_date = #{createDate,jdbcType=TIMESTAMP},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="updateBy != null and updateBy.id != null and updateBy.id != ''">
|
|
|
|
+ update_by = #{updateBy.id,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="updateDate != null">
|
|
|
|
+ update_date = #{updateDate,jdbcType=TIMESTAMP},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="remarks != null">
|
|
|
|
+ remarks = #{remarks,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="delFlag != null">
|
|
|
|
+ del_flag = #{delFlag,jdbcType=CHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="number != null">
|
|
|
|
+ number = #{number,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="menuId != null">
|
|
|
|
+ menu_id = #{menuId,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="features != null">
|
|
|
|
+ features = #{features,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="description != null">
|
|
|
|
+ description = #{description,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ </set>
|
|
|
|
+ where
|
|
|
|
+ id = #{id,jdbcType=VARCHAR}
|
|
|
|
+ </update>
|
|
|
|
+
|
|
|
|
+ <update id="updateById" parameterType="com.jeeplus.modules.sys.entity.Help">
|
|
|
|
+ update sys_help
|
|
|
|
+ set
|
|
|
|
+ create_by = #{createBy.id,jdbcType=VARCHAR},
|
|
|
|
+ create_date = #{createDate,jdbcType=TIMESTAMP},
|
|
|
|
+ update_by = #{updateBy.id,jdbcType=VARCHAR},
|
|
|
|
+ update_date = #{updateDate,jdbcType=TIMESTAMP},
|
|
|
|
+ remarks = #{remarks,jdbcType=VARCHAR},
|
|
|
|
+ del_flag = #{delFlag,jdbcType=CHAR},
|
|
|
|
+ number = #{number,jdbcType=VARCHAR},
|
|
|
|
+ menu_id = #{menuId,jdbcType=VARCHAR},
|
|
|
|
+ features = #{features,jdbcType=VARCHAR},
|
|
|
|
+ description = #{description,jdbcType=VARCHAR}
|
|
|
|
+ where
|
|
|
|
+ id = #{id,jdbcType=VARCHAR}
|
|
|
|
+ </update>
|
|
|
|
+
|
|
|
|
+ <select id="get" resultMap="BaseResultMap" >
|
|
|
|
+ SELECT
|
|
|
|
+ <include refid="Base_Column_List"/>,
|
|
|
|
+ sm.name as menu_name
|
|
|
|
+ FROM sys_help sh
|
|
|
|
+ LEFT JOIN sys_menu sm on sm.id = sh.menu_id and sm.del_flag = '0'
|
|
|
|
+ WHERE sh.id = #{id}
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="findList" resultMap="BaseResultMap" >
|
|
|
|
+ SELECT
|
|
|
|
+ <include refid="Base_Column_List"/>,
|
|
|
|
+ sm.name as menu_name
|
|
|
|
+ FROM sys_help sh
|
|
|
|
+ LEFT JOIN sys_menu sm on sm.id = sh.menu_id and sm.del_flag = '0'
|
|
|
|
+ <where>
|
|
|
|
+ sh.del_flag = #{DEL_FLAG_NORMAL}
|
|
|
|
+ <if test="id != null and id != ''">
|
|
|
|
+ and sh.id = #{id}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="number != null and number != ''">
|
|
|
|
+ AND sh.number LIKE concat('%',#{number},'%')
|
|
|
|
+ </if>
|
|
|
|
+ <if test="features != null and features != ''">
|
|
|
|
+ AND sh.features LIKE concat('%',#{features},'%')
|
|
|
|
+ </if>
|
|
|
|
+ <if test="description != null and description != ''">
|
|
|
|
+ AND sh.description LIKE concat('%',#{description},'%')
|
|
|
|
+ </if>
|
|
|
|
+ <if test="menuIdList != null and menuIdList.size > 0">
|
|
|
|
+ and sh.menu_id in
|
|
|
|
+ <foreach collection="menuIdList" index="index" item="item" open="(" separator="," close=")">
|
|
|
|
+ #{item}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ </where>
|
|
|
|
+ ORDER BY sh.create_date desc
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <!--逻辑删除-->
|
|
|
|
+ <update id="deleteByLogic" parameterType="com.jeeplus.modules.sys.entity.Help">
|
|
|
|
+ UPDATE sys_help SET
|
|
|
|
+ del_flag = #{DEL_FLAG_DELETE}
|
|
|
|
+ WHERE id = #{id}
|
|
|
|
+ </update>
|
|
|
|
+
|
|
|
|
+ <select id="getByParentMenuId" resultType="string" parameterType="string">
|
|
|
|
+ select
|
|
|
|
+ sm.id
|
|
|
|
+ from sys_menu sm
|
|
|
|
+ where sm.del_flag = '0'
|
|
|
|
+ and (sm.parent_ids like CONCAT('%,',#{menuId},',%') or sm.id = #{menuId})
|
|
|
|
+ </select>
|
|
|
|
+</mapper>
|