ReserveCatalogV1ServiceDaoImplMapper.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="reserveCatalogV1ServiceDaoImpl">
  6. <!-- 保存预约目录信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveReserveCatalogInfo" parameterType="Map">
  8. insert into reserve_catalog(
  9. catalog_id,name,sort,state,community_id,type
  10. ) values (
  11. #{catalogId},#{name},#{sort},#{state},#{communityId},#{type}
  12. )
  13. </insert>
  14. <!-- 查询预约目录信息 add by wuxw 2018-07-03 -->
  15. <select id="getReserveCatalogInfo" parameterType="Map" resultType="Map">
  16. select t.catalog_id,t.catalog_id catalogId,t.name,t.status_cd,t.status_cd
  17. statusCd,t.sort,t.state,t.community_id,t.community_id communityId,t.type,t.create_time createTime
  18. from reserve_catalog t
  19. where 1 =1
  20. <if test="catalogId !=null and catalogId != ''">
  21. and t.catalog_id= #{catalogId}
  22. </if>
  23. <if test="name !=null and name != ''">
  24. and t.name= #{name}
  25. </if>
  26. <if test="statusCd !=null and statusCd != ''">
  27. and t.status_cd= #{statusCd}
  28. </if>
  29. <if test="sort !=null and sort != ''">
  30. and t.sort= #{sort}
  31. </if>
  32. <if test="state !=null and state != ''">
  33. and t.state= #{state}
  34. </if>
  35. <if test="communityId !=null and communityId != ''">
  36. and t.community_id= #{communityId}
  37. </if>
  38. <if test="type !=null and type != ''">
  39. and t.type= #{type}
  40. </if>
  41. order by t.sort
  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="updateReserveCatalogInfo" parameterType="Map">
  48. update reserve_catalog t set t.status_cd = #{statusCd}
  49. <if test="newBId != null and newBId != ''">
  50. ,t.b_id = #{newBId}
  51. </if>
  52. <if test="name !=null and name != ''">
  53. , t.name= #{name}
  54. </if>
  55. <if test="sort !=null and sort != ''">
  56. , t.sort= #{sort}
  57. </if>
  58. <if test="state !=null and state != ''">
  59. , t.state= #{state}
  60. </if>
  61. <if test="communityId !=null and communityId != ''">
  62. , t.community_id= #{communityId}
  63. </if>
  64. <if test="type !=null and type != ''">
  65. , t.type= #{type}
  66. </if>
  67. where 1=1
  68. <if test="catalogId !=null and catalogId != ''">
  69. and t.catalog_id= #{catalogId}
  70. </if>
  71. </update>
  72. <!-- 查询预约目录数量 add by wuxw 2018-07-03 -->
  73. <select id="queryReserveCatalogsCount" parameterType="Map" resultType="Map">
  74. select count(1) count
  75. from reserve_catalog t
  76. where 1 =1
  77. <if test="catalogId !=null and catalogId != ''">
  78. and t.catalog_id= #{catalogId}
  79. </if>
  80. <if test="name !=null and name != ''">
  81. and t.name= #{name}
  82. </if>
  83. <if test="statusCd !=null and statusCd != ''">
  84. and t.status_cd= #{statusCd}
  85. </if>
  86. <if test="sort !=null and sort != ''">
  87. and t.sort= #{sort}
  88. </if>
  89. <if test="state !=null and state != ''">
  90. and t.state= #{state}
  91. </if>
  92. <if test="communityId !=null and communityId != ''">
  93. and t.community_id= #{communityId}
  94. </if>
  95. <if test="type !=null and type != ''">
  96. and t.type= #{type}
  97. </if>
  98. </select>
  99. </mapper>