|
|
@@ -4,11 +4,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.hr.system.mapper.SysDictTypeMapper">
|
|
|
|
|
|
- <resultMap type="SysDictType" id="SysDictTypeResult">
|
|
|
+ <resultMap type="com.hr.system.api.domain.SysDictType" id="SysDictTypeResult">
|
|
|
<id property="dictId" column="dict_id" />
|
|
|
<result property="dictName" column="dict_name" />
|
|
|
<result property="dictType" column="dict_type" />
|
|
|
<result property="status" column="status" />
|
|
|
+ <result property="sysId" column="sys_id" />
|
|
|
<result property="createBy" column="create_by" />
|
|
|
<result property="createTime" column="create_time" />
|
|
|
<result property="updateBy" column="update_by" />
|
|
|
@@ -16,11 +17,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectDictTypeVo">
|
|
|
- select dict_id, dict_name, dict_type, status, create_by, create_time, remark
|
|
|
+ select dict_id, dict_name, dict_type, status, create_by, create_time, remark ,sys_id
|
|
|
from sys_dict_type
|
|
|
</sql>
|
|
|
|
|
|
- <select id="selectDictTypeList" parameterType="SysDictType" resultMap="SysDictTypeResult">
|
|
|
+ <select id="selectDictTypeList" parameterType="com.hr.system.api.domain.SysDictType" resultMap="SysDictTypeResult">
|
|
|
<include refid="selectDictTypeVo"/>
|
|
|
<where>
|
|
|
<if test="dictName != null and dictName != ''">
|
|
|
@@ -32,6 +33,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="dictType != null and dictType != ''">
|
|
|
AND dict_type like concat('%', #{dictType}, '%')
|
|
|
</if>
|
|
|
+ <if test="sysId != null">
|
|
|
+ and sys_id = #{sysId}
|
|
|
+ </if>
|
|
|
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
|
|
and date_format(create_time,'%Y%m%d') >= date_format(#{params.beginTime},'%Y%m%d')
|
|
|
</if>
|
|
|
@@ -55,11 +59,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
where dict_type = #{dictType}
|
|
|
</select>
|
|
|
|
|
|
- <select id="checkDictTypeUnique" parameterType="String" resultMap="SysDictTypeResult">
|
|
|
+ <select id="checkDictTypeUnique" resultMap="SysDictTypeResult">
|
|
|
<include refid="selectDictTypeVo"/>
|
|
|
- where dict_type = #{dictType} limit 1
|
|
|
+ where dict_type = #{dictType} and sys_id = #{sysId} limit 1
|
|
|
</select>
|
|
|
-
|
|
|
+ <select id="selectDictTypeBySysId" resultType="com.hr.system.api.domain.SysDictType">
|
|
|
+ <include refid="selectDictTypeVo"/>
|
|
|
+ <where>
|
|
|
+ sys_id = #{sysId}
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
<delete id="deleteDictTypeById" parameterType="Long">
|
|
|
delete from sys_dict_type where dict_id = #{dictId}
|
|
|
</delete>
|
|
|
@@ -71,7 +81,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</foreach>
|
|
|
</delete>
|
|
|
|
|
|
- <update id="updateDictType" parameterType="SysDictType">
|
|
|
+ <update id="updateDictType" parameterType="com.hr.system.api.domain.SysDictType">
|
|
|
update sys_dict_type
|
|
|
<set>
|
|
|
<if test="dictName != null and dictName != ''">dict_name = #{dictName},</if>
|
|
|
@@ -84,20 +94,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
where dict_id = #{dictId}
|
|
|
</update>
|
|
|
|
|
|
- <insert id="insertDictType" parameterType="SysDictType">
|
|
|
+ <insert id="insertDictType" parameterType="com.hr.system.api.domain.SysDictType">
|
|
|
insert into sys_dict_type(
|
|
|
- <if test="dictName != null and dictName != ''">dict_name,</if>
|
|
|
- <if test="dictType != null and dictType != ''">dict_type,</if>
|
|
|
- <if test="status != null">status,</if>
|
|
|
- <if test="remark != null and remark != ''">remark,</if>
|
|
|
- <if test="createBy != null and createBy != ''">create_by,</if>
|
|
|
+ <if test="dictType.dictName != null and dictType.dictName != ''">dict_name,</if>
|
|
|
+ <if test="dictType.sysId != null">sys_id,</if>
|
|
|
+ <if test="dictType.dictType != null and dictType.dictType != ''">dict_type,</if>
|
|
|
+ <if test="dictType.status != null">status,</if>
|
|
|
+ <if test="dictType.remark != null and dictType.remark != ''">remark,</if>
|
|
|
+ <if test="userId != null">create_by,</if>
|
|
|
create_time
|
|
|
)values(
|
|
|
- <if test="dictName != null and dictName != ''">#{dictName},</if>
|
|
|
- <if test="dictType != null and dictType != ''">#{dictType},</if>
|
|
|
- <if test="status != null">#{status},</if>
|
|
|
- <if test="remark != null and remark != ''">#{remark},</if>
|
|
|
- <if test="createBy != null and createBy != ''">#{createBy},</if>
|
|
|
+ <if test="dictType.dictName != null and dictType.dictName != ''">#{dictType.dictName},</if>
|
|
|
+ <if test="dictType.sysId != null">#{dictType.sysId},</if>
|
|
|
+ <if test="dictType.dictType != null and dictType.dictType != ''">#{dictType.dictType},</if>
|
|
|
+ <if test="dictType.status != null">#{dictType.status},</if>
|
|
|
+ <if test="dictType.remark != null and dictType.remark != ''">#{dictType.remark},</if>
|
|
|
+ <if test="userId != null ">#{userId},</if>
|
|
|
sysdate()
|
|
|
)
|
|
|
</insert>
|