|
|
@@ -1,62 +1,75 @@
|
|
|
<?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">
|
|
|
+ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
+ "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.jjt.doc.mapper.DocLevelMapper">
|
|
|
-
|
|
|
+
|
|
|
<resultMap type="DocLevel" id="DocLevelResult">
|
|
|
- <result property="levelId" column="LEVEL_ID" />
|
|
|
- <result property="levelName" column="LEVEL_NAME" />
|
|
|
- <result property="levelRole" column="LEVEL_ROLE" />
|
|
|
- <result property="createBy" column="CREATE_BY" />
|
|
|
- <result property="createTime" column="CREATE_TIME" />
|
|
|
- <result property="updateBy" column="UPDATE_BY" />
|
|
|
- <result property="updateTime" column="UPDATE_TIME" />
|
|
|
- <result property="remark" column="REMARK" />
|
|
|
- <result property="isDel" column="IS_DEL" />
|
|
|
+ <result property="levelId" column="LEVEL_ID"/>
|
|
|
+ <result property="levelName" column="LEVEL_NAME"/>
|
|
|
+ <result property="levelRole" column="LEVEL_ROLE"/>
|
|
|
+ <result property="levelRoleName" column="LEVEL_ROLE_NAME"/>
|
|
|
+ <result property="createBy" column="CREATE_BY"/>
|
|
|
+ <result property="createTime" column="CREATE_TIME"/>
|
|
|
+ <result property="updateBy" column="UPDATE_BY"/>
|
|
|
+ <result property="updateTime" column="UPDATE_TIME"/>
|
|
|
+ <result property="remark" column="REMARK"/>
|
|
|
+ <result property="isDel" column="IS_DEL"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectDocLevelVo">
|
|
|
- select LEVEL_ID, LEVEL_NAME, LEVEL_ROLE, CREATE_BY, CREATE_TIME, UPDATE_BY, UPDATE_TIME, REMARK, IS_DEL from doc_level
|
|
|
+ select LEVEL_ID,
|
|
|
+ LEVEL_NAME,
|
|
|
+ LEVEL_ROLE,
|
|
|
+ LEVEL_ROLE_NAME,
|
|
|
+ CREATE_BY,
|
|
|
+ CREATE_TIME,
|
|
|
+ UPDATE_BY,
|
|
|
+ UPDATE_TIME,
|
|
|
+ REMARK,
|
|
|
+ IS_DEL
|
|
|
+ from doc_level
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectDocLevelList" parameterType="DocLevel" resultMap="DocLevelResult">
|
|
|
<include refid="selectDocLevelVo"/>
|
|
|
- <where>
|
|
|
- <if test="levelName != null and levelName != ''"> and LEVEL_NAME like concat('%', #{levelName}, '%')</if>
|
|
|
- <if test="levelRole != null and levelRole != ''"> and LEVEL_ROLE like concat('%', #{levelRole}, '%')</if>
|
|
|
- <if test="createBy != null and createBy != ''"> and CREATE_BY = #{createBy}</if>
|
|
|
- <if test="updateBy != null and updateBy != ''"> and UPDATE_BY = #{updateBy}</if>
|
|
|
+ <where>
|
|
|
+ <if test="levelName != null and levelName != ''">and LEVEL_NAME like concat('%', #{levelName}, '%')</if>
|
|
|
+ <if test="levelRole != null and levelRole != ''">and LEVEL_ROLE like concat('%', #{levelRole}, '%')</if>
|
|
|
+ <if test="createBy != null and createBy != ''">and CREATE_BY = #{createBy}</if>
|
|
|
+ <if test="updateBy != null and updateBy != ''">and UPDATE_BY = #{updateBy}</if>
|
|
|
</where>
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<select id="selectDocLevelByLevelId" parameterType="Long" resultMap="DocLevelResult">
|
|
|
<include refid="selectDocLevelVo"/>
|
|
|
where LEVEL_ID = #{levelId}
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<insert id="insertDocLevel" parameterType="DocLevel" useGeneratedKeys="true" keyProperty="levelId">
|
|
|
insert into doc_level
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
<if test="levelName != null">LEVEL_NAME,</if>
|
|
|
<if test="levelRole != null">LEVEL_ROLE,</if>
|
|
|
+ <if test="levelRoleName != null">LEVEL_ROLE_NAME,</if>
|
|
|
<if test="createBy != null">CREATE_BY,</if>
|
|
|
<if test="createTime != null">CREATE_TIME,</if>
|
|
|
<if test="updateBy != null">UPDATE_BY,</if>
|
|
|
<if test="updateTime != null">UPDATE_TIME,</if>
|
|
|
<if test="remark != null">REMARK,</if>
|
|
|
<if test="isDel != null">IS_DEL,</if>
|
|
|
- </trim>
|
|
|
+ </trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="levelName != null">#{levelName},</if>
|
|
|
<if test="levelRole != null">#{levelRole},</if>
|
|
|
+ <if test="levelRoleName != null">#{levelRoleName},</if>
|
|
|
<if test="createBy != null">#{createBy},</if>
|
|
|
<if test="createTime != null">#{createTime},</if>
|
|
|
<if test="updateBy != null">#{updateBy},</if>
|
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
|
<if test="remark != null">#{remark},</if>
|
|
|
<if test="isDel != null">#{isDel},</if>
|
|
|
- </trim>
|
|
|
+ </trim>
|
|
|
</insert>
|
|
|
|
|
|
<update id="updateDocLevel" parameterType="DocLevel">
|
|
|
@@ -64,6 +77,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
<if test="levelName != null">LEVEL_NAME = #{levelName},</if>
|
|
|
<if test="levelRole != null">LEVEL_ROLE = #{levelRole},</if>
|
|
|
+ <if test="levelRoleName != null">LEVEL_ROLE_NAME = #{levelRoleName},</if>
|
|
|
<if test="createBy != null">CREATE_BY = #{createBy},</if>
|
|
|
<if test="createTime != null">CREATE_TIME = #{createTime},</if>
|
|
|
<if test="updateBy != null">UPDATE_BY = #{updateBy},</if>
|
|
|
@@ -75,11 +89,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</update>
|
|
|
|
|
|
<delete id="deleteDocLevelByLevelId" parameterType="Long">
|
|
|
- delete from doc_level where LEVEL_ID = #{levelId}
|
|
|
+ delete
|
|
|
+ from doc_level
|
|
|
+ where LEVEL_ID = #{levelId}
|
|
|
</delete>
|
|
|
|
|
|
<delete id="deleteDocLevelByLevelIds" parameterType="String">
|
|
|
- delete from doc_level where LEVEL_ID in
|
|
|
+ delete from doc_level where LEVEL_ID in
|
|
|
<foreach item="levelId" collection="array" open="(" separator="," close=")">
|
|
|
#{levelId}
|
|
|
</foreach>
|