DataPrivilegeV1ServiceDaoImplMapper.xml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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="dataPrivilegeV1ServiceDaoImpl">
  6. <!-- 保存数据权限信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveDataPrivilegeInfo" parameterType="Map">
  8. insert into data_privilege(
  9. code,dp_id,name,remark,community_id
  10. ) values (
  11. #{code},#{dpId},#{name},#{remark},#{communityId}
  12. )
  13. </insert>
  14. <!-- 查询数据权限信息 add by wuxw 2018-07-03 -->
  15. <select id="getDataPrivilegeInfo" parameterType="Map" resultType="Map">
  16. select t.code,t.dp_id,t.dp_id dpId,t.name,t.remark,t.status_cd,t.status_cd
  17. statusCd,t.community_id,t.community_id communityId
  18. from data_privilege t
  19. where 1 =1
  20. <if test="code !=null and code != ''">
  21. and t.code= #{code}
  22. </if>
  23. <if test="dpId !=null and dpId != ''">
  24. and t.dp_id= #{dpId}
  25. </if>
  26. <if test="name !=null and name != ''">
  27. and t.name= #{name}
  28. </if>
  29. <if test="remark !=null and remark != ''">
  30. and t.remark= #{remark}
  31. </if>
  32. <if test="statusCd !=null and statusCd != ''">
  33. and t.status_cd= #{statusCd}
  34. </if>
  35. <if test="communityId !=null and communityId != ''">
  36. and t.community_id= #{communityId}
  37. </if>
  38. order by t.create_time desc
  39. <if test="page != -1 and page != null ">
  40. limit #{page}, #{row}
  41. </if>
  42. </select>
  43. <!-- 修改数据权限信息 add by wuxw 2018-07-03 -->
  44. <update id="updateDataPrivilegeInfo" parameterType="Map">
  45. update data_privilege t set t.status_cd = #{statusCd}
  46. <if test="newBId != null and newBId != ''">
  47. ,t.b_id = #{newBId}
  48. </if>
  49. <if test="code !=null and code != ''">
  50. , t.code= #{code}
  51. </if>
  52. <if test="name !=null and name != ''">
  53. , t.name= #{name}
  54. </if>
  55. <if test="remark !=null and remark != ''">
  56. , t.remark= #{remark}
  57. </if>
  58. where 1=1
  59. <if test="dpId !=null and dpId != ''">
  60. and t.dp_id= #{dpId}
  61. </if>
  62. <if test="communityId !=null and communityId != ''">
  63. and t.community_id= #{communityId}
  64. </if>
  65. </update>
  66. <!-- 查询数据权限数量 add by wuxw 2018-07-03 -->
  67. <select id="queryDataPrivilegesCount" parameterType="Map" resultType="Map">
  68. select count(1) count
  69. from data_privilege t
  70. where 1 =1
  71. <if test="code !=null and code != ''">
  72. and t.code= #{code}
  73. </if>
  74. <if test="dpId !=null and dpId != ''">
  75. and t.dp_id= #{dpId}
  76. </if>
  77. <if test="name !=null and name != ''">
  78. and t.name= #{name}
  79. </if>
  80. <if test="remark !=null and remark != ''">
  81. and t.remark= #{remark}
  82. </if>
  83. <if test="statusCd !=null and statusCd != ''">
  84. and t.status_cd= #{statusCd}
  85. </if>
  86. <if test="communityId !=null and communityId != ''">
  87. and t.community_id= #{communityId}
  88. </if>
  89. </select>
  90. </mapper>