Synchronizer

This commit is contained in:
MaxKey
2021-05-23 21:10:54 +08:00
parent 97be43544a
commit 804bddf1a7
11 changed files with 552 additions and 99 deletions

View File

@@ -0,0 +1,30 @@
/*
* Copyright [2020] [MaxKey of copyright http://www.maxkey.top]
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.maxkey.persistence.mapper;
import org.apache.mybatis.jpa.persistence.IJpaBaseMapper;
import org.maxkey.entity.HistorySynchronizer;
/**
* @author Crystal.sea
*
*/
public interface HistorySynchronizerMapper extends IJpaBaseMapper<HistorySynchronizer> {
}

View File

@@ -0,0 +1,40 @@
/*
* Copyright [2020] [MaxKey of copyright http://www.maxkey.top]
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.maxkey.persistence.service;
import org.apache.mybatis.jpa.persistence.JpaBaseService;
import org.maxkey.entity.HistorySynchronizer;
import org.maxkey.persistence.mapper.HistorySynchronizerMapper;
import org.springframework.stereotype.Repository;
@Repository
public class HistorySynchronizerService extends JpaBaseService<HistorySynchronizer>{
public HistorySynchronizerService() {
super(HistorySynchronizerMapper.class);
}
/* (non-Javadoc)
* @see com.connsec.db.service.BaseService#getMapper()
*/
@Override
public HistorySynchronizerMapper getMapper() {
// TODO Auto-generated method stub
return (HistorySynchronizerMapper)super.getMapper();
}
}

View File

@@ -0,0 +1,22 @@
<?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="org.maxkey.persistence.mapper.HistorySynchronizerMapper" >
<sql id="where_statement">
<if test="id != null and id != ''">
and id = #{id}
</if>
</sql>
<select id="queryPageResults" parameterType="HistorySynchronizer" resultType="HistorySynchronizer">
select
*
from mxk_history_synchronizer
where 1 = 1
<include refid="where_statement"/>
order by synctime desc
</select>
</mapper>