OwnerSettledApplyV1ServiceDaoImplMapper.xml 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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="ownerSettledApplyV1ServiceDaoImpl">
  6. <!-- 保存业主入驻申请信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveOwnerSettledApplyInfo" parameterType="Map">
  8. insert into owner_settled_apply(
  9. apply_id,create_user_id,remark,state,owner_id,community_id
  10. ) values (
  11. #{applyId},#{createUserId},#{remark},#{state},#{ownerId},#{communityId}
  12. )
  13. </insert>
  14. <!-- 查询业主入驻申请信息 add by wuxw 2018-07-03 -->
  15. <select id="getOwnerSettledApplyInfo" parameterType="Map" resultType="Map">
  16. select t.apply_id,t.apply_id applyId,t.create_user_id,t.create_user_id
  17. createUserId,t.remark,t.state,t.owner_id,t.owner_id
  18. ownerId,t.community_id,t.community_id communityId,t.create_time createTime,td.name stateName,bo.`name` ownerName,bo.link ownerLink,
  19. count(osr.room_id) roomCount
  20. from owner_settled_apply t
  21. left join building_owner bo on t.owner_id = bo.member_id and bo.status_cd = '0'
  22. left join t_dict td on t.state = td.status_cd and td.table_name = 'owner_settled_apply' and td.table_columns = 'state'
  23. left join owner_settled_rooms osr on t.apply_id = osr.apply_id and osr.status_cd = '0'
  24. where 1 =1
  25. <if test="applyId !=null and applyId != ''">
  26. and t.apply_id= #{applyId}
  27. </if>
  28. <if test="createUserId !=null and createUserId != ''">
  29. and t.create_user_id= #{createUserId}
  30. </if>
  31. <if test="ownerNameLike !=null and ownerNameLike != ''">
  32. and bo.name like concat('%',#{ownerNameLike},'%')
  33. </if>
  34. <if test="remark !=null and remark != ''">
  35. and t.remark= #{remark}
  36. </if>
  37. <if test="statusCd !=null and statusCd != ''">
  38. and t.status_cd= #{statusCd}
  39. </if>
  40. <if test="state !=null and state != ''">
  41. and t.state= #{state}
  42. </if>
  43. <if test="ownerId !=null and ownerId != ''">
  44. and t.owner_id= #{ownerId}
  45. </if>
  46. <if test="communityId !=null and communityId != ''">
  47. and t.community_id= #{communityId}
  48. </if>
  49. group by t.apply_id,t.create_user_id,t.remark,t.state,t.owner_id,t.community_id,t.create_time ,td.name ,bo.`name` ,bo.link
  50. order by t.create_time desc
  51. <if test="page != -1 and page != null ">
  52. limit #{page}, #{row}
  53. </if>
  54. </select>
  55. <!-- 修改业主入驻申请信息 add by wuxw 2018-07-03 -->
  56. <update id="updateOwnerSettledApplyInfo" parameterType="Map">
  57. update owner_settled_apply t set t.status_cd = #{statusCd}
  58. <if test="newBId != null and newBId != ''">
  59. ,t.b_id = #{newBId}
  60. </if>
  61. <if test="createUserId !=null and createUserId != ''">
  62. , t.create_user_id= #{createUserId}
  63. </if>
  64. <if test="remark !=null and remark != ''">
  65. , t.remark= #{remark}
  66. </if>
  67. <if test="state !=null and state != ''">
  68. , t.state= #{state}
  69. </if>
  70. <if test="ownerId !=null and ownerId != ''">
  71. , t.owner_id= #{ownerId}
  72. </if>
  73. <if test="communityId !=null and communityId != ''">
  74. , t.community_id= #{communityId}
  75. </if>
  76. where 1=1
  77. <if test="applyId !=null and applyId != ''">
  78. and t.apply_id= #{applyId}
  79. </if>
  80. </update>
  81. <!-- 查询业主入驻申请数量 add by wuxw 2018-07-03 -->
  82. <select id="queryOwnerSettledApplysCount" parameterType="Map" resultType="Map">
  83. select count(1) count
  84. from owner_settled_apply t
  85. left join building_owner bo on t.owner_id = bo.member_id and bo.status_cd = '0'
  86. where 1 =1
  87. <if test="applyId !=null and applyId != ''">
  88. and t.apply_id= #{applyId}
  89. </if>
  90. <if test="createUserId !=null and createUserId != ''">
  91. and t.create_user_id= #{createUserId}
  92. </if>
  93. <if test="ownerNameLike !=null and ownerNameLike != ''">
  94. and bo.name like concat('%',#{ownerNameLike},'%')
  95. </if>
  96. <if test="remark !=null and remark != ''">
  97. and t.remark= #{remark}
  98. </if>
  99. <if test="statusCd !=null and statusCd != ''">
  100. and t.status_cd= #{statusCd}
  101. </if>
  102. <if test="state !=null and state != ''">
  103. and t.state= #{state}
  104. </if>
  105. <if test="ownerId !=null and ownerId != ''">
  106. and t.owner_id= #{ownerId}
  107. </if>
  108. <if test="communityId !=null and communityId != ''">
  109. and t.community_id= #{communityId}
  110. </if>
  111. </select>
  112. </mapper>