PrivilegeGroupV1ServiceDaoImplMapper.xml 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="privilegeGroupV1ServiceDaoImpl">
  6. <!-- 保存角色信息 add by wuxw 2018-07-03 -->
  7. <insert id="savePrivilegeGroupInfo" parameterType="Map">
  8. insert into p_privilege_group(
  9. pg_id,domain,name,description,store_id,role_type
  10. ) values (
  11. #{pgId},#{domain},#{name},#{description},#{storeId},#{roleType}
  12. )
  13. </insert>
  14. <!-- 查询角色信息 add by wuxw 2018-07-03 -->
  15. <select id="getPrivilegeGroupInfo" parameterType="Map" resultType="Map">
  16. select t.pg_id,t.pg_id pgId,t.domain,t.name,t.description,t.status_cd,t.status_cd statusCd,t.store_id,t.store_id
  17. storeId,t.role_type,t.role_type roleType
  18. from p_privilege_group t
  19. where 1 =1
  20. <if test="pgId !=null and pgId != ''">
  21. and t.pg_id= #{pgId}
  22. </if>
  23. <if test="domain !=null and domain != ''">
  24. and t.domain= #{domain}
  25. </if>
  26. <if test="name !=null and name != ''">
  27. and t.name= #{name}
  28. </if>
  29. <if test="description !=null and description != ''">
  30. and t.description= #{description}
  31. </if>
  32. <if test="statusCd !=null and statusCd != ''">
  33. and t.status_cd= #{statusCd}
  34. </if>
  35. <if test="storeId !=null and storeId != ''">
  36. and t.store_id= #{storeId}
  37. </if>
  38. <if test="roleType !=null and roleType != ''">
  39. and t.role_type= #{roleType}
  40. </if>
  41. order by t.create_time desc
  42. <if test="page != -1 and page != null ">
  43. limit #{page}, #{row}
  44. </if>
  45. </select>
  46. <!-- 修改角色信息 add by wuxw 2018-07-03 -->
  47. <update id="updatePrivilegeGroupInfo" parameterType="Map">
  48. update p_privilege_group t set t.status_cd = #{statusCd}
  49. <if test="newBId != null and newBId != ''">
  50. ,t.b_id = #{newBId}
  51. </if>
  52. <if test="domain !=null and domain != ''">
  53. , t.domain= #{domain}
  54. </if>
  55. <if test="name !=null and name != ''">
  56. , t.name= #{name}
  57. </if>
  58. <if test="description !=null and description != ''">
  59. , t.description= #{description}
  60. </if>
  61. <if test="storeId !=null and storeId != ''">
  62. , t.store_id= #{storeId}
  63. </if>
  64. <if test="roleType !=null and roleType != ''">
  65. , t.role_type= #{roleType}
  66. </if>
  67. where 1=1
  68. <if test="pgId !=null and pgId != ''">
  69. and t.pg_id= #{pgId}
  70. </if>
  71. </update>
  72. <!-- 查询角色数量 add by wuxw 2018-07-03 -->
  73. <select id="queryPrivilegeGroupsCount" parameterType="Map" resultType="Map">
  74. select count(1) count
  75. from p_privilege_group t
  76. where 1 =1
  77. <if test="pgId !=null and pgId != ''">
  78. and t.pg_id= #{pgId}
  79. </if>
  80. <if test="domain !=null and domain != ''">
  81. and t.domain= #{domain}
  82. </if>
  83. <if test="name !=null and name != ''">
  84. and t.name= #{name}
  85. </if>
  86. <if test="description !=null and description != ''">
  87. and t.description= #{description}
  88. </if>
  89. <if test="statusCd !=null and statusCd != ''">
  90. and t.status_cd= #{statusCd}
  91. </if>
  92. <if test="storeId !=null and storeId != ''">
  93. and t.store_id= #{storeId}
  94. </if>
  95. <if test="roleType !=null and roleType != ''">
  96. and t.role_type= #{roleType}
  97. </if>
  98. </select>
  99. </mapper>