|
@@ -0,0 +1,104 @@
|
|
|
+<?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.SysRepoMapper">
|
|
|
+
|
|
|
+ <resultMap type="SysRepo" id="SysRepoResult">
|
|
|
+ <result property="repoId" column="repo_Id" />
|
|
|
+ <result property="repoName" column="repo_name" />
|
|
|
+ <result property="createBy" column="create_by" />
|
|
|
+ <result property="updateBy" column="update_by" />
|
|
|
+ <result property="repoType" column="repo_type" />
|
|
|
+ <result property="repoStatus" column="repo_status" />
|
|
|
+ <result property="createTime" column="create_Time" />
|
|
|
+ <result property="updateTime" column="update_Time" />
|
|
|
+ <result property="parentId" column="parent_id" />
|
|
|
+ <result property="repoLevel" column="repo_level" />
|
|
|
+ <result property="description" column="description" />
|
|
|
+ <result property="isDelete" column="is_delete" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectSysRepoVo">
|
|
|
+ select repo_Id, repo_name, create_by, update_by, repo_type, repo_status, create_Time, update_Time, parent_id, repo_level, description, is_delete from sys_repo
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectSysRepoList" parameterType="SysRepo" resultMap="SysRepoResult">
|
|
|
+ <include refid="selectSysRepoVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="repoName != null and repoName != ''"> and repo_name like concat('%', #{repoName}, '%')</if>
|
|
|
+ <if test="repoType != null and repoType != ''"> and repo_type = #{repoType}</if>
|
|
|
+ <if test="repoStatus != null and repoStatus != ''"> and repo_status = #{repoStatus}</if>
|
|
|
+ <if test="createTime != null "> and create_Time = #{createTime}</if>
|
|
|
+ <if test="updateTime != null "> and update_Time = #{updateTime}</if>
|
|
|
+ <if test="parentId != null "> and parent_id = #{parentId}</if>
|
|
|
+ <if test="repoLevel != null "> and repo_level = #{repoLevel}</if>
|
|
|
+ <if test="description != null and description != ''"> and description = #{description}</if>
|
|
|
+ <if test="isDelete != null "> and is_delete = #{isDelete}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectSysRepoByRepoId" parameterType="Long" resultMap="SysRepoResult">
|
|
|
+ <include refid="selectSysRepoVo"/>
|
|
|
+ where repo_Id = #{repoId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertSysRepo" parameterType="SysRepo" useGeneratedKeys="true" keyProperty="repoId">
|
|
|
+ insert into sys_repo
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="repoName != null and repoName != ''">repo_name,</if>
|
|
|
+ <if test="createBy != null">create_by,</if>
|
|
|
+ <if test="updateBy != null">update_by,</if>
|
|
|
+ <if test="repoType != null and repoType != ''">repo_type,</if>
|
|
|
+ <if test="repoStatus != null and repoStatus != ''">repo_status,</if>
|
|
|
+ <if test="createTime != null">create_Time,</if>
|
|
|
+ <if test="updateTime != null">update_Time,</if>
|
|
|
+ <if test="parentId != null">parent_id,</if>
|
|
|
+ <if test="repoLevel != null">repo_level,</if>
|
|
|
+ <if test="description != null">description,</if>
|
|
|
+ <if test="isDelete != null">is_delete,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="repoName != null and repoName != ''">#{repoName},</if>
|
|
|
+ <if test="createBy != null">#{createBy},</if>
|
|
|
+ <if test="updateBy != null">#{updateBy},</if>
|
|
|
+ <if test="repoType != null and repoType != ''">#{repoType},</if>
|
|
|
+ <if test="repoStatus != null and repoStatus != ''">#{repoStatus},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
+ <if test="parentId != null">#{parentId},</if>
|
|
|
+ <if test="repoLevel != null">#{repoLevel},</if>
|
|
|
+ <if test="description != null">#{description},</if>
|
|
|
+ <if test="isDelete != null">#{isDelete},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateSysRepo" parameterType="SysRepo">
|
|
|
+ update sys_repo
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="repoName != null and repoName != ''">repo_name = #{repoName},</if>
|
|
|
+ <if test="createBy != null">create_by = #{createBy},</if>
|
|
|
+ <if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
+ <if test="repoType != null and repoType != ''">repo_type = #{repoType},</if>
|
|
|
+ <if test="repoStatus != null and repoStatus != ''">repo_status = #{repoStatus},</if>
|
|
|
+ <if test="createTime != null">create_Time = #{createTime},</if>
|
|
|
+ <if test="updateTime != null">update_Time = #{updateTime},</if>
|
|
|
+ <if test="parentId != null">parent_id = #{parentId},</if>
|
|
|
+ <if test="repoLevel != null">repo_level = #{repoLevel},</if>
|
|
|
+ <if test="description != null">description = #{description},</if>
|
|
|
+ <if test="isDelete != null">is_delete = #{isDelete},</if>
|
|
|
+ </trim>
|
|
|
+ where repo_Id = #{repoId}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteSysRepoByRepoId" parameterType="Long">
|
|
|
+ delete from sys_repo where repo_Id = #{repoId}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteSysRepoByRepoIds" parameterType="String">
|
|
|
+ delete from sys_repo where repo_Id in
|
|
|
+ <foreach item="repoId" collection="array" open="(" separator="," close=")">
|
|
|
+ #{repoId}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|