MaintainanceItemV1ServiceDaoImplMapper.xml 2.9 KB

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