<?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.ruoyi.cwgl.mapper.RequestLogMapper">
|
|
<resultMap type="com.ruoyi.cwgl.domain.RequestLog" id="RequestLogResult">
|
<result property="id" column="id" />
|
<result property="driverCode" column="driver_code" />
|
<result property="driverName" column="driver_name" />
|
<result property="boxNum" column="box_num" />
|
<result property="createBy" column="create_by" />
|
<result property="createTime" column="create_time" />
|
<result property="reqTime" column="req_time" />
|
<result property="type" column="type" />
|
<result property="operation" column="operation" />
|
</resultMap>
|
|
<sql id="selectRequestLogVo">
|
select thisTab.id, thisTab.driver_code, thisTab.driver_name, thisTab.box_num, thisTab.create_by, thisTab.create_time, thisTab.req_time, thisTab.type, thisTab.operation from request_log AS thisTab
|
</sql>
|
<sql id="selectRequestLogVoCount">
|
select count(0) from request_log as thisTab
|
</sql>
|
|
<sql id="whereCondition">
|
<if test="driverCode != null and driverCode != ''"> and thisTab.driver_code = #{driverCode}</if>
|
<if test="driverName != null and driverName != ''"> and thisTab.driver_name like concat('%', #{driverName}, '%')</if>
|
<if test="boxNum != null and boxNum != ''"> and thisTab.box_num = #{boxNum}</if>
|
<if test="reqTime != null "> and thisTab.req_time = #{reqTime}</if>
|
<if test="type != null "> and thisTab.type = #{type}</if>
|
<if test="operation != null and operation != ''"> and thisTab.operation = #{operation}</if>
|
</sql>
|
|
<!--查询-->
|
<select id="selectRequestLogById" parameterType="Integer" resultMap="RequestLogResult">
|
<include refid="selectRequestLogVo"/>
|
where id = #{id}
|
</select>
|
|
<select id="selectRequestLogCount" parameterType="com.ruoyi.cwgl.domain.RequestLog" resultType="int">
|
<include refid="selectRequestLogVoCount"/>
|
<where>
|
<include refid="whereCondition"/>
|
</where>
|
</select>
|
|
<select id="selectRequestLogList" parameterType="com.ruoyi.cwgl.domain.RequestLog" resultMap="RequestLogResult">
|
<include refid="selectRequestLogVo"/>
|
<where>
|
<include refid="whereCondition"/>
|
</where>
|
order by thisTab.id desc
|
</select>
|
|
<!-- 新增 -->
|
<insert id="insertRequestLog" parameterType="com.ruoyi.cwgl.domain.RequestLog" useGeneratedKeys="true" keyProperty="id">
|
insert into request_log
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="driverCode != null">driver_code,</if>
|
<if test="driverName != null">driver_name,</if>
|
<if test="boxNum != null">box_num,</if>
|
<if test="createBy != null">create_by,</if>
|
<if test="createTime != null">create_time,</if>
|
<if test="reqTime != null">req_time,</if>
|
<if test="type != null">type,</if>
|
<if test="operation != null">operation,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="driverCode != null">#{driverCode},</if>
|
<if test="driverName != null">#{driverName},</if>
|
<if test="boxNum != null">#{boxNum},</if>
|
<if test="createBy != null">#{createBy},</if>
|
<if test="createTime != null">#{createTime},</if>
|
<if test="reqTime != null">#{reqTime},</if>
|
<if test="type != null">#{type},</if>
|
<if test="operation != null">#{operation},</if>
|
</trim>
|
</insert>
|
|
<insert id="insertRequestLogBatch" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
|
insert into request_log
|
<trim prefix="(" suffix=") values" suffixOverrides=",">
|
id,driver_code,driver_name,box_num,create_by,create_time,req_time,type,operation,
|
</trim>
|
<foreach item="item" index="index" collection="list" separator=",">
|
<trim prefix="(" suffix=") " suffixOverrides=",">
|
#{item.id},#{item.driverCode},#{item.driverName},#{item.boxNum},#{item.createBy},#{item.createTime},#{item.reqTime},#{item.type},#{item.operation},
|
</trim>
|
</foreach>
|
</insert>
|
|
<!-- 修改 -->
|
<update id="updateRequestLog" parameterType="com.ruoyi.cwgl.domain.RequestLog">
|
update request_log
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="driverCode != null">driver_code = #{driverCode},</if>
|
<if test="driverName != null">driver_name = #{driverName},</if>
|
<if test="boxNum != null">box_num = #{boxNum},</if>
|
<if test="createBy != null">create_by = #{createBy},</if>
|
<if test="createTime != null">create_time = #{createTime},</if>
|
<if test="reqTime != null">req_time = #{reqTime},</if>
|
<if test="type != null">type = #{type},</if>
|
<if test="operation != null">operation = #{operation},</if>
|
</trim>
|
where id = #{id}
|
</update>
|
<!-- 修改 -->
|
<update id="updateRequestLogBatch" parameterType="java.util.List">
|
<foreach collection="list" item="item" index="index" separator=";">
|
update request_log
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="item.driverCode != null">driver_code = #{item.driverCode},</if>
|
<if test="item.driverName != null">driver_name = #{item.driverName},</if>
|
<if test="item.boxNum != null">box_num = #{item.boxNum},</if>
|
<if test="item.createBy != null">create_by = #{item.createBy},</if>
|
<if test="item.createTime != null">create_time = #{item.createTime},</if>
|
<if test="item.reqTime != null">req_time = #{item.reqTime},</if>
|
<if test="item.type != null">type = #{item.type},</if>
|
<if test="item.operation != null">operation = #{item.operation},</if>
|
</trim>
|
where id = #{item.id}
|
</foreach>
|
</update>
|
|
<!--删除-->
|
<delete id="deleteRequestLogById" parameterType="Integer">
|
delete from request_log where id = #{id}
|
</delete>
|
<delete id="deleteRequestLogByIds" parameterType="Integer">
|
delete from request_log where id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</delete>
|
|
</mapper>
|