123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE mapper
- PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
- "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.yijia.station.mapper.StationSettlementPriceAdjustMapper">
- <resultMap type="StationSettlementPriceAdjust" id="StationSettlementPriceAdjustResult">
- <result property="id" column="id" />
- <result property="createBy" column="create_by" />
- <result property="createTime" column="create_time" />
- <result property="settlementPrice" column="settlement_price" />
- <result property="settlementType" column="settlement_type" />
- <result property="driverPrice" column="driver_price" />
- <result property="stationId" column="station_id" />
- <result property="parentId" column="parent_id" />
- <result property="createName" column="create_name" />
- <result property="stationName" column="station_name" />
- </resultMap>
- <sql id="selectStationSettlementPriceAdjustVo">
- select c.id, c.create_by, c.create_time,c.parent_id, c.settlement_price, c.settlement_type,
- c.driver_price,c.station_id,dept_name as station_name,u.nick_name as create_name
- from station_settlement_price_adjust c left join sys_dept d on c.station_id = d.dept_id
- left join sys_user u on c.create_by =u.user_id
- </sql>
- <select id="selectStationSettlementPriceAdjustList" parameterType="StationSettlementPriceAdjust" resultMap="StationSettlementPriceAdjustResult">
- <include refid="selectStationSettlementPriceAdjustVo"/>
- <where>
- <if test="settlementPrice != null "> and settlement_price = #{settlementPrice}</if>
- <if test="settlementType != null and settlementType != ''"> and settlement_type = #{settlementType}</if>
- <if test="driverPrice != null "> and driver_price = #{driverPrice}</if>
- <if test="stationId != null "> and station_id = #{stationId}</if>
- <if test="parentId != null "> and parent_id = #{parentId}</if>
- <if test="stationIdList != null ">
- and station_id in
- <foreach item="item" index="index" collection="stationIdList"
- open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- </where>
- order by id desc
- </select>
- <select id="selectStationSettlementPriceAdjustById" parameterType="Integer" resultMap="StationSettlementPriceAdjustResult">
- <include refid="selectStationSettlementPriceAdjustVo"/>
- where id = #{id}
- </select>
- <insert id="insertStationSettlementPriceAdjust" parameterType="StationSettlementPriceAdjust" useGeneratedKeys="true" keyProperty="id">
- insert into station_settlement_price_adjust
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">id,</if>
- <if test="createBy != null">create_by,</if>
- <if test="createTime != null">create_time,</if>
- <if test="settlementPrice != null">settlement_price,</if>
- <if test="settlementType != null">settlement_type,</if>
- <if test="driverPrice != null">driver_price,</if>
- <if test="stationId != null">station_id,</if>
- <if test="parentId != null">parent_id,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null">#{id},</if>
- <if test="createBy != null">#{createBy},</if>
- <if test="createTime != null">#{createTime},</if>
- <if test="settlementPrice != null">#{settlementPrice},</if>
- <if test="settlementType != null">#{settlementType},</if>
- <if test="driverPrice != null">#{driverPrice},</if>
- <if test="stationId != null">#{stationId},</if>
- <if test="parentId != null">#{parentId},</if>
- </trim>
- </insert>
- <update id="updateStationSettlementPriceAdjust" parameterType="StationSettlementPriceAdjust">
- update station_settlement_price_adjust
- <trim prefix="SET" suffixOverrides=",">
- <if test="createBy != null">create_by = #{createBy},</if>
- <if test="createTime != null">create_time = #{createTime},</if>
- <if test="settlementPrice != null">settlement_price = #{settlementPrice},</if>
- <if test="settlementType != null">settlement_type = #{settlementType},</if>
- <if test="driverPrice != null">driver_price = #{driverPrice},</if>
- <if test="stationId != null">station_id = #{stationId},</if>
- <if test="parentId != null">parent_id = #{parentId},</if>
- </trim>
- where id = #{id}
- </update>
- <delete id="deleteStationSettlementPriceAdjustById" parameterType="Integer">
- delete from station_settlement_price_adjust where id = #{id}
- </delete>
- <delete id="deleteStationSettlementPriceAdjustByIds" parameterType="String">
- delete from station_settlement_price_adjust where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- </mapper>
|