|
@@ -6,9 +6,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
<resultMap type="SysRole" id="SysRoleResult">
|
|
|
<id property="roleId" column="role_id" />
|
|
|
- <result property="roleName" column="role_name" />
|
|
|
+ <result property="roleName" column="role_name" jdbcType="VARCHAR" />
|
|
|
<result property="roleKey" column="role_key" />
|
|
|
- <result property="roleSort" column="role_sort" javaType="java.lang.Integer" jdbcType="INTEGER" />
|
|
|
+ <result property="roleSort" column="role_sort" />
|
|
|
<result property="dataScope" column="data_scope" />
|
|
|
<result property="status" column="status" />
|
|
|
<result property="delFlag" column="del_flag" />
|
|
@@ -58,7 +58,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
and to_date(r.create_time,'YY-MM-DD') <= to_date(#{params.endTime},'YY-MM-DD')
|
|
|
</if>
|
|
|
<!-- 数据范围过滤 -->
|
|
|
- ${params.dataScope}
|
|
|
+ ${params.dataScope}
|
|
|
</select>
|
|
|
|
|
|
<select id="selectRolesByUserId" parameterType="Long" resultMap="SysRoleResult">
|
|
@@ -97,22 +97,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<set>
|
|
|
<if test="roleName != null and roleName != ''">role_name = #{roleName},</if>
|
|
|
<if test="roleKey != null and roleKey != ''">role_key = #{roleKey},</if>
|
|
|
- <if test="roleSort != null and roleSort != ''">role_sort = #{roleSort},</if>
|
|
|
+ <if test="roleSort != null">role_sort = #{roleSort},</if>
|
|
|
<if test="dataScope != null and dataScope != ''">data_scope = #{dataScope},</if>
|
|
|
<if test="status != null and status != ''">status = #{status},</if>
|
|
|
<if test="remark != null">remark = #{remark},</if>
|
|
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
|
|
- update_time = now()
|
|
|
+ update_time = LOCALTIMESTAMP(0)
|
|
|
</set>
|
|
|
where role_id = #{roleId}
|
|
|
</update>
|
|
|
|
|
|
- <insert id="insertRole" parameterType="SysRole" useGeneratedKeys="true" keyProperty="roleId">
|
|
|
+ <insert id="insertRole" parameterType="SysRole" useGeneratedKeys="true" keyProperty="roleId" keyColumn="role_id">
|
|
|
insert into sys_role(
|
|
|
<if test="roleId != null and roleId != 0">role_id,</if>
|
|
|
<if test="roleName != null and roleName != ''">role_name,</if>
|
|
|
<if test="roleKey != null and roleKey != ''">role_key,</if>
|
|
|
- <if test="roleSort != null and roleSort != ''">role_sort,</if>
|
|
|
+ <if test="roleSort != null">role_sort,</if>
|
|
|
<if test="dataScope != null and dataScope != ''">data_scope,</if>
|
|
|
<if test="status != null and status != ''">status,</if>
|
|
|
<if test="remark != null and remark != ''">remark,</if>
|
|
@@ -122,12 +122,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="roleId != null and roleId != 0">#{roleId},</if>
|
|
|
<if test="roleName != null and roleName != ''">#{roleName},</if>
|
|
|
<if test="roleKey != null and roleKey != ''">#{roleKey},</if>
|
|
|
- <if test="roleSort != null and roleSort != ''">#{roleSort},</if>
|
|
|
+ <if test="roleSort != null">#{roleSort},</if>
|
|
|
<if test="dataScope != null and dataScope != ''">#{dataScope},</if>
|
|
|
<if test="status != null and status != ''">#{status},</if>
|
|
|
<if test="remark != null and remark != ''">#{remark},</if>
|
|
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
|
|
- now()
|
|
|
+ LOCALTIMESTAMP(0)
|
|
|
)
|
|
|
</insert>
|
|
|
|