BisInspRectFdbkDao.xml 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="cn.com.goldenwater.dcproj.dao.BisInspRectFdbkDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.BisInspRectFdbk" id="bisInspRectFdbkResultMap">
  5. <result property="guid" column="GUID"/>
  6. <result property="pblmId" column="PBLM_ID"/>
  7. <result property="orgGuid" column="ORG_GUID"/>
  8. <result property="rectMeas" column="RECT_MEAS"/>
  9. <result property="rectConc" column="RECT_CONC"/>
  10. <result property="dataStat" column="DATA_STAT"/>
  11. <result property="collTime" column="COLL_TIME"/>
  12. <result property="recPers" column="REC_PERS"/>
  13. <result property="note" column="NOTE"/>
  14. <result property="hasVed" column="HAS_VED"/>
  15. </resultMap>
  16. <sql id="table_columns">
  17. GUID,
  18. PBLM_ID,
  19. ORG_GUID,
  20. RECT_MEAS,
  21. RECT_CONC,
  22. DATA_STAT,
  23. COLL_TIME,
  24. REC_PERS,
  25. NOTE,HAS_VED
  26. </sql>
  27. <sql id="entity_properties">
  28. #{guid},
  29. #{pblmId},
  30. #{orgGuid},
  31. #{rectMeas},
  32. #{rectConc},
  33. #{dataStat},
  34. #{collTime},
  35. #{recPers},
  36. #{note},#{hasVed}
  37. </sql>
  38. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  39. <sql id="page_where">
  40. <trim prefix="where" prefixOverrides="and | or ">
  41. <if test="pblmId != null and pblmId != ''">and PBLM_ID = #{pblmId}</if>
  42. <if test="orgGuid != null and orgGuid != ''">and ORG_GUID = #{orgGuid}</if>
  43. <if test="rectMeas != null and rectMeas != ''">and RECT_MEAS = #{rectMeas}</if>
  44. <if test="rectConc != null and rectConc != ''">and RECT_CONC = #{rectConc}</if>
  45. <if test="dataStat != null and dataStat != ''">and DATA_STAT = #{dataStat}</if>
  46. <if test="collTime != null">and COLL_TIME = #{collTime}</if>
  47. <if test="recPers != null and recPers != ''">and REC_PERS = #{recPers}</if>
  48. <if test="note != null and note != ''">and NOTE = #{note}</if>
  49. <if test="hasVed != null and hasVed != ''">and HAS_VED = #{hasVed}</if>
  50. </trim>
  51. </sql>
  52. <select id="get" resultMap="bisInspRectFdbkResultMap" parameterType="String">
  53. select
  54. <include refid="table_columns"/>
  55. from bis_insp_rect_fdbk where GUID = #{id}
  56. </select>
  57. <select id="getBy" resultMap="bisInspRectFdbkResultMap">
  58. select GUID,
  59. PBLM_ID, ORG_GUID,
  60. RECT_MEAS, (case when RECT_CONC is null then '0' else RECT_CONC end) as RECT_CONC, DATA_STAT,
  61. COLL_TIME,REC_PERS,HAS_VED as has_Ved,
  62. NOTE from bis_insp_rect_fdbk
  63. <include refid="page_where"/>
  64. </select>
  65. <select id="findAll" resultMap="bisInspRectFdbkResultMap">
  66. select
  67. <include refid="table_columns"/>
  68. from bis_insp_rect_fdbk
  69. </select>
  70. <select id="findList" resultMap="bisInspRectFdbkResultMap">
  71. select
  72. <include refid="table_columns"/>
  73. from bis_insp_rect_fdbk
  74. <include refid="page_where"/>
  75. order by COLL_TIME desc
  76. </select>
  77. <select id="selectCount" resultType="int">
  78. select count(ID) from bis_insp_rect_fdbk
  79. <include refid="page_where"/>
  80. </select>
  81. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspRectFdbk">
  82. insert into bis_insp_rect_fdbk(
  83. <include refid="table_columns"/>
  84. )
  85. values (
  86. <include refid="entity_properties"/>
  87. )
  88. </insert>
  89. <delete id="delete" parameterType="java.lang.String">
  90. delete from bis_insp_rect_fdbk where GUID = #{id}
  91. </delete>
  92. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspRectFdbk">
  93. delete from bis_insp_rect_fdbk
  94. <include refid="page_where"/>
  95. </delete>
  96. <update id="deleteInFlag" parameterType="java.lang.String">
  97. update bis_insp_rect_fdbk set flag_valid = 0 where GUID = #{id}
  98. </update>
  99. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspRectFdbk">
  100. update bis_insp_rect_fdbk
  101. <trim prefix="set" suffixOverrides=",">
  102. <if test="pblmId != null and pblmId != ''">PBLM_ID = #{pblmId},</if>
  103. <if test="orgGuid != null and orgGuid != ''">ORG_GUID = #{orgGuid},</if>
  104. <if test="rectMeas != null and rectMeas != ''">RECT_MEAS = #{rectMeas},</if>
  105. <if test="rectConc != null and rectConc != ''">RECT_CONC = #{rectConc},</if>
  106. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  107. <if test="collTime != null">COLL_TIME = #{collTime},</if>
  108. <if test="recPers != null and recPers != ''">REC_PERS = #{recPers},</if>
  109. <if test="note != null and note != ''">NOTE = #{note},</if>
  110. <if test="hasVed != null and hasVed != ''">has_Ved = #{hasVed},</if>
  111. </trim>
  112. <where>GUID = #{id}</where>
  113. </update>
  114. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspRectFdbk">
  115. update bis_insp_rect_fdbk
  116. <trim prefix="set" suffixOverrides=",">
  117. <if test="pblmId != null and pblmId != ''">PBLM_ID = #{pblmId},</if>
  118. <if test="orgGuid != null and orgGuid != ''">ORG_GUID = #{orgGuid},</if>
  119. <if test="rectMeas != null and rectMeas != ''">RECT_MEAS = #{rectMeas},</if>
  120. <if test="rectConc != null and rectConc != ''">RECT_CONC = #{rectConc},</if>
  121. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  122. <if test="collTime != null">COLL_TIME = #{collTime},</if>
  123. <if test="recPers != null and recPers != ''">REC_PERS = #{recPers},</if>
  124. <if test="note != null and note != ''">NOTE = #{note},</if>
  125. <if test="hasVed != null and hasVed != ''">has_Ved = #{hasVed},</if>
  126. </trim>
  127. <include refid="page_where"/>
  128. </update>
  129. <!-- 其他自定义SQL -->
  130. </mapper>