SysRoleMapper.xml 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.weather.mapper.SysRoleMapper">
  4. <resultMap type="SysRole" id="SysRoleResult">
  5. <id property="roleId" column="role_id" />
  6. <result property="roleName" column="role_name" />
  7. <result property="roleKey" column="role_key" />
  8. <result property="roleSort" column="role_sort" />
  9. <result property="dataScope" column="data_scope" />
  10. <result property="menuCheckStrictly" column="menu_check_strictly" />
  11. <result property="deptCheckStrictly" column="dept_check_strictly" />
  12. <result property="status" column="status" />
  13. <result property="delFlag" column="del_flag" />
  14. <result property="createBy" column="create_by" />
  15. <result property="createTime" column="create_time" />
  16. <result property="updateBy" column="update_by" />
  17. <result property="updateTime" column="update_time" />
  18. <result property="remark" column="remark" />
  19. </resultMap>
  20. <insert id="insertRole" parameterType="SysRole" useGeneratedKeys="true" keyProperty="roleId">
  21. insert into sys_role(
  22. <if test="roleId != null and roleId != 0">role_id,</if>
  23. <if test="roleName != null and roleName != ''">role_name,</if>
  24. <if test="roleKey != null and roleKey != ''">role_key,</if>
  25. <if test="roleSort != null">role_sort,</if>
  26. <if test="dataScope != null and dataScope != ''">data_scope,</if>
  27. <if test="menuCheckStrictly != null">menu_check_strictly,</if>
  28. <if test="deptCheckStrictly != null">dept_check_strictly,</if>
  29. <if test="status != null and status != ''">status,</if>
  30. <if test="remark != null and remark != ''">remark,</if>
  31. <if test="createBy != null and createBy != ''">create_by,</if>
  32. create_time
  33. )values(
  34. <if test="roleId != null and roleId != 0">#{roleId},</if>
  35. <if test="roleName != null and roleName != ''">#{roleName},</if>
  36. <if test="roleKey != null and roleKey != ''">#{roleKey},</if>
  37. <if test="roleSort != null">#{roleSort},</if>
  38. <if test="dataScope != null and dataScope != ''">#{dataScope},</if>
  39. <if test="menuCheckStrictly != null">#{menuCheckStrictly},</if>
  40. <if test="deptCheckStrictly != null">#{deptCheckStrictly},</if>
  41. <if test="status != null and status != ''">#{status},</if>
  42. <if test="remark != null and remark != ''">#{remark},</if>
  43. <if test="createBy != null and createBy != ''">#{createBy},</if>
  44. NOW()
  45. )
  46. </insert>
  47. </mapper>