BisInspTravelPlanPointDao.xml 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  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.BisInspTravelPlanPointDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.BisInspTravelPlanPoint" id="bisInspTravelPlanPointResultMap">
  5. <result property="distance" column="DISTANCE"/>
  6. <result property="consuming" column="CONSUMING"/>
  7. <result property="id" column="ID"/>
  8. <result property="planDayId" column="PLAN_DAY_ID"/>
  9. <result property="name" column="NAME"/>
  10. <result property="addvcd" column="ADDVCD"/>
  11. <result property="addvnm" column="ADDVNM"/>
  12. <result property="lev" column="LEV"/>
  13. <result property="lgtd" column="LGTD"/>
  14. <result property="lttd" column="LTTD"/>
  15. <result property="icons" column="ICONS"/>
  16. <result property="ordr" column="ORDR"/>
  17. <result property="intm" column="INTM" jdbcType="TIMESTAMP"/>
  18. <result property="uptm" column="UPTM" jdbcType="TIMESTAMP"/>
  19. <result property="dataStat" column="DATA_STAT"/>
  20. <result property="ptype" column="PTYPE"/>
  21. <result property="regid" column="REGID"/>
  22. <result property="travelPlanId" column="TRAVEL_PLAN_ID"/>
  23. <result property="sttm" column="STTM" jdbcType="TIMESTAMP"/>
  24. <result property="entm" column="ENTM" jdbcType="TIMESTAMP"/>
  25. <result property="note" column="NOTE"/>
  26. </resultMap>
  27. <sql id="table_columns">
  28. PTYPE,
  29. REGID,
  30. TRAVEL_PLAN_ID,
  31. DISTANCE,
  32. CONSUMING,
  33. STTM,
  34. ENTM,
  35. ID,
  36. PLAN_DAY_ID,
  37. NAME,
  38. ADDVCD,
  39. ADDVNM,
  40. LEV,
  41. LGTD,
  42. LTTD,
  43. ICONS,
  44. ORDR,
  45. INTM,
  46. UPTM,
  47. NOTE,
  48. DATA_STAT
  49. </sql>
  50. <sql id="entity_properties">
  51. #{ptype},
  52. #{regid},
  53. #{travelPlanId},
  54. #{distance},
  55. #{consuming},
  56. #{sttm},
  57. #{entm},
  58. #{id},
  59. #{planDayId},
  60. #{name},
  61. #{addvcd},
  62. #{addvnm},
  63. #{lev},
  64. #{lgtd},
  65. #{lttd},
  66. #{icons},
  67. #{ordr},
  68. #{intm},
  69. #{uptm},
  70. #{note},
  71. #{dataStat}
  72. </sql>
  73. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  74. <sql id="page_where">
  75. <trim prefix="where" prefixOverrides="and | or ">
  76. <if test="regid != null and regid != ''">and REGID = #{regid}</if>
  77. <if test="travelPlanId != null and travelPlanId != ''">and TRAVEL_PLAN_ID = #{travelPlanId}</if>
  78. <if test="distance != null and distance != ''">and DISTANCE = #{distance}</if>
  79. <if test="consuming != null and consuming != ''">and CONSUMING = #{consuming}</if>
  80. <if test="sttm != null">and STTM = #{sttm}</if>
  81. <if test="entm != null">and ENTM = #{entm}</if>
  82. <if test="id != null and id != ''">and ID = #{id}</if>
  83. <if test="planDayId != null and planDayId != ''">and PLAN_DAY_ID = #{planDayId}</if>
  84. <if test="name != null and name != ''">and NAME = #{name}</if>
  85. <if test="addvcd != null and addvcd != ''">and ADDVCD = #{addvcd}</if>
  86. <if test="addvnm != null and addvnm != ''">and ADDVNM = #{addvnm}</if>
  87. <if test="lev != null and lev != ''">and LEV = #{lev}</if>
  88. <if test="lgtd != null and lgtd != ''">and LGTD = #{lgtd}</if>
  89. <if test="lttd != null and lttd != ''">and LTTD = #{lttd}</if>
  90. <if test="icons != null and icons != ''">and ICONS = #{icons}</if>
  91. <if test="ordr != null and ordr != ''">and ORDR = #{ordr}</if>
  92. <if test="intm != null">and INTM = #{intm}</if>
  93. <if test="uptm != null">and UPTM = #{uptm}</if>
  94. <if test="dataStat != null and dataStat != ''">and DATA_STAT = #{dataStat}</if>
  95. <if test="note != null and note != ''">and note = #{note}</if>
  96. and DATA_STAT='0'
  97. </trim>
  98. </sql>
  99. <select id="get" resultMap="bisInspTravelPlanPointResultMap" parameterType="String">
  100. select
  101. <include refid="table_columns"/>
  102. from BIS_INSP_TRAVEL_PLAN_POINT where ID = #{id}
  103. </select>
  104. <select id="getBy" resultMap="bisInspTravelPlanPointResultMap">
  105. select
  106. <include refid="table_columns"/>
  107. from BIS_INSP_TRAVEL_PLAN_POINT
  108. <include refid="page_where"/>
  109. </select>
  110. <select id="findAll" resultMap="bisInspTravelPlanPointResultMap">
  111. select
  112. <include refid="table_columns"/>
  113. from BIS_INSP_TRAVEL_PLAN_POINT
  114. </select>
  115. <select id="findList" resultMap="bisInspTravelPlanPointResultMap">
  116. select
  117. <include refid="table_columns"/>
  118. from BIS_INSP_TRAVEL_PLAN_POINT
  119. <include refid="page_where"/>
  120. </select>
  121. <select id="selectCount" resultType="int">
  122. select count(ID) from BIS_INSP_TRAVEL_PLAN_POINT
  123. <include refid="page_where"/>
  124. </select>
  125. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspTravelPlanPoint">
  126. insert into BIS_INSP_TRAVEL_PLAN_POINT(
  127. <include refid="table_columns"/>
  128. )
  129. values (
  130. <include refid="entity_properties"/>
  131. )
  132. </insert>
  133. <delete id="delete" parameterType="java.lang.String">
  134. update BIS_INSP_TRAVEL_PLAN_POINT set DATA_STAT='9' where ID = #{id}
  135. </delete>
  136. <delete id="deleteByDayId" parameterType="java.lang.String">
  137. update BIS_INSP_TRAVEL_PLAN_POINT set DATA_STAT='9' where plan_day_id=#{dayId}
  138. </delete>
  139. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspTravelPlanPoint">
  140. delete from BIS_INSP_TRAVEL_PLAN_POINT
  141. <include refid="page_where"/>
  142. </delete>
  143. <update id="deleteInFlag" parameterType="java.lang.String">
  144. update BIS_INSP_TRAVEL_PLAN_POINT set flag_valid = 0 where ID = #{id}
  145. </update>
  146. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspTravelPlanPoint">
  147. update BIS_INSP_TRAVEL_PLAN_POINT
  148. <trim prefix="set" suffixOverrides=",">
  149. <if test="regid != null and regid != ''">REGID = #{regid},</if>
  150. <if test="travelPlanId != null and travelPlanId != ''">TRAVEL_PLAN_ID = #{travelPlanId},</if>
  151. <if test="distance != null and distance != ''">DISTANCE = #{distance},</if>
  152. <if test="consuming != null and consuming != ''">CONSUMING = #{consuming},</if>
  153. <if test="sttm != null">STTM = #{sttm},</if>
  154. <if test="entm != null">ENTM = #{entm},</if>
  155. <if test="ptype != null and ptype != ''">ptype = #{ptype},</if>
  156. <if test="planDayId != null and planDayId != ''">PLAN_DAY_ID = #{planDayId},</if>
  157. <if test="name != null and name != ''">NAME = #{name},</if>
  158. <if test="addvcd != null and addvcd != ''">ADDVCD = #{addvcd},</if>
  159. <if test="addvnm != null and addvnm != ''">ADDVNM = #{addvnm},</if>
  160. <if test="lev != null and lev != ''">LEV = #{lev},</if>
  161. <if test="lgtd != null and lgtd != ''">LGTD = #{lgtd},</if>
  162. <if test="lttd != null and lttd != ''">LTTD = #{lttd},</if>
  163. <if test="icons != null and icons != ''">ICONS = #{icons},</if>
  164. <if test="ordr != null and ordr != ''">ORDR = #{ordr},</if>
  165. <if test="intm != null">INTM = #{intm},</if>
  166. <if test="uptm != null">UPTM = #{uptm},</if>
  167. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  168. <if test="note != null and note != ''">NOTE = #{note},</if>
  169. </trim>
  170. <where>ID = #{id}</where>
  171. </update>
  172. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspTravelPlanPoint">
  173. update BIS_INSP_TRAVEL_PLAN_POINT
  174. <trim prefix="set" suffixOverrides=",">
  175. <if test="regid != null and regid != ''">REGID = #{regid},</if>
  176. <if test="travelPlanId != null and travelPlanId != ''">TRAVEL_PLAN_ID = #{travelPlanId},</if>
  177. <if test="distance != null and distance != ''">DISTANCE = #{distance},</if>
  178. <if test="consuming != null and consuming != ''">CONSUMING = #{consuming},</if>
  179. <if test="sttm != null">STTM = #{sttm},</if>
  180. <if test="entm != null">ENTM = #{entm},</if>
  181. <if test="ptype != null and ptype != ''">ptype = #{ptype},</if>
  182. <if test="planDayId != null and planDayId != ''">PLAN_DAY_ID = #{planDayId},</if>
  183. <if test="name != null and name != ''">NAME = #{name},</if>
  184. <if test="addvcd != null and addvcd != ''">ADDVCD = #{addvcd},</if>
  185. <if test="addvnm != null and addvnm != ''">ADDVNM = #{addvnm},</if>
  186. <if test="lev != null and lev != ''">LEV = #{lev},</if>
  187. <if test="lgtd != null and lgtd != ''">LGTD = #{lgtd},</if>
  188. <if test="lttd != null and lttd != ''">LTTD = #{lttd},</if>
  189. <if test="icons != null and icons != ''">ICONS = #{icons},</if>
  190. <if test="ordr != null and ordr != ''">ORDR = #{ordr},</if>
  191. <if test="intm != null">INTM = #{intm},</if>
  192. <if test="uptm != null">UPTM = #{uptm},</if>
  193. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  194. <if test="note != null and note != ''">NOTE = #{note},</if>
  195. </trim>
  196. <include refid="page_where"/>
  197. </update>
  198. <!-- 其他自定义SQL -->
  199. <select id="getPointByDayId" resultMap="bisInspTravelPlanPointResultMap">
  200. select t.*,t.rowid from bis_insp_travel_plan_point t where DATA_STAT='0' AND plan_day_id=#{dayId} order by ORDR
  201. </select>
  202. <select id="getMaxOne" resultType="java.lang.Integer">
  203. select max(ORDR) from bis_insp_travel_plan_point t where DATA_STAT='0' AND plan_day_id=#{dayId}
  204. </select>
  205. </mapper>