StationSettlementPriceAdjustMapper.xml 4.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. </resultMap>
  16. <sql id="selectStationSettlementPriceAdjustVo">
  17. select c.id, c.create_by, c.create_time,c.parent_id, c.settlement_price, c.settlement_type,
  18. c.driver_price,c.station_id,dept_name as station_name
  19. from station_settlement_price_adjust c join sys_dept d on c.station_id = d.dept_id
  20. </sql>
  21. <select id="selectStationSettlementPriceAdjustList" parameterType="StationSettlementPriceAdjust" resultMap="StationSettlementPriceAdjustResult">
  22. <include refid="selectStationSettlementPriceAdjustVo"/>
  23. <where>
  24. <if test="settlementPrice != null "> and settlement_price = #{settlementPrice}</if>
  25. <if test="settlementType != null and settlementType != ''"> and settlement_type = #{settlementType}</if>
  26. <if test="driverPrice != null "> and driver_price = #{driverPrice}</if>
  27. <if test="stationId != null "> and station_id = #{stationId}</if>
  28. <if test="parentId != null "> and parent_id = #{parentId}</if>
  29. </where>
  30. </select>
  31. <select id="selectStationSettlementPriceAdjustById" parameterType="Integer" resultMap="StationSettlementPriceAdjustResult">
  32. <include refid="selectStationSettlementPriceAdjustVo"/>
  33. where id = #{id}
  34. </select>
  35. <insert id="insertStationSettlementPriceAdjust" parameterType="StationSettlementPriceAdjust" useGeneratedKeys="true" keyProperty="id">
  36. insert into station_settlement_price_adjust
  37. <trim prefix="(" suffix=")" suffixOverrides=",">
  38. <if test="id != null">id,</if>
  39. <if test="createBy != null">create_by,</if>
  40. <if test="createTime != null">create_time,</if>
  41. <if test="settlementPrice != null">settlement_price,</if>
  42. <if test="settlementType != null">settlement_type,</if>
  43. <if test="driverPrice != null">driver_price,</if>
  44. <if test="stationId != null">station_id,</if>
  45. <if test="parentId != null">parent_id,</if>
  46. </trim>
  47. <trim prefix="values (" suffix=")" suffixOverrides=",">
  48. <if test="id != null">#{id},</if>
  49. <if test="createBy != null">#{createBy},</if>
  50. <if test="createTime != null">#{createTime},</if>
  51. <if test="settlementPrice != null">#{settlementPrice},</if>
  52. <if test="settlementType != null">#{settlementType},</if>
  53. <if test="driverPrice != null">#{driverPrice},</if>
  54. <if test="stationId != null">#{stationId},</if>
  55. <if test="parentId != null">#{parentId},</if>
  56. </trim>
  57. </insert>
  58. <update id="updateStationSettlementPriceAdjust" parameterType="StationSettlementPriceAdjust">
  59. update station_settlement_price_adjust
  60. <trim prefix="SET" suffixOverrides=",">
  61. <if test="createBy != null">create_by = #{createBy},</if>
  62. <if test="createTime != null">create_time = #{createTime},</if>
  63. <if test="settlementPrice != null">settlement_price = #{settlementPrice},</if>
  64. <if test="settlementType != null">settlement_type = #{settlementType},</if>
  65. <if test="driverPrice != null">driver_price = #{driverPrice},</if>
  66. <if test="stationId != null">station_id = #{stationId},</if>
  67. <if test="parentId != null">parent_id = #{parentId},</if>
  68. </trim>
  69. where id = #{id}
  70. </update>
  71. <delete id="deleteStationSettlementPriceAdjustById" parameterType="Integer">
  72. delete from station_settlement_price_adjust where id = #{id}
  73. </delete>
  74. <delete id="deleteStationSettlementPriceAdjustByIds" parameterType="String">
  75. delete from station_settlement_price_adjust where id in
  76. <foreach item="id" collection="array" open="(" separator="," close=")">
  77. #{id}
  78. </foreach>
  79. </delete>
  80. </mapper>