BisInspGrowWithDao.xml 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  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.BisInspGrowWithDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.BisInspGrowWith" id="bisInspGrowWithResultMap">
  5. <result property="persId" column="PERS_ID"/>
  6. <result property="intm" column="INTM"/>
  7. <result property="uptm" column="UPTM"/>
  8. <result property="dataStat" column="DATA_STAT"/>
  9. <result property="id" column="ID"/>
  10. <result property="rgstrId" column="RGSTR_ID"/>
  11. <result property="isCoorIden" column="IS_COOR_IDEN"/>
  12. <result property="isElecEqui" column="IS_ELEC_EQUI"/>
  13. <result property="isWaterEqui" column="IS_WATER_EQUI"/>
  14. <result property="isWaterElec" column="IS_WATER_ELEC"/>
  15. <result property="isWaterIndex" column="IS_WATER_INDEX"/>
  16. <result property="isElecIndex" column="IS_ELEC_INDEX"/>
  17. <result property="isCardHaving" column="IS_CARD_HAVING"/>
  18. <result property="isReportHaving" column="IS_REPORT_HAVING"/>
  19. <result property="isProblemOther" column="IS_PROBLEM_OTHER"/>
  20. <result property="state" column="STATE"/>
  21. </resultMap>
  22. <sql id="table_columns">
  23. PERS_ID,
  24. INTM,
  25. UPTM,
  26. DATA_STAT,
  27. ID,
  28. RGSTR_ID,
  29. IS_COOR_IDEN,
  30. IS_ELEC_EQUI,
  31. IS_WATER_EQUI,
  32. IS_WATER_ELEC,
  33. IS_WATER_INDEX,
  34. IS_ELEC_INDEX,
  35. IS_CARD_HAVING,
  36. IS_REPORT_HAVING,
  37. IS_PROBLEM_OTHER,
  38. STATE
  39. </sql>
  40. <sql id="entity_properties">
  41. #{persId},
  42. #{intm},
  43. #{uptm},
  44. #{dataStat},
  45. #{id},
  46. #{rgstrId},
  47. #{isCoorIden},
  48. #{isElecEqui},
  49. #{isWaterEqui},
  50. #{isWaterElec},
  51. #{isWaterIndex},
  52. #{isElecIndex},
  53. #{isCardHaving},
  54. #{isReportHaving},
  55. #{isProblemOther},
  56. #{state}
  57. </sql>
  58. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  59. <sql id="page_where">
  60. <trim prefix="where" prefixOverrides="and | or ">
  61. <if test="intm != null">and INTM = #{intm}</if>
  62. <if test="uptm != null">and UPTM = #{uptm}</if>
  63. <if test="dataStat != null and dataStat != ''">and DATA_STAT = #{dataStat}</if>
  64. <if test="id != null and id != ''">and ID = #{id}</if>
  65. <if test="rgstrId != null and rgstrId != ''">and RGSTR_ID = #{rgstrId}</if>
  66. <if test="isCoorIden != null and isCoorIden != ''">and IS_COOR_IDEN = #{isCoorIden}</if>
  67. <if test="isElecEqui != null and isElecEqui != ''">and IS_ELEC_EQUI = #{isElecEqui}</if>
  68. <if test="isWaterEqui != null and isWaterEqui != ''">and IS_WATER_EQUI = #{isWaterEqui}</if>
  69. <if test="isWaterElec != null and isWaterElec != ''">and IS_WATER_ELEC = #{isWaterElec}</if>
  70. <if test="isWaterIndex != null and isWaterIndex != ''">and IS_WATER_INDEX = #{isWaterIndex}</if>
  71. <if test="isElecIndex != null and isElecIndex != ''">and IS_ELEC_INDEX = #{isElecIndex}</if>
  72. <if test="isCardHaving != null and isCardHaving != ''">and IS_CARD_HAVING = #{isCardHaving}</if>
  73. <if test="isReportHaving != null and isReportHaving != ''">and IS_REPORT_HAVING = #{isReportHaving}</if>
  74. <if test="isProblemOther != null and isProblemOther != ''">and IS_PROBLEM_OTHER = #{isProblemOther}</if>
  75. <if test="state != null and state != ''">and STATE = #{state}</if>
  76. </trim>
  77. </sql>
  78. <select id="get" resultMap="bisInspGrowWithResultMap" parameterType="String" >
  79. select <include refid="table_columns" /> from BIS_INSP_GROW_WITH where RGSTR_ID = #{id}
  80. </select>
  81. <select id="getBy" resultMap="bisInspGrowWithResultMap">
  82. select <include refid="table_columns" /> from BIS_INSP_GROW_WITH <include refid="page_where" />
  83. </select>
  84. <select id="findAll" resultMap="bisInspGrowWithResultMap">
  85. select <include refid="table_columns" /> from BIS_INSP_GROW_WITH
  86. </select>
  87. <select id="findList" resultMap="bisInspGrowWithResultMap">
  88. select <include refid="table_columns" /> from BIS_INSP_GROW_WITH <include refid="page_where" />
  89. </select>
  90. <select id="selectCount" resultType="int" >
  91. select count(ID) from BIS_INSP_GROW_WITH <include refid="page_where" />
  92. </select>
  93. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspGrowWith">
  94. insert into BIS_INSP_GROW_WITH( <include refid="table_columns" /> )
  95. values ( <include refid="entity_properties" /> )
  96. </insert>
  97. <delete id="delete" parameterType="java.lang.String">
  98. update BIS_INSP_GROW_WITH set DATA_STAT='9' where ID = #{id}
  99. </delete>
  100. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspGrowWith">
  101. delete from BIS_INSP_GROW_WITH <include refid="page_where" />
  102. </delete>
  103. <update id="deleteInFlag" parameterType="java.lang.String">
  104. update BIS_INSP_GROW_WITH set flag_valid = 0 where ID = #{id}
  105. </update>
  106. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspGrowWith">
  107. update BIS_INSP_GROW_WITH
  108. <trim prefix="set" suffixOverrides=",">
  109. <if test="intm != null">INTM = #{intm},</if>
  110. <if test="uptm != null">UPTM = #{uptm},</if>
  111. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  112. <if test="id != null and id != ''">ID = #{id},</if>
  113. <if test="rgstrId != null and rgstrId != ''">RGSTR_ID = #{rgstrId},</if>
  114. <if test="isCoorIden != null and isCoorIden != ''">IS_COOR_IDEN = #{isCoorIden},</if>
  115. <if test="isElecEqui != null and isElecEqui != ''">IS_ELEC_EQUI = #{isElecEqui},</if>
  116. <if test="isWaterEqui != null and isWaterEqui != ''">IS_WATER_EQUI = #{isWaterEqui},</if>
  117. <if test="isWaterElec != null and isWaterElec != ''">IS_WATER_ELEC = #{isWaterElec},</if>
  118. <if test="isWaterIndex != null and isWaterIndex != ''">IS_WATER_INDEX = #{isWaterIndex},</if>
  119. <if test="isElecIndex != null and isElecIndex != ''">IS_ELEC_INDEX = #{isElecIndex},</if>
  120. <if test="isCardHaving != null and isCardHaving != ''">IS_CARD_HAVING = #{isCardHaving},</if>
  121. <if test="isReportHaving != null and isReportHaving != ''">IS_REPORT_HAVING = #{isReportHaving},</if>
  122. <if test="isProblemOther != null and isProblemOther != ''">IS_PROBLEM_OTHER = #{isProblemOther},</if>
  123. <if test="state != null and state != ''">STATE = #{state},</if>
  124. </trim>
  125. <where>ID = #{id}</where>
  126. </update>
  127. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspGrowWith">
  128. update BIS_INSP_GROW_WITH
  129. <trim prefix="set" suffixOverrides=",">
  130. <if test="intm != null">INTM = #{intm},</if>
  131. <if test="uptm != null">UPTM = #{uptm},</if>
  132. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  133. <if test="id != null and id != ''">ID = #{id},</if>
  134. <if test="rgstrId != null and rgstrId != ''">RGSTR_ID = #{rgstrId},</if>
  135. <if test="isCoorIden != null and isCoorIden != ''">IS_COOR_IDEN = #{isCoorIden},</if>
  136. <if test="isElecEqui != null and isElecEqui != ''">IS_ELEC_EQUI = #{isElecEqui},</if>
  137. <if test="isWaterEqui != null and isWaterEqui != ''">IS_WATER_EQUI = #{isWaterEqui},</if>
  138. <if test="isWaterElec != null and isWaterElec != ''">IS_WATER_ELEC = #{isWaterElec},</if>
  139. <if test="isWaterIndex != null and isWaterIndex != ''">IS_WATER_INDEX = #{isWaterIndex},</if>
  140. <if test="isElecIndex != null and isElecIndex != ''">IS_ELEC_INDEX = #{isElecIndex},</if>
  141. <if test="isCardHaving != null and isCardHaving != ''">IS_CARD_HAVING = #{isCardHaving},</if>
  142. <if test="isReportHaving != null and isReportHaving != ''">IS_REPORT_HAVING = #{isReportHaving},</if>
  143. <if test="isProblemOther != null and isProblemOther != ''">IS_PROBLEM_OTHER = #{isProblemOther},</if>
  144. <if test="state != null and state != ''">STATE = #{state},</if>
  145. </trim>
  146. <include refid="page_where" />
  147. </update>
  148. <!-- 其他自定义SQL -->
  149. </mapper>