BisInspTravelPlanPolylineDao.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.BisInspTravelPlanPolylineDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.BisInspTravelPlanPolyline" id="bisInspTravelPlanPolylineResultMap">
  5. <result property="id" column="ID"/>
  6. <result property="planDayId" column="PLAN_DAY_ID"/>
  7. <result property="instruction" column="INSTRUCTION"/>
  8. <result property="distance" column="DISTANCE"/>
  9. <result property="polyline" column="POLYLINE"/>
  10. <result property="action" column="ACTION"/>
  11. <result property="intm" column="INTM"/>
  12. <result property="uptm" column="UPTM"/>
  13. <result property="dataStat" column="DATA_STAT"/>
  14. <result property="ordr" column="ORDR"/>
  15. </resultMap>
  16. <sql id="table_columns">
  17. ID,
  18. PLAN_DAY_ID,
  19. INSTRUCTION,
  20. DISTANCE,
  21. POLYLINE,
  22. ACTION,
  23. INTM,
  24. UPTM,
  25. DATA_STAT,
  26. ORDR
  27. </sql>
  28. <sql id="entity_properties">
  29. #{id},
  30. #{planDayId},
  31. #{instruction},
  32. #{distance},
  33. #{polyline},
  34. #{action},
  35. #{intm},
  36. #{uptm},
  37. #{dataStat},
  38. #{ordr}
  39. </sql>
  40. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  41. <sql id="page_where">
  42. <trim prefix="where" prefixOverrides="and | or ">
  43. <if test="planDayId != null and planDayId != ''">and PLAN_DAY_ID = #{planDayId}</if>
  44. <if test="instruction != null and instruction != ''">and INSTRUCTION = #{instruction}</if>
  45. <if test="distance != null and distance != ''">and DISTANCE = #{distance}</if>
  46. <if test="polyline != null and polyline != ''">and POLYLINE = #{polyline}</if>
  47. <if test="action != null and action != ''">and ACTION = #{action}</if>
  48. <if test="intm != null">and INTM = #{intm}</if>
  49. <if test="uptm != null">and UPTM = #{uptm}</if>
  50. <if test="ordr != null and ordr != ''">and ORDR = #{ordr}</if>
  51. <if test="dataStat != null and dataStat != ''">and DATA_STAT = #{dataStat}</if>
  52. </trim>
  53. </sql>
  54. <select id="get" resultMap="bisInspTravelPlanPolylineResultMap" parameterType="String" >
  55. select <include refid="table_columns" /> from BIS_INSP_TRAVEL_PLAN_POLYLINE where ID = #{id}
  56. </select>
  57. <select id="getBy" resultMap="bisInspTravelPlanPolylineResultMap">
  58. select <include refid="table_columns" /> from BIS_INSP_TRAVEL_PLAN_POLYLINE <include refid="page_where" />
  59. </select>
  60. <select id="findAll" resultMap="bisInspTravelPlanPolylineResultMap">
  61. select <include refid="table_columns" /> from BIS_INSP_TRAVEL_PLAN_POLYLINE
  62. </select>
  63. <select id="findList" resultMap="bisInspTravelPlanPolylineResultMap">
  64. select <include refid="table_columns" /> from BIS_INSP_TRAVEL_PLAN_POLYLINE <include refid="page_where" />
  65. </select>
  66. <select id="selectCount" resultType="int" >
  67. select count(ID) from BIS_INSP_TRAVEL_PLAN_POLYLINE <include refid="page_where" />
  68. </select>
  69. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspTravelPlanPolyline">
  70. insert into BIS_INSP_TRAVEL_PLAN_POLYLINE( <include refid="table_columns" /> )
  71. values ( <include refid="entity_properties" /> )
  72. </insert>
  73. <delete id="delete" parameterType="java.lang.String">
  74. delete from BIS_INSP_TRAVEL_PLAN_POLYLINE where ID = #{id}
  75. </delete>
  76. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspTravelPlanPolyline">
  77. delete from BIS_INSP_TRAVEL_PLAN_POLYLINE <include refid="page_where" />
  78. </delete>
  79. <update id="deleteInFlag" parameterType="java.lang.String">
  80. update BIS_INSP_TRAVEL_PLAN_POLYLINE set flag_valid = 0 where ID = #{id}
  81. </update>
  82. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspTravelPlanPolyline">
  83. update BIS_INSP_TRAVEL_PLAN_POLYLINE
  84. <trim prefix="set" suffixOverrides=",">
  85. <if test="planDayId != null and planDayId != ''">PLAN_DAY_ID = #{planDayId},</if>
  86. <if test="instruction != null and instruction != ''">INSTRUCTION = #{instruction},</if>
  87. <if test="distance != null and distance != ''">DISTANCE = #{distance},</if>
  88. <if test="polyline != null and polyline != ''">POLYLINE = #{polyline},</if>
  89. <if test="action != null and action != ''">ACTION = #{action},</if>
  90. <if test="ordr != null and ordr != ''">ORDR = #{ordr},</if>
  91. <if test="intm != null">INTM = #{intm},</if>
  92. <if test="uptm != null">UPTM = #{uptm},</if>
  93. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  94. </trim>
  95. <where>ID = #{id}</where>
  96. </update>
  97. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspTravelPlanPolyline">
  98. update BIS_INSP_TRAVEL_PLAN_POLYLINE
  99. <trim prefix="set" suffixOverrides=",">
  100. <if test="planDayId != null and planDayId != ''">PLAN_DAY_ID = #{planDayId},</if>
  101. <if test="instruction != null and instruction != ''">INSTRUCTION = #{instruction},</if>
  102. <if test="distance != null and distance != ''">DISTANCE = #{distance},</if>
  103. <if test="polyline != null and polyline != ''">POLYLINE = #{polyline},</if>
  104. <if test="action != null and action != ''">ACTION = #{action},</if>
  105. <if test="ordr != null and ordr != ''">ORDR = #{ordr},</if>
  106. <if test="intm != null">INTM = #{intm},</if>
  107. <if test="uptm != null">UPTM = #{uptm},</if>
  108. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  109. </trim>
  110. <include refid="page_where" />
  111. </update>
  112. <!-- 其他自定义SQL -->
  113. <!-- 其他自定义SQL -->
  114. <select id="getPolylineByDayId" resultType="cn.com.goldenwater.dcproj.dto.BisInspTravelPlanPolylineDto">
  115. select t.*,t.rowid from bis_insp_travel_plan_polyline t where DATA_STAT='0' AND plan_day_id=#{dayId} order by ORDR
  116. </select>
  117. <select id="getMaxOne" resultType="java.lang.Integer">
  118. select max(ORDR) from bis_insp_travel_plan_polyline t where DATA_STAT='0' AND plan_day_id=#{dayId}
  119. </select>
  120. </mapper>