StationSettlementPriceMapper.xml 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.yijia.station.mapper.StationSettlementPriceMapper">
  6. <resultMap type="StationSettlementPrice" id="StationSettlementPriceResult">
  7. <result property="id" column="id" />
  8. <result property="stationId" column="station_id" />
  9. <result property="settlementType" column="settlement_type" />
  10. <result property="settlementPrice" column="settlement_price" />
  11. <result property="driverPrice" column="driver_price" />
  12. <result property="driverPriceType" column="driver_price_type" />
  13. <result property="createTime" column="create_time" />
  14. <result property="createBy" column="create_by" />
  15. <result property="updateTime" column="update_time" />
  16. <result property="updateBy" column="update_by" />
  17. <result property="balance" column="balance" />
  18. <result property="deptId" column="dept_id" />
  19. <result property="stationName" column="station_name" />
  20. </resultMap>
  21. <sql id="selectStationSettlementPriceVo">
  22. select id, station_id, settlement_type, settlement_price, driver_price,p.create_by,p.create_time,
  23. p.update_by,p.update_time,d.dept_name as station_name,balance,dept_id,driver_price_type
  24. from sys_dept d left join station_settlement_price p on d.dept_id = p.station_id </sql>
  25. <select id="selectStationSettlementPriceList" parameterType="StationSettlementPrice" resultMap="StationSettlementPriceResult">
  26. <include refid="selectStationSettlementPriceVo"/>
  27. <where>
  28. and d.del_flag ='0'
  29. <if test="stationId != null "> and station_id = #{stationId}</if>
  30. <if test="settlementType != null and settlementType != ''"> and settlement_type = #{settlementType}</if>
  31. <if test="settlementPrice != null and settlementPrice != ''"> and settlement_price = #{settlementPrice}</if>
  32. <if test="driverPrice != null and driverPrice != ''"> and driver_price = #{driverPrice}</if>
  33. <if test="driverPriceType != null and driverPriceType != ''"> and driver_price_type = #{driverPriceType}</if>
  34. <if test="stationIdList != null ">
  35. and d.dept_id in
  36. <foreach item="item" index="index" collection="stationIdList"
  37. open="(" separator="," close=")">
  38. #{item}
  39. </foreach>
  40. </if>
  41. </where>
  42. </select>
  43. <select id="selectStationSettlementPriceById" parameterType="Integer" resultMap="StationSettlementPriceResult">
  44. <include refid="selectStationSettlementPriceVo"/>
  45. where id = #{id}
  46. </select>
  47. <insert id="insertStationSettlementPrice" parameterType="StationSettlementPrice">
  48. insert into station_settlement_price
  49. <trim prefix="(" suffix=")" suffixOverrides=",">
  50. <if test="id != null">id,</if>
  51. <if test="stationId != null">station_id,</if>
  52. <if test="settlementType != null">settlement_type,</if>
  53. <if test="settlementPrice != null">settlement_price,</if>
  54. <if test="driverPrice != null">driver_price,</if>
  55. <if test="driverPriceType != null">driver_price_type,</if>
  56. <if test="createTime != null">create_time,</if>
  57. <if test="createBy != null">create_by,</if>
  58. <if test="updateTime != null">update_time,</if>
  59. <if test="updateBy != null">update_by,</if>
  60. </trim>
  61. <trim prefix="values (" suffix=")" suffixOverrides=",">
  62. <if test="id != null">#{id},</if>
  63. <if test="stationId != null">#{stationId},</if>
  64. <if test="settlementType != null">#{settlementType},</if>
  65. <if test="settlementPrice != null">#{settlementPrice},</if>
  66. <if test="driverPrice != null">#{driverPrice},</if>
  67. <if test="driverPriceType != null">#{driverPriceType},</if>
  68. <if test="createTime != null">#{createTime},</if>
  69. <if test="createBy != null">#{createBy},</if>
  70. <if test="updateTime != null">#{updateTime},</if>
  71. <if test="updateBy != null">#{updateBy},</if>
  72. </trim>
  73. </insert>
  74. <update id="updateStationSettlementPrice" parameterType="StationSettlementPrice">
  75. update station_settlement_price
  76. <trim prefix="SET" suffixOverrides=",">
  77. <if test="stationId != null">station_id = #{stationId},</if>
  78. <if test="settlementType != null">settlement_type = #{settlementType},</if>
  79. <if test="settlementPrice != null">settlement_price = #{settlementPrice},</if>
  80. <if test="driverPrice != null">driver_price = #{driverPrice},</if>
  81. <if test="driverPriceType != null">driver_price_type = #{driverPriceType},</if>
  82. <if test="createTime != null">create_time = #{createTime},</if>
  83. <if test="createBy != null">create_by = #{createBy},</if>
  84. <if test="updateTime != null">update_time = #{updateTime},</if>
  85. <if test="updateBy != null">update_by = #{updateBy},</if>
  86. </trim>
  87. where id = #{id}
  88. </update>
  89. <delete id="deleteStationSettlementPriceById" parameterType="Integer">
  90. delete from station_settlement_price where id = #{id}
  91. </delete>
  92. <delete id="deleteStationSettlementPriceByIds" parameterType="String">
  93. delete from station_settlement_price where id in
  94. <foreach item="id" collection="array" open="(" separator="," close=")">
  95. #{id}
  96. </foreach>
  97. </delete>
  98. </mapper>