BisZhejiangDcuserRelVillDao.xml 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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.BisZhejiangDcuserRelVillDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.BisZhejiangDcuserRelVill" id="bisZhejiangDcuserRelVillResultMap">
  5. <result property="id" column="ID"/>
  6. <result property="villCode" column="VILL_CODE"/>
  7. <result property="rgstrId" column="RGSTR_ID"/>
  8. <result property="villageNm" column="VILLAGE_NM"/>
  9. <result property="adCode" column="AD_CODE"/>
  10. <result property="persId" column="PERS_ID"/>
  11. <result property="recPers2" column="REC_PERS2"/>
  12. <result property="createTime" column="CREATE_TIME"/>
  13. <result property="updateTime" column="UPDATE_TIME"/>
  14. <result property="status" column="STATUS"/>
  15. <result property="townName" column="TOWN_NAME"/>
  16. </resultMap>
  17. <sql id="table_columns">
  18. ID,
  19. VILL_CODE,
  20. RGSTR_ID,
  21. VILLAGE_NM,
  22. AD_CODE,
  23. PERS_ID,
  24. REC_PERS2,
  25. CREATE_TIME,
  26. UPDATE_TIME,
  27. STATUS,
  28. TOWN_NAME
  29. </sql>
  30. <sql id="entity_properties">
  31. #{id},
  32. #{villCode},
  33. #{rgstrId},
  34. #{villageNm},
  35. #{adCode},
  36. #{persId},
  37. #{recPers2},
  38. #{createTime},
  39. #{updateTime},
  40. #{status},
  41. #{townName}
  42. </sql>
  43. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  44. <sql id="page_where">
  45. <trim prefix="where" prefixOverrides="and | or ">
  46. <if test="villCode != null and villCode != ''">and VILL_CODE = #{villCode}</if>
  47. <if test="rgstrId != null and rgstrId != ''">and RGSTR_ID = #{rgstrId}</if>
  48. <if test="villageNm != null and villageNm != ''">and VILLAGE_NM = #{villageNm}</if>
  49. <if test="adCode != null and adCode != ''">and AD_CODE = #{adCode}</if>
  50. <if test="persId != null and persId != ''">and PERS_ID = #{persId}</if>
  51. <if test="recPers2 != null and recPers2 != ''">and REC_PERS2 = #{recPers2}</if>
  52. <if test="createTime != null">and CREATE_TIME = #{createTime}</if>
  53. <if test="updateTime != null">and UPDATE_TIME = #{updateTime}</if>
  54. <if test="status != null and status != ''">and STATUS = #{status}</if>
  55. <if test="townName != null and townName != ''">and TOWN_NAME = #{townName}</if>
  56. </trim>
  57. </sql>
  58. <select id="get" resultMap="bisZhejiangDcuserRelVillResultMap" parameterType="String" >
  59. select <include refid="table_columns" /> from BIS_ZHEJIANG_DCUSER_REL_VILL where ID = #{id}
  60. </select>
  61. <select id="getBy" resultMap="bisZhejiangDcuserRelVillResultMap">
  62. select <include refid="table_columns" /> from BIS_ZHEJIANG_DCUSER_REL_VILL <include refid="page_where" />
  63. </select>
  64. <select id="findAll" resultMap="bisZhejiangDcuserRelVillResultMap">
  65. select <include refid="table_columns" /> from BIS_ZHEJIANG_DCUSER_REL_VILL
  66. </select>
  67. <select id="findList" resultMap="bisZhejiangDcuserRelVillResultMap">
  68. select <include refid="table_columns" /> from BIS_ZHEJIANG_DCUSER_REL_VILL <include refid="page_where" />
  69. </select>
  70. <select id="selectCount" resultType="int" >
  71. select count(ID) from BIS_ZHEJIANG_DCUSER_REL_VILL <include refid="page_where" />
  72. </select>
  73. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisZhejiangDcuserRelVill">
  74. insert into BIS_ZHEJIANG_DCUSER_REL_VILL( <include refid="table_columns" /> )
  75. values ( <include refid="entity_properties" /> )
  76. </insert>
  77. <delete id="delete" parameterType="java.lang.String">
  78. delete from BIS_ZHEJIANG_DCUSER_REL_VILL where ID = #{id}
  79. </delete>
  80. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisZhejiangDcuserRelVill">
  81. delete from BIS_ZHEJIANG_DCUSER_REL_VILL <include refid="page_where" />
  82. </delete>
  83. <update id="deleteInFlag" parameterType="java.lang.String">
  84. update BIS_ZHEJIANG_DCUSER_REL_VILL set flag_valid = 0 where ID = #{id}
  85. </update>
  86. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisZhejiangDcuserRelVill">
  87. update BIS_ZHEJIANG_DCUSER_REL_VILL
  88. <trim prefix="set" suffixOverrides=",">
  89. <if test="villCode != null and villCode != ''">VILL_CODE = #{villCode},</if>
  90. <if test="rgstrId != null and rgstrId != ''">RGSTR_ID = #{rgstrId},</if>
  91. <if test="villageNm != null and villageNm != ''">VILLAGE_NM = #{villageNm},</if>
  92. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  93. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  94. <if test="recPers2 != null and recPers2 != ''">REC_PERS2 = #{recPers2},</if>
  95. <if test="createTime != null">CREATE_TIME = #{createTime},</if>
  96. <if test="updateTime != null">UPDATE_TIME = #{updateTime},</if>
  97. <if test="status != null and status != ''">STATUS = #{status},</if>
  98. <if test="townName != null and townName != ''">TOWN_NAME = #{townName},</if>
  99. </trim>
  100. <where>ID = #{id}</where>
  101. </update>
  102. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisZhejiangDcuserRelVill">
  103. update BIS_ZHEJIANG_DCUSER_REL_VILL
  104. <trim prefix="set" suffixOverrides=",">
  105. <if test="villCode != null and villCode != ''">VILL_CODE = #{villCode},</if>
  106. <if test="rgstrId != null and rgstrId != ''">RGSTR_ID = #{rgstrId},</if>
  107. <if test="villageNm != null and villageNm != ''">VILLAGE_NM = #{villageNm},</if>
  108. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  109. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  110. <if test="recPers2 != null and recPers2 != ''">REC_PERS2 = #{recPers2},</if>
  111. <if test="createTime != null">CREATE_TIME = #{createTime},</if>
  112. <if test="updateTime != null">UPDATE_TIME = #{updateTime},</if>
  113. <if test="status != null and status != ''">STATUS = #{status},</if>
  114. <if test="townName != null and townName != ''">TOWN_NAME = #{townName},</if>
  115. </trim>
  116. <include refid="page_where" />
  117. </update>
  118. <!-- 其他自定义SQL -->
  119. </mapper>