BisNewDcuserRelVillDao.xml 5.5 KB

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