StationSettlementPriceAdjustMapper.xml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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.StationSettlementPriceAdjustMapper">
  6. <resultMap type="StationSettlementPriceAdjust" id="StationSettlementPriceAdjustResult">
  7. <result property="id" column="id" />
  8. <result property="createBy" column="create_by" />
  9. <result property="createTime" column="create_time" />
  10. <result property="settlementPrice" column="settlement_price" />
  11. <result property="settlementType" column="settlement_type" />
  12. <result property="driverPrice" column="driver_price" />
  13. <result property="stationId" column="station_id" />
  14. <result property="parentId" column="parent_id" />
  15. <result property="createName" column="create_name" />
  16. <result property="stationName" column="station_name" />
  17. <result property="driverPriceType" column="driver_price_type" />
  18. </resultMap>
  19. <sql id="selectStationSettlementPriceAdjustVo">
  20. select c.id, c.create_by, c.create_time,c.parent_id, c.settlement_price, c.settlement_type,
  21. c.driver_price,c.station_id,dept_name as station_name,u.nick_name as create_name,driver_price_type
  22. from station_settlement_price_adjust c left join sys_dept d on c.station_id = d.dept_id
  23. left join sys_user u on c.create_by =u.user_id
  24. </sql>
  25. <select id="selectStationSettlementPriceAdjustList" parameterType="StationSettlementPriceAdjust" resultMap="StationSettlementPriceAdjustResult">
  26. <include refid="selectStationSettlementPriceAdjustVo"/>
  27. <where>
  28. <if test="settlementPrice != null "> and settlement_price = #{settlementPrice}</if>
  29. <if test="settlementType != null and settlementType != ''"> and settlement_type = #{settlementType}</if>
  30. <if test="driverPrice != null "> and driver_price = #{driverPrice}</if>
  31. <if test="driverPriceType != null "> and driver_price_type = #{driverPriceType}</if>
  32. <if test="stationId != null "> and station_id = #{stationId}</if>
  33. <if test="parentId != null "> and parent_id = #{parentId}</if>
  34. <if test="stationIdList != null ">
  35. and station_id in
  36. <foreach item="item" index="index" collection="stationIdList"
  37. open="(" separator="," close=")">
  38. #{item}
  39. </foreach>
  40. </if>
  41. </where>
  42. order by id desc
  43. </select>
  44. <select id="selectStationSettlementPriceAdjustById" parameterType="Integer" resultMap="StationSettlementPriceAdjustResult">
  45. <include refid="selectStationSettlementPriceAdjustVo"/>
  46. where id = #{id}
  47. </select>
  48. <insert id="insertStationSettlementPriceAdjust" parameterType="StationSettlementPriceAdjust" useGeneratedKeys="true" keyProperty="id">
  49. insert into station_settlement_price_adjust
  50. <trim prefix="(" suffix=")" suffixOverrides=",">
  51. <if test="id != null">id,</if>
  52. <if test="createBy != null">create_by,</if>
  53. <if test="createTime != null">create_time,</if>
  54. <if test="settlementPrice != null">settlement_price,</if>
  55. <if test="settlementType != null">settlement_type,</if>
  56. <if test="driverPrice != null">driver_price,</if>
  57. <if test="stationId != null">station_id,</if>
  58. <if test="parentId != null">parent_id,</if>
  59. <if test="driverPriceType != null">driver_price_type,</if>
  60. </trim>
  61. <trim prefix="values (" suffix=")" suffixOverrides=",">
  62. <if test="id != null">#{id},</if>
  63. <if test="createBy != null">#{createBy},</if>
  64. <if test="createTime != null">#{createTime},</if>
  65. <if test="settlementPrice != null">#{settlementPrice},</if>
  66. <if test="settlementType != null">#{settlementType},</if>
  67. <if test="driverPrice != null">#{driverPrice},</if>
  68. <if test="stationId != null">#{stationId},</if>
  69. <if test="parentId != null">#{parentId},</if>
  70. <if test="driverPriceType != null">#{driverPriceType},</if>
  71. </trim>
  72. </insert>
  73. <update id="updateStationSettlementPriceAdjust" parameterType="StationSettlementPriceAdjust">
  74. update station_settlement_price_adjust
  75. <trim prefix="SET" suffixOverrides=",">
  76. <if test="createBy != null">create_by = #{createBy},</if>
  77. <if test="createTime != null">create_time = #{createTime},</if>
  78. <if test="settlementPrice != null">settlement_price = #{settlementPrice},</if>
  79. <if test="settlementType != null">settlement_type = #{settlementType},</if>
  80. <if test="driverPrice != null">driver_price = #{driverPrice},</if>
  81. <if test="stationId != null">station_id = #{stationId},</if>
  82. <if test="parentId != null">parent_id = #{parentId},</if>
  83. <if test="driverPriceType != null">driver_price_type = #{driverPriceType},</if>
  84. </trim>
  85. where id = #{id}
  86. </update>
  87. <delete id="deleteStationSettlementPriceAdjustById" parameterType="Integer">
  88. delete from station_settlement_price_adjust where id = #{id}
  89. </delete>
  90. <delete id="deleteStationSettlementPriceAdjustByIds" parameterType="String">
  91. delete from station_settlement_price_adjust where id in
  92. <foreach item="id" collection="array" open="(" separator="," close=")">
  93. #{id}
  94. </foreach>
  95. </delete>
  96. </mapper>