|
@@ -0,0 +1,105 @@
|
|
|
+<?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.qdtl.mapper.TlPlanRecordMapper">
|
|
|
+
|
|
|
+ <resultMap type="TlPlanRecord" id="TlPlanRecordResult">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="planId" column="plan_id" />
|
|
|
+ <result property="planDate" column="plan_date" />
|
|
|
+ <result property="planName" column="plan_name" />
|
|
|
+ <result property="userId" column="user_id" />
|
|
|
+ <result property="nickName" column="nick_name" />
|
|
|
+ <result property="card" column="card" />
|
|
|
+ <result property="checkpointCard" column="checkpoint_card" />
|
|
|
+ <result property="deviceCode" column="device_code" />
|
|
|
+ <result property="fence" column="fence" />
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
+ <result property="score" column="score" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectTlPlanRecordVo">
|
|
|
+ select id, plan_id, plan_date, plan_name, user_id, nick_name, card, checkpoint_card, device_code, fence, create_time, score from tl_plan_record
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectTlPlanRecordList" parameterType="TlPlanRecord" resultMap="TlPlanRecordResult">
|
|
|
+ <include refid="selectTlPlanRecordVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="planId != null "> and plan_id = #{planId}</if>
|
|
|
+ <if test="planDate != null and planDate != ''"> and plan_date = #{planDate}</if>
|
|
|
+ <if test="planName != null and planName != ''"> and plan_name like concat('%', #{planName}, '%')</if>
|
|
|
+ <if test="userId != null "> and user_id = #{userId}</if>
|
|
|
+ <if test="nickName != null and nickName != ''"> and nick_name like concat('%', #{nickName}, '%')</if>
|
|
|
+ <if test="card != null and card != ''"> and card = #{card}</if>
|
|
|
+ <if test="checkpointCard != null and checkpointCard != ''"> and checkpoint_card = #{checkpointCard}</if>
|
|
|
+ <if test="deviceCode != null and deviceCode != ''"> and device_code = #{deviceCode}</if>
|
|
|
+ <if test="fence != null and fence != ''"> and fence = #{fence}</if>
|
|
|
+ <if test="score != null and score != ''"> and score = #{score}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectTlPlanRecordById" parameterType="Long" resultMap="TlPlanRecordResult">
|
|
|
+ <include refid="selectTlPlanRecordVo"/>
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertTlPlanRecord" parameterType="TlPlanRecord" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ insert into tl_plan_record
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="planId != null">plan_id,</if>
|
|
|
+ <if test="planDate != null">plan_date,</if>
|
|
|
+ <if test="planName != null">plan_name,</if>
|
|
|
+ <if test="userId != null">user_id,</if>
|
|
|
+ <if test="nickName != null">nick_name,</if>
|
|
|
+ <if test="card != null">card,</if>
|
|
|
+ <if test="checkpointCard != null">checkpoint_card,</if>
|
|
|
+ <if test="deviceCode != null">device_code,</if>
|
|
|
+ <if test="fence != null">fence,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ <if test="score != null">score,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="planId != null">#{planId},</if>
|
|
|
+ <if test="planDate != null">#{planDate},</if>
|
|
|
+ <if test="planName != null">#{planName},</if>
|
|
|
+ <if test="userId != null">#{userId},</if>
|
|
|
+ <if test="nickName != null">#{nickName},</if>
|
|
|
+ <if test="card != null">#{card},</if>
|
|
|
+ <if test="checkpointCard != null">#{checkpointCard},</if>
|
|
|
+ <if test="deviceCode != null">#{deviceCode},</if>
|
|
|
+ <if test="fence != null">#{fence},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ <if test="score != null">#{score},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateTlPlanRecord" parameterType="TlPlanRecord">
|
|
|
+ update tl_plan_record
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="planId != null">plan_id = #{planId},</if>
|
|
|
+ <if test="planDate != null">plan_date = #{planDate},</if>
|
|
|
+ <if test="planName != null">plan_name = #{planName},</if>
|
|
|
+ <if test="userId != null">user_id = #{userId},</if>
|
|
|
+ <if test="nickName != null">nick_name = #{nickName},</if>
|
|
|
+ <if test="card != null">card = #{card},</if>
|
|
|
+ <if test="checkpointCard != null">checkpoint_card = #{checkpointCard},</if>
|
|
|
+ <if test="deviceCode != null">device_code = #{deviceCode},</if>
|
|
|
+ <if test="fence != null">fence = #{fence},</if>
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
+ <if test="score != null">score = #{score},</if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteTlPlanRecordById" parameterType="Long">
|
|
|
+ delete from tl_plan_record where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteTlPlanRecordByIds" parameterType="String">
|
|
|
+ delete from tl_plan_record where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|