StationSettlementPriceMapper.xml 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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. <result property="status" column="status" />
  21. </resultMap>
  22. <sql id="selectStationSettlementPriceVo">
  23. select id, station_id, settlement_type, settlement_price, driver_price,p.create_by,p.create_time,
  24. p.update_by,p.update_time,d.dept_name as station_name,balance,dept_id,driver_price_type,d.status
  25. from sys_dept d left join station_settlement_price p on d.dept_id = p.station_id </sql>
  26. <select id="selectStationSettlementPriceList" parameterType="StationSettlementPrice" resultMap="StationSettlementPriceResult">
  27. <include refid="selectStationSettlementPriceVo"/>
  28. <where>
  29. and d.del_flag ='0'
  30. <if test="stationId != null "> and station_id = #{stationId}</if>
  31. <if test="settlementType != null and settlementType != ''"> and settlement_type = #{settlementType}</if>
  32. <if test="settlementPrice != null and settlementPrice != ''"> and settlement_price = #{settlementPrice}</if>
  33. <if test="driverPrice != null and driverPrice != ''"> and driver_price = #{driverPrice}</if>
  34. <if test="driverPriceType != null and driverPriceType != ''"> and driver_price_type = #{driverPriceType}</if>
  35. <if test="stationIdList != null ">
  36. and d.dept_id in
  37. <foreach item="item" index="index" collection="stationIdList"
  38. open="(" separator="," close=")">
  39. #{item}
  40. </foreach>
  41. </if>
  42. </where>
  43. </select>
  44. <select id="selectStationSettlementPriceById" parameterType="Integer" resultMap="StationSettlementPriceResult">
  45. <include refid="selectStationSettlementPriceVo"/>
  46. where id = #{id}
  47. </select>
  48. <insert id="insertStationSettlementPrice" parameterType="StationSettlementPrice">
  49. insert into station_settlement_price
  50. <trim prefix="(" suffix=")" suffixOverrides=",">
  51. <if test="id != null">id,</if>
  52. <if test="stationId != null">station_id,</if>
  53. <if test="settlementType != null">settlement_type,</if>
  54. <if test="settlementPrice != null">settlement_price,</if>
  55. <if test="driverPrice != null">driver_price,</if>
  56. <if test="driverPriceType != null">driver_price_type,</if>
  57. <if test="createTime != null">create_time,</if>
  58. <if test="createBy != null">create_by,</if>
  59. <if test="updateTime != null">update_time,</if>
  60. <if test="updateBy != null">update_by,</if>
  61. </trim>
  62. <trim prefix="values (" suffix=")" suffixOverrides=",">
  63. <if test="id != null">#{id},</if>
  64. <if test="stationId != null">#{stationId},</if>
  65. <if test="settlementType != null">#{settlementType},</if>
  66. <if test="settlementPrice != null">#{settlementPrice},</if>
  67. <if test="driverPrice != null">#{driverPrice},</if>
  68. <if test="driverPriceType != null">#{driverPriceType},</if>
  69. <if test="createTime != null">#{createTime},</if>
  70. <if test="createBy != null">#{createBy},</if>
  71. <if test="updateTime != null">#{updateTime},</if>
  72. <if test="updateBy != null">#{updateBy},</if>
  73. </trim>
  74. </insert>
  75. <update id="updateStationSettlementPrice" parameterType="StationSettlementPrice">
  76. update station_settlement_price
  77. <trim prefix="SET" suffixOverrides=",">
  78. <if test="stationId != null">station_id = #{stationId},</if>
  79. <if test="settlementType != null">settlement_type = #{settlementType},</if>
  80. <if test="settlementPrice != null">settlement_price = #{settlementPrice},</if>
  81. <if test="driverPrice != null">driver_price = #{driverPrice},</if>
  82. <if test="driverPriceType != null">driver_price_type = #{driverPriceType},</if>
  83. <if test="createTime != null">create_time = #{createTime},</if>
  84. <if test="createBy != null">create_by = #{createBy},</if>
  85. <if test="updateTime != null">update_time = #{updateTime},</if>
  86. <if test="updateBy != null">update_by = #{updateBy},</if>
  87. </trim>
  88. where id = #{id}
  89. </update>
  90. <delete id="deleteStationSettlementPriceById" parameterType="Integer">
  91. delete from station_settlement_price where id = #{id}
  92. </delete>
  93. <delete id="deleteStationSettlementPriceByIds" parameterType="String">
  94. delete from station_settlement_price where id in
  95. <foreach item="id" collection="array" open="(" separator="," close=")">
  96. #{id}
  97. </foreach>
  98. </delete>
  99. </mapper>