BisInspVillqhRgstrRelVillDao.xml 7.2 KB

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