mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 11:05:18 +08:00
同步充电桩数据
This commit is contained in:
@@ -0,0 +1,113 @@
|
||||
<?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.jsowell.pile.mapper.JcppSyncRecordMapper">
|
||||
|
||||
<resultMap type="com.jsowell.pile.domain.JcppSyncRecord" id="JcppSyncRecordResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="syncType" column="sync_type" />
|
||||
<result property="syncStatus" column="sync_status" />
|
||||
<result property="startTime" column="start_time" />
|
||||
<result property="endTime" column="end_time" />
|
||||
<result property="totalPiles" column="total_piles" />
|
||||
<result property="successPiles" column="success_piles" />
|
||||
<result property="failedPiles" column="failed_piles" />
|
||||
<result property="totalGuns" column="total_guns" />
|
||||
<result property="successGuns" column="success_guns" />
|
||||
<result property="failedGuns" column="failed_guns" />
|
||||
<result property="errorMessage" column="error_message" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectJcppSyncRecordVo">
|
||||
select id, sync_type, sync_status, start_time, end_time, total_piles, success_piles, failed_piles, total_guns, success_guns, failed_guns, error_message, create_by, create_time from jcpp_sync_record
|
||||
</sql>
|
||||
|
||||
<select id="selectJcppSyncRecordList" parameterType="com.jsowell.pile.domain.JcppSyncRecord" resultMap="JcppSyncRecordResult">
|
||||
<include refid="selectJcppSyncRecordVo"/>
|
||||
<where>
|
||||
<if test="syncType != null and syncType != ''"> and sync_type = #{syncType}</if>
|
||||
<if test="syncStatus != null and syncStatus != ''"> and sync_status = #{syncStatus}</if>
|
||||
<if test="startTime != null "> and start_time >= #{startTime}</if>
|
||||
<if test="endTime != null "> and end_time <= #{endTime}</if>
|
||||
</where>
|
||||
order by start_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectJcppSyncRecordById" parameterType="Long" resultMap="JcppSyncRecordResult">
|
||||
<include refid="selectJcppSyncRecordVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="selectLastSuccessRecord" parameterType="String" resultMap="JcppSyncRecordResult">
|
||||
<include refid="selectJcppSyncRecordVo"/>
|
||||
where sync_type = #{syncType} and sync_status = 'SUCCESS'
|
||||
order by start_time desc
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
<insert id="insertJcppSyncRecord" parameterType="com.jsowell.pile.domain.JcppSyncRecord" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into jcpp_sync_record
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="syncType != null and syncType != ''">sync_type,</if>
|
||||
<if test="syncStatus != null and syncStatus != ''">sync_status,</if>
|
||||
<if test="startTime != null">start_time,</if>
|
||||
<if test="endTime != null">end_time,</if>
|
||||
<if test="totalPiles != null">total_piles,</if>
|
||||
<if test="successPiles != null">success_piles,</if>
|
||||
<if test="failedPiles != null">failed_piles,</if>
|
||||
<if test="totalGuns != null">total_guns,</if>
|
||||
<if test="successGuns != null">success_guns,</if>
|
||||
<if test="failedGuns != null">failed_guns,</if>
|
||||
<if test="errorMessage != null">error_message,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="syncType != null and syncType != ''">#{syncType},</if>
|
||||
<if test="syncStatus != null and syncStatus != ''">#{syncStatus},</if>
|
||||
<if test="startTime != null">#{startTime},</if>
|
||||
<if test="endTime != null">#{endTime},</if>
|
||||
<if test="totalPiles != null">#{totalPiles},</if>
|
||||
<if test="successPiles != null">#{successPiles},</if>
|
||||
<if test="failedPiles != null">#{failedPiles},</if>
|
||||
<if test="totalGuns != null">#{totalGuns},</if>
|
||||
<if test="successGuns != null">#{successGuns},</if>
|
||||
<if test="failedGuns != null">#{failedGuns},</if>
|
||||
<if test="errorMessage != null">#{errorMessage},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateJcppSyncRecord" parameterType="com.jsowell.pile.domain.JcppSyncRecord">
|
||||
update jcpp_sync_record
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="syncType != null and syncType != ''">sync_type = #{syncType},</if>
|
||||
<if test="syncStatus != null and syncStatus != ''">sync_status = #{syncStatus},</if>
|
||||
<if test="startTime != null">start_time = #{startTime},</if>
|
||||
<if test="endTime != null">end_time = #{endTime},</if>
|
||||
<if test="totalPiles != null">total_piles = #{totalPiles},</if>
|
||||
<if test="successPiles != null">success_piles = #{successPiles},</if>
|
||||
<if test="failedPiles != null">failed_piles = #{failedPiles},</if>
|
||||
<if test="totalGuns != null">total_guns = #{totalGuns},</if>
|
||||
<if test="successGuns != null">success_guns = #{successGuns},</if>
|
||||
<if test="failedGuns != null">failed_guns = #{failedGuns},</if>
|
||||
<if test="errorMessage != null">error_message = #{errorMessage},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteJcppSyncRecordById" parameterType="Long">
|
||||
delete from jcpp_sync_record where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteJcppSyncRecordByIds" parameterType="String">
|
||||
delete from jcpp_sync_record where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user