BisInspTravelPlanDayDao.xml 5.9 KB

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