StationSettlementPriceAdjustMapper.xml 5.1 KB

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