RoleCommunityV1ServiceDaoImplMapper.xml 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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="roleCommunityV1ServiceDaoImpl">
  6. <!-- 保存项目授权信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveRoleCommunityInfo" parameterType="Map">
  8. insert into u_role_community(
  9. role_id,rc_id,community_id,community_name,store_id
  10. ) values (
  11. #{roleId},#{rcId},#{communityId},#{communityName},#{storeId}
  12. )
  13. </insert>
  14. <!-- 查询项目授权信息 add by wuxw 2018-07-03 -->
  15. <select id="getRoleCommunityInfo" parameterType="Map" resultType="Map">
  16. select t.role_id,t.role_id roleId,t.rc_id,t.rc_id rcId,t.status_cd,t.status_cd
  17. statusCd,t.community_id,t.community_id communityId,t.community_name communityName,t.store_id,t.store_id storeId
  18. from u_role_community t
  19. where 1 =1
  20. <if test="roleId !=null and roleId != ''">
  21. and t.role_id= #{roleId}
  22. </if>
  23. <if test="rcId !=null and rcId != ''">
  24. and t.rc_id= #{rcId}
  25. </if>
  26. <if test="statusCd !=null and statusCd != ''">
  27. and t.status_cd= #{statusCd}
  28. </if>
  29. <if test="communityId !=null and communityId != ''">
  30. and t.community_id= #{communityId}
  31. </if>
  32. <if test="storeId !=null and storeId != ''">
  33. and t.store_id= #{storeId}
  34. </if>
  35. order by t.create_time desc
  36. <if test="page != -1 and page != null ">
  37. limit #{page}, #{row}
  38. </if>
  39. </select>
  40. <!-- 修改项目授权信息 add by wuxw 2018-07-03 -->
  41. <update id="updateRoleCommunityInfo" parameterType="Map">
  42. update u_role_community t set t.status_cd = #{statusCd}
  43. <if test="newBId != null and newBId != ''">
  44. ,t.b_id = #{newBId}
  45. </if>
  46. <if test="roleId !=null and roleId != ''">
  47. , t.role_id= #{roleId}
  48. </if>
  49. <if test="communityId !=null and communityId != ''">
  50. , t.community_id= #{communityId}
  51. </if>
  52. <if test="communityName !=null and communityName != ''">
  53. , t.community_name= #{communityName}
  54. </if>
  55. <if test="storeId !=null and storeId != ''">
  56. , t.store_id= #{storeId}
  57. </if>
  58. where 1=1
  59. <if test="rcId !=null and rcId != ''">
  60. and t.rc_id= #{rcId}
  61. </if>
  62. </update>
  63. <!-- 查询项目授权数量 add by wuxw 2018-07-03 -->
  64. <select id="queryRoleCommunitysCount" parameterType="Map" resultType="Map">
  65. select count(1) count
  66. from u_role_community t
  67. where 1 =1
  68. <if test="roleId !=null and roleId != ''">
  69. and t.role_id= #{roleId}
  70. </if>
  71. <if test="rcId !=null and rcId != ''">
  72. and t.rc_id= #{rcId}
  73. </if>
  74. <if test="statusCd !=null and statusCd != ''">
  75. and t.status_cd= #{statusCd}
  76. </if>
  77. <if test="communityId !=null and communityId != ''">
  78. and t.community_id= #{communityId}
  79. </if>
  80. <if test="storeId !=null and storeId != ''">
  81. and t.store_id= #{storeId}
  82. </if>
  83. </select>
  84. </mapper>