InspectionItemTitleV1ServiceDaoImplMapper.xml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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="inspectionItemTitleV1ServiceDaoImpl">
  6. <!-- 保存项目题目信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveInspectionItemTitleInfo" parameterType="Map">
  8. insert into inspection_item_title(
  9. item_id,title_type,item_title,title_id,community_id,seq
  10. ) values (
  11. #{itemId},#{titleType},#{itemTitle},#{titleId},#{communityId},#{seq}
  12. )
  13. </insert>
  14. <!-- 查询项目题目信息 add by wuxw 2018-07-03 -->
  15. <select id="getInspectionItemTitleInfo" parameterType="Map" resultType="Map">
  16. select t.item_id,t.item_id itemId,t.title_type,t.title_type titleType,t.item_title,t.item_title
  17. itemTitle,t.title_id,t.title_id titleId,t.status_cd,t.status_cd statusCd,t.community_id,t.community_id
  18. communityId,t.seq,t.create_time createTime
  19. from inspection_item_title t
  20. where 1 =1
  21. <if test="itemId !=null and itemId != ''">
  22. and t.item_id= #{itemId}
  23. </if>
  24. <if test="titleType !=null and titleType != ''">
  25. and t.title_type= #{titleType}
  26. </if>
  27. <if test="itemTitle !=null and itemTitle != ''">
  28. and t.item_title= #{itemTitle}
  29. </if>
  30. <if test="titleId !=null and titleId != ''">
  31. and t.title_id= #{titleId}
  32. </if>
  33. <if test="statusCd !=null and statusCd != ''">
  34. and t.status_cd= #{statusCd}
  35. </if>
  36. <if test="communityId !=null and communityId != ''">
  37. and t.community_id= #{communityId}
  38. </if>
  39. <if test="seq !=null and seq != ''">
  40. and t.seq= #{seq}
  41. </if>
  42. order by t.seq
  43. <if test="page != -1 and page != null ">
  44. limit #{page}, #{row}
  45. </if>
  46. </select>
  47. <!-- 修改项目题目信息 add by wuxw 2018-07-03 -->
  48. <update id="updateInspectionItemTitleInfo" parameterType="Map">
  49. update inspection_item_title t set t.status_cd = #{statusCd}
  50. <if test="newBId != null and newBId != ''">
  51. ,t.b_id = #{newBId}
  52. </if>
  53. <if test="itemId !=null and itemId != ''">
  54. , t.item_id= #{itemId}
  55. </if>
  56. <if test="titleType !=null and titleType != ''">
  57. , t.title_type= #{titleType}
  58. </if>
  59. <if test="itemTitle !=null and itemTitle != ''">
  60. , t.item_title= #{itemTitle}
  61. </if>
  62. <if test="communityId !=null and communityId != ''">
  63. , t.community_id= #{communityId}
  64. </if>
  65. <if test="seq !=null and seq != ''">
  66. , t.seq= #{seq}
  67. </if>
  68. where 1=1
  69. <if test="titleId !=null and titleId != ''">
  70. and t.title_id= #{titleId}
  71. </if>
  72. </update>
  73. <!-- 查询项目题目数量 add by wuxw 2018-07-03 -->
  74. <select id="queryInspectionItemTitlesCount" parameterType="Map" resultType="Map">
  75. select count(1) count
  76. from inspection_item_title t
  77. where 1 =1
  78. <if test="itemId !=null and itemId != ''">
  79. and t.item_id= #{itemId}
  80. </if>
  81. <if test="titleType !=null and titleType != ''">
  82. and t.title_type= #{titleType}
  83. </if>
  84. <if test="itemTitle !=null and itemTitle != ''">
  85. and t.item_title= #{itemTitle}
  86. </if>
  87. <if test="titleId !=null and titleId != ''">
  88. and t.title_id= #{titleId}
  89. </if>
  90. <if test="statusCd !=null and statusCd != ''">
  91. and t.status_cd= #{statusCd}
  92. </if>
  93. <if test="communityId !=null and communityId != ''">
  94. and t.community_id= #{communityId}
  95. </if>
  96. <if test="seq !=null and seq != ''">
  97. and t.seq= #{seq}
  98. </if>
  99. </select>
  100. </mapper>