BerthingPointConfigMapper.xml 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  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="com.ruoyi.system.mapper.BerthingPointConfigMapper">
  4. <resultMap type="com.ruoyi.system.domain.BerthingPointConfig" id="BerthingPointConfigMap">
  5. <result property="stopId" column="stop_id" jdbcType="INTEGER"/>
  6. <result property="id" column="id" jdbcType="VARCHAR"/>
  7. <result property="siteId" column="site_id" jdbcType="INTEGER"/>
  8. <result property="planid" column="planid" jdbcType="INTEGER"/>
  9. <result property="berthingId" column="berthing_id" jdbcType="INTEGER"/>
  10. <result property="positions" column="positions" jdbcType="VARCHAR"/>
  11. <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
  12. <result property="status" column="status" jdbcType="INTEGER"/>
  13. <result property="isDel" column="is_del" jdbcType="INTEGER"/>
  14. <result property="wlevel" column="wlevel" jdbcType="NUMERIC"/>
  15. <result property="factors" column="factors" jdbcType="VARCHAR"/>
  16. <result property="siteName" column="site_name" jdbcType="VARBINARY"/>
  17. </resultMap>
  18. <!--查询单个-->
  19. <select id="queryById" resultMap="BerthingPointConfigMap">
  20. select
  21. stop_id, id, site_id, planid, berthing_id, positions, create_time, status, is_del, wlevel, factors
  22. from berthing_point_config
  23. where stop_id = #{stopId}
  24. </select>
  25. <!--查询单个-->
  26. <select id="queryByPlanid" resultMap="BerthingPointConfigMap">
  27. select
  28. stop_id, id, site_id, planid, berthing_id, positions, create_time, status, is_del, wlevel, factors
  29. from berthing_point_config
  30. where site_id = #{siteId} and planid = #{planid}
  31. </select>
  32. <!--查询指定行数据-->
  33. <select id="queryAllByLimit" resultMap="BerthingPointConfigMap">
  34. select
  35. a.stop_id, a.id, a.site_id, a.planid, a.berthing_id, a.positions, a.create_time, a.status, a.is_del, a.wlevel, a.factors, b.site_name
  36. from berthing_point_config as a
  37. join site_info as b on a.site_id = b.site_id
  38. <where>
  39. <if test="stopPointQuery.stopId != null">
  40. and a.stop_id = #{stopPointQuery.stopId}
  41. </if>
  42. <if test="stopPointQuery.siteId != null">
  43. and a.site_id = #{stopPointQuery.siteId}
  44. </if>
  45. and a.is_del = 0
  46. </where>
  47. order by a.wlevel desc
  48. </select>
  49. <!--统计总行数-->
  50. <select id="count" resultType="java.lang.Long">
  51. select count(1)
  52. from berthing_point_config
  53. <where>
  54. <if test="stopId != null">
  55. and stop_id = #{stopId}
  56. </if>
  57. <if test="id != null and id != ''">
  58. and id = #{id}
  59. </if>
  60. <if test="siteId != null">
  61. and site_id = #{siteId}
  62. </if>
  63. <if test="planid != null">
  64. and planid = #{planid}
  65. </if>
  66. <if test="berthingId != null">
  67. and berthing_id = #{berthingId}
  68. </if>
  69. <if test="positions != null and positions != ''">
  70. and positions = #{positions}
  71. </if>
  72. <if test="createTime != null">
  73. and create_time = #{createTime}
  74. </if>
  75. <if test="status != null">
  76. and status = #{status}
  77. </if>
  78. <if test="isDel != null">
  79. and is_del = #{isDel}
  80. </if>
  81. <if test="wlevel != null">
  82. and wlevel = #{wlevel}
  83. </if>
  84. <if test="factors != null and factors != ''">
  85. and factors = #{factors}
  86. </if>
  87. </where>
  88. </select>
  89. <!--新增所有列-->
  90. <insert id="insert" keyProperty="stopId" useGeneratedKeys="true">
  91. insert into berthing_point_config (id, site_id, planid, berthing_id, positions, create_time, status, is_del, wlevel, factors)
  92. values (#{id}, #{siteId}, #{planid}, #{berthingId}, #{positions}, #{createTime}, #{status}, #{isDel}, #{wlevel}, #{factors})
  93. </insert>
  94. <insert id="insertBatch" keyProperty="stopId" useGeneratedKeys="true">
  95. insert into berthing_point_config(id, site_id, planid, berthing_id, positions, create_time, status, is_del, wlevel, factors)
  96. values
  97. <foreach collection="entities" item="entity" separator=",">
  98. (#{entity.id}, #{entity.siteId}, #{entity.planid}, #{entity.berthingId}, #{entity.positions}, #{entity.createTime}, #{entity.status}, #{entity.isDel}, #{entity.wlevel}, #{entity.factors})
  99. </foreach>
  100. </insert>
  101. <insert id="insertOrUpdateBatch" keyProperty="stopId" useGeneratedKeys="true">
  102. insert into berthing_point_config(id, site_id, planid, berthing_id, positions, create_time, status, is_del, wlevel, factors)
  103. values
  104. <foreach collection="entities" item="entity" separator=",">
  105. (#{entity.id}, #{entity.siteId}, #{entity.planid}, #{entity.berthingId}, #{entity.positions}, #{entity.createTime}, #{entity.status}, #{entity.isDel}, #{entity.wlevel}, #{entity.factors})
  106. </foreach>
  107. on duplicate key update
  108. id = values(id),
  109. site_id = values(site_id),
  110. planid = values(planid),
  111. berthing_id = values(berthing_id),
  112. positions = values(positions),
  113. create_time = values(create_time),
  114. status = values(status),
  115. is_del = values(is_del),
  116. wlevel = values(wlevel),
  117. factors = values(factors)
  118. </insert>
  119. <!--通过主键修改数据-->
  120. <update id="update">
  121. update berthing_point_config
  122. <set>
  123. <if test="id != null and id != ''">
  124. id = #{id},
  125. </if>
  126. <if test="siteId != null">
  127. site_id = #{siteId},
  128. </if>
  129. <if test="planid != null">
  130. planid = #{planid},
  131. </if>
  132. <if test="berthingId != null">
  133. berthing_id = #{berthingId},
  134. </if>
  135. <if test="positions != null and positions != ''">
  136. positions = #{positions},
  137. </if>
  138. <if test="createTime != null">
  139. create_time = #{createTime},
  140. </if>
  141. <if test="status != null">
  142. status = #{status},
  143. </if>
  144. <if test="isDel != null">
  145. is_del = #{isDel},
  146. </if>
  147. <if test="wlevel != null">
  148. wlevel = #{wlevel},
  149. </if>
  150. <if test="factors != null and factors != ''">
  151. factors = #{factors},
  152. </if>
  153. </set>
  154. where stop_id = #{stopId}
  155. </update>
  156. <!--通过主键删除-->
  157. <delete id="deleteById">
  158. delete from berthing_point_config where stop_id = #{stopId}
  159. </delete>
  160. </mapper>