123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- <?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.StationBalanceChangeMapper">
- <resultMap type="StationBalanceChange" id="StationBalanceChangeResult">
- <result property="id" column="id" />
- <result property="stationId" column="station_id" />
- <result property="orderNo" column="order_no" />
- <result property="type" column="type" />
- <result property="amt" column="amt" />
- <result property="createTime" column="create_time" />
- <result property="createBy" column="create_by" />
- <result property="createName" column="create_name" />
- <result property="stationName" column="station_name" />
- <result property="nowAmt" column="now_amt" />
- </resultMap>
- <sql id="selectStationBalanceChangeVo">
- select c.id, c.station_id, c.order_no, c.type, c.amt, c.create_time, c.create_by,dept_name as station_name,u.nick_name as create_name,c.now_amt
- from station_balance_change 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="selectStationBalanceChangeList" parameterType="StationBalanceChange" resultMap="StationBalanceChangeResult">
- <include refid="selectStationBalanceChangeVo"/>
- <where>
- <if test="stationId != null "> and station_id = #{stationId}</if>
- <if test="orderNo != null and orderNo != ''"> and order_no = #{orderNo}</if>
- <if test="type != null and type != ''"> and type = #{type}</if>
- <if test="amt != null "> and amt = #{amt}</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="selectStationBalanceChangeById" parameterType="Long" resultMap="StationBalanceChangeResult">
- <include refid="selectStationBalanceChangeVo"/>
- where id = #{id}
- </select>
- <insert id="insertStationBalanceChange" parameterType="StationBalanceChange" useGeneratedKeys="true" keyProperty="id">
- insert into station_balance_change
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="stationId != null">station_id,</if>
- <if test="orderNo != null">order_no,</if>
- <if test="type != null and type != ''">type,</if>
- <if test="amt != null">amt,</if>
- <if test="createTime != null">create_time,</if>
- <if test="createBy != null and createBy != ''">create_by,</if>
- <if test="nowAmt != null and nowAmt != ''">now_amt,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="stationId != null">#{stationId},</if>
- <if test="orderNo != null">#{orderNo},</if>
- <if test="type != null and type != ''">#{type},</if>
- <if test="amt != null">#{amt},</if>
- <if test="createTime != null">#{createTime},</if>
- <if test="createBy != null and createBy != ''">#{createBy},</if>
- <if test="nowAmt != null and nowAmt != ''">#{nowAmt},</if>
- </trim>
- </insert>
- <update id="updateStationBalanceChange" parameterType="StationBalanceChange">
- update station_balance_change
- <trim prefix="SET" suffixOverrides=",">
- <if test="stationId != null">station_id = #{stationId},</if>
- <if test="orderNo != null">order_no = #{orderNo},</if>
- <if test="type != null and type != ''">type = #{type},</if>
- <if test="amt != null">amt = #{amt},</if>
- <if test="createTime != null">create_time = #{createTime},</if>
- <if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
- </trim>
- where id = #{id}
- </update>
- <delete id="deleteStationBalanceChangeById" parameterType="Long">
- delete from station_balance_change where id = #{id}
- </delete>
- <delete id="deleteStationBalanceChangeByIds" parameterType="String">
- delete from station_balance_change where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- </mapper>
|