BisRdwspRgstrRelVillDao.xml 6.4 KB

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