AttSamrmpBaseDao.xml 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  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.AttSamrmpBaseDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.AttSamrmpBase" id="attSamrmpBaseResultMap">
  5. <result property="id" column="ID" />
  6. <result property="prjName" column="PRJ_NAME" />
  7. <result property="rvName" column="RV_NAME" />
  8. <result property="rvLong" column="RV_LONG" />
  9. <result property="pgi" column="PGI" />
  10. <result property="adCode" column="AD_CODE" />
  11. <result property="adName" column="AD_NAME" />
  12. <result property="addr" column="ADDR" />
  13. <result property="centerX" column="CENTER_X" />
  14. <result property="centerY" column="CENTER_Y" />
  15. <result property="gdX" column="GD_X" />
  16. <result property="gdY" column="GD_Y" />
  17. <result property="intm" column="INTM" />
  18. <result property="uptm" column="UPTM" />
  19. <result property="note" column="NOTE" />
  20. </resultMap>
  21. <sql id="table_columns">
  22. ID,
  23. PRJ_NAME,
  24. RV_NAME,
  25. RV_LONG,
  26. PGI,
  27. AD_CODE,
  28. AD_NAME,
  29. ADDR,
  30. CENTER_X,
  31. CENTER_Y,
  32. GD_X,
  33. GD_Y,
  34. INTM,
  35. UPTM,
  36. NOTE
  37. </sql>
  38. <sql id="entity_properties">
  39. #{id},
  40. #{prjName},
  41. #{rvName},
  42. #{rvLong},
  43. #{pgi},
  44. #{adCode},
  45. #{adName},
  46. #{addr},
  47. #{centerX},
  48. #{centerY},
  49. #{gdX},
  50. #{gdY},
  51. #{intm},
  52. #{uptm},
  53. #{note}
  54. </sql>
  55. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  56. <sql id="page_where">
  57. <trim prefix="where" prefixOverrides="and | or ">
  58. <if test="prjName != null and prjName != ''">and PRJ_NAME = #{prjName}</if>
  59. <if test="rvName != null and rvName != ''">and RV_NAME = #{rvName}</if>
  60. <if test="rvLong != null and rvLong != ''">and RV_LONG = #{rvLong}</if>
  61. <if test="pgi != null and pgi != ''">and PGI = #{pgi}</if>
  62. <if test="adCode != null and adCode != ''">and AD_CODE = #{adCode}</if>
  63. <if test="adName != null and adName != ''">and AD_NAME = #{adName}</if>
  64. <if test="addr != null and addr != ''">and ADDR = #{addr}</if>
  65. <if test="centerX != null and centerX != ''">and CENTER_X = #{centerX}</if>
  66. <if test="centerY != null and centerY != ''">and CENTER_Y = #{centerY}</if>
  67. <if test="gdX != null and gdX != ''">and GD_X = #{gdX}</if>
  68. <if test="gdY != null and gdY != ''">and GD_Y = #{gdY}</if>
  69. <if test="intm != null">and INTM = #{intm}</if>
  70. <if test="uptm != null">and UPTM = #{uptm}</if>
  71. <if test="note != null and note != ''">and NOTE = #{note}</if>
  72. </trim>
  73. </sql>
  74. <select id="get" resultMap="attSamrmpBaseResultMap" parameterType="String" >
  75. select <include refid="table_columns" /> from ATT_SAMRMP_BASE where ID = #{id}
  76. </select>
  77. <select id="getBy" resultMap="attSamrmpBaseResultMap">
  78. select <include refid="table_columns" /> from ATT_SAMRMP_BASE <include refid="page_where" />
  79. </select>
  80. <select id="findAll" resultMap="attSamrmpBaseResultMap">
  81. select <include refid="table_columns" /> from ATT_SAMRMP_BASE
  82. </select>
  83. <select id="findList" resultMap="attSamrmpBaseResultMap">
  84. select <include refid="table_columns" /> from ATT_SAMRMP_BASE <include refid="page_where" />
  85. </select>
  86. <select id="selectCount" resultType="int" >
  87. select count(ID) from ATT_SAMRMP_BASE <include refid="page_where" />
  88. </select>
  89. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.AttSamrmpBase">
  90. insert into ATT_SAMRMP_BASE( <include refid="table_columns" /> )
  91. values ( <include refid="entity_properties" /> )
  92. </insert>
  93. <delete id="delete" parameterType="java.lang.String">
  94. delete from ATT_SAMRMP_BASE where ID = #{id}
  95. </delete>
  96. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.AttSamrmpBase">
  97. delete from ATT_SAMRMP_BASE <include refid="page_where" />
  98. </delete>
  99. <update id="deleteInFlag" parameterType="java.lang.String">
  100. update ATT_SAMRMP_BASE set flag_valid = 0 where>ID = #{id}
  101. </update>
  102. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.AttSamrmpBase">
  103. update ATT_SAMRMP_BASE
  104. <trim prefix="set" suffixOverrides=",">
  105. <if test="prjName != null and prjName != ''">PRJ_NAME = #{prjName},</if>
  106. <if test="rvName != null and rvName != ''">RV_NAME = #{rvName},</if>
  107. <if test="rvLong != null and rvLong != ''">RV_LONG = #{rvLong},</if>
  108. <if test="pgi != null and pgi != ''">PGI = #{pgi},</if>
  109. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  110. <if test="adName != null and adName != ''">AD_NAME = #{adName},</if>
  111. <if test="addr != null and addr != ''">ADDR = #{addr},</if>
  112. <if test="centerX != null and centerX != ''">CENTER_X = #{centerX},</if>
  113. <if test="centerY != null and centerY != ''">CENTER_Y = #{centerY},</if>
  114. <if test="gdX != null and gdX != ''">GD_X = #{gdX},</if>
  115. <if test="gdY != null and gdY != ''">GD_Y = #{gdY},</if>
  116. <if test="intm != null">INTM = #{intm},</if>
  117. <if test="uptm != null">UPTM = #{uptm},</if>
  118. <if test="note != null and note != ''">NOTE = #{note},</if>
  119. </trim>
  120. <where>ID = #{id}</where>
  121. </update>
  122. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.AttSamrmpBase">
  123. update ATT_SAMRMP_BASE
  124. <trim prefix="set" suffixOverrides=",">
  125. <if test="prjName != null and prjName != ''">PRJ_NAME = #{prjName},</if>
  126. <if test="rvName != null and rvName != ''">RV_NAME = #{rvName},</if>
  127. <if test="rvLong != null and rvLong != ''">RV_LONG = #{rvLong},</if>
  128. <if test="pgi != null and pgi != ''">PGI = #{pgi},</if>
  129. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  130. <if test="adName != null and adName != ''">AD_NAME = #{adName},</if>
  131. <if test="addr != null and addr != ''">ADDR = #{addr},</if>
  132. <if test="centerX != null and centerX != ''">CENTER_X = #{centerX},</if>
  133. <if test="centerY != null and centerY != ''">CENTER_Y = #{centerY},</if>
  134. <if test="gdX != null and gdX != ''">GD_X = #{gdX},</if>
  135. <if test="gdY != null and gdY != ''">GD_Y = #{gdY},</if>
  136. <if test="intm != null">INTM = #{intm},</if>
  137. <if test="uptm != null">UPTM = #{uptm},</if>
  138. <if test="note != null and note != ''">NOTE = #{note},</if>
  139. </trim>
  140. <include refid="page_where" />
  141. </update>
  142. <!-- 其他自定义SQL -->
  143. </mapper>