OrgV1ServiceDaoImplMapper.xml 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  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="orgV1ServiceDaoImpl">
  6. <!-- 保存组织信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveOrgInfo" parameterType="Map">
  8. insert into u_org(
  9. belong_community_id,org_name,parent_org_id,allow_operation,description,org_level,store_id,org_id
  10. ) values (
  11. #{belongCommunityId},#{orgName},#{parentOrgId},#{allowOperation},#{description},#{orgLevel},#{storeId},#{orgId}
  12. )
  13. </insert>
  14. <!-- 查询组织信息 add by wuxw 2018-07-03 -->
  15. <select id="getOrgInfo" parameterType="Map" resultType="Map">
  16. select t.belong_community_id,t.belong_community_id belongCommunityId,t.org_name,t.org_name
  17. orgName,t.parent_org_id,t.parent_org_id parentOrgId,t.allow_operation,t.allow_operation
  18. allowOperation,t.description,t.org_level,t.org_level orgLevel,t.status_cd,t.status_cd
  19. statusCd,t.store_id,t.store_id storeId,t.org_id,t.org_id orgId
  20. from u_org t
  21. where 1 =1
  22. <if test="belongCommunityId !=null and belongCommunityId != ''">
  23. and t.belong_community_id= #{belongCommunityId}
  24. </if>
  25. <if test="orgName !=null and orgName != ''">
  26. and t.org_name= #{orgName}
  27. </if>
  28. <if test="parentOrgId !=null and parentOrgId != ''">
  29. and t.parent_org_id= #{parentOrgId}
  30. </if>
  31. <if test="allowOperation !=null and allowOperation != ''">
  32. and t.allow_operation= #{allowOperation}
  33. </if>
  34. <if test="description !=null and description != ''">
  35. and t.description= #{description}
  36. </if>
  37. <if test="orgLevel !=null and orgLevel != ''">
  38. and t.org_level= #{orgLevel}
  39. </if>
  40. <if test="statusCd !=null and statusCd != ''">
  41. and t.status_cd= #{statusCd}
  42. </if>
  43. <if test="storeId !=null and storeId != ''">
  44. and t.store_id= #{storeId}
  45. </if>
  46. <if test="orgId !=null and orgId != ''">
  47. and t.org_id= #{orgId}
  48. </if>
  49. <if test="orgIds != null and orgIds.length > 0">
  50. and t.org_id in
  51. <foreach collection="orgIds" item="item" open="(" close=")" separator=",">
  52. #{item}
  53. </foreach>
  54. </if>
  55. order by t.create_time desc
  56. <if test="page != -1 and page != null ">
  57. limit #{page}, #{row}
  58. </if>
  59. </select>
  60. <!-- 修改组织信息 add by wuxw 2018-07-03 -->
  61. <update id="updateOrgInfo" parameterType="Map">
  62. update u_org t set t.status_cd = #{statusCd}
  63. <if test="newBId != null and newBId != ''">
  64. ,t.b_id = #{newBId}
  65. </if>
  66. <if test="belongCommunityId !=null and belongCommunityId != ''">
  67. , t.belong_community_id= #{belongCommunityId}
  68. </if>
  69. <if test="orgName !=null and orgName != ''">
  70. , t.org_name= #{orgName}
  71. </if>
  72. <if test="parentOrgId !=null and parentOrgId != ''">
  73. , t.parent_org_id= #{parentOrgId}
  74. </if>
  75. <if test="allowOperation !=null and allowOperation != ''">
  76. , t.allow_operation= #{allowOperation}
  77. </if>
  78. <if test="description !=null and description != ''">
  79. , t.description= #{description}
  80. </if>
  81. <if test="orgLevel !=null and orgLevel != ''">
  82. , t.org_level= #{orgLevel}
  83. </if>
  84. <if test="storeId !=null and storeId != ''">
  85. , t.store_id= #{storeId}
  86. </if>
  87. where 1=1
  88. <if test="orgId !=null and orgId != ''">
  89. and t.org_id= #{orgId}
  90. </if>
  91. </update>
  92. <!-- 查询组织数量 add by wuxw 2018-07-03 -->
  93. <select id="queryOrgsCount" parameterType="Map" resultType="Map">
  94. select count(1) count
  95. from u_org t
  96. where 1 =1
  97. <if test="belongCommunityId !=null and belongCommunityId != ''">
  98. and t.belong_community_id= #{belongCommunityId}
  99. </if>
  100. <if test="orgName !=null and orgName != ''">
  101. and t.org_name= #{orgName}
  102. </if>
  103. <if test="parentOrgId !=null and parentOrgId != ''">
  104. and t.parent_org_id= #{parentOrgId}
  105. </if>
  106. <if test="allowOperation !=null and allowOperation != ''">
  107. and t.allow_operation= #{allowOperation}
  108. </if>
  109. <if test="description !=null and description != ''">
  110. and t.description= #{description}
  111. </if>
  112. <if test="orgLevel !=null and orgLevel != ''">
  113. and t.org_level= #{orgLevel}
  114. </if>
  115. <if test="statusCd !=null and statusCd != ''">
  116. and t.status_cd= #{statusCd}
  117. </if>
  118. <if test="storeId !=null and storeId != ''">
  119. and t.store_id= #{storeId}
  120. </if>
  121. <if test="orgId !=null and orgId != ''">
  122. and t.org_id= #{orgId}
  123. </if>
  124. </select>
  125. </mapper>