123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- <?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.StationSettlementPriceMapper">
- <resultMap type="StationSettlementPrice" id="StationSettlementPriceResult">
- <result property="id" column="id" />
- <result property="stationId" column="station_id" />
- <result property="settlementType" column="settlement_type" />
- <result property="settlementPrice" column="settlement_price" />
- <result property="driverPrice" column="driver_price" />
- <result property="driverPriceType" column="driver_price_type" />
- <result property="createTime" column="create_time" />
- <result property="createBy" column="create_by" />
- <result property="updateTime" column="update_time" />
- <result property="updateBy" column="update_by" />
- <result property="balance" column="balance" />
- <result property="deptId" column="dept_id" />
- <result property="stationName" column="station_name" />
- </resultMap>
- <sql id="selectStationSettlementPriceVo">
- select id, station_id, settlement_type, settlement_price, driver_price,p.create_by,p.create_time,
- p.update_by,p.update_time,d.dept_name as station_name,balance,dept_id,driver_price_type
- from sys_dept d left join station_settlement_price p on d.dept_id = p.station_id </sql>
- <select id="selectStationSettlementPriceList" parameterType="StationSettlementPrice" resultMap="StationSettlementPriceResult">
- <include refid="selectStationSettlementPriceVo"/>
- <where>
- and d.del_flag ='0'
- <if test="stationId != null "> and station_id = #{stationId}</if>
- <if test="settlementType != null and settlementType != ''"> and settlement_type = #{settlementType}</if>
- <if test="settlementPrice != null and settlementPrice != ''"> and settlement_price = #{settlementPrice}</if>
- <if test="driverPrice != null and driverPrice != ''"> and driver_price = #{driverPrice}</if>
- <if test="driverPriceType != null and driverPriceType != ''"> and driver_price_type = #{driverPriceType}</if>
- <if test="stationIdList != null ">
- and d.dept_id in
- <foreach item="item" index="index" collection="stationIdList"
- open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- </where>
- </select>
- <select id="selectStationSettlementPriceById" parameterType="Integer" resultMap="StationSettlementPriceResult">
- <include refid="selectStationSettlementPriceVo"/>
- where id = #{id}
- </select>
- <insert id="insertStationSettlementPrice" parameterType="StationSettlementPrice">
- insert into station_settlement_price
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">id,</if>
- <if test="stationId != null">station_id,</if>
- <if test="settlementType != null">settlement_type,</if>
- <if test="settlementPrice != null">settlement_price,</if>
- <if test="driverPrice != null">driver_price,</if>
- <if test="driverPriceType != null">driver_price_type,</if>
- <if test="createTime != null">create_time,</if>
- <if test="createBy != null">create_by,</if>
- <if test="updateTime != null">update_time,</if>
- <if test="updateBy != null">update_by,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null">#{id},</if>
- <if test="stationId != null">#{stationId},</if>
- <if test="settlementType != null">#{settlementType},</if>
- <if test="settlementPrice != null">#{settlementPrice},</if>
- <if test="driverPrice != null">#{driverPrice},</if>
- <if test="driverPriceType != null">#{driverPriceType},</if>
- <if test="createTime != null">#{createTime},</if>
- <if test="createBy != null">#{createBy},</if>
- <if test="updateTime != null">#{updateTime},</if>
- <if test="updateBy != null">#{updateBy},</if>
- </trim>
- </insert>
- <update id="updateStationSettlementPrice" parameterType="StationSettlementPrice">
- update station_settlement_price
- <trim prefix="SET" suffixOverrides=",">
- <if test="stationId != null">station_id = #{stationId},</if>
- <if test="settlementType != null">settlement_type = #{settlementType},</if>
- <if test="settlementPrice != null">settlement_price = #{settlementPrice},</if>
- <if test="driverPrice != null">driver_price = #{driverPrice},</if>
- <if test="driverPriceType != null">driver_price_type = #{driverPriceType},</if>
- <if test="createTime != null">create_time = #{createTime},</if>
- <if test="createBy != null">create_by = #{createBy},</if>
- <if test="updateTime != null">update_time = #{updateTime},</if>
- <if test="updateBy != null">update_by = #{updateBy},</if>
- </trim>
- where id = #{id}
- </update>
- <delete id="deleteStationSettlementPriceById" parameterType="Integer">
- delete from station_settlement_price where id = #{id}
- </delete>
- <delete id="deleteStationSettlementPriceByIds" parameterType="String">
- delete from station_settlement_price where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- </mapper>
|