通知公告
This commit is contained in:
MaxKey
2021-03-27 13:14:56 +08:00
parent b11effe79a
commit 031970d00d
94 changed files with 1906 additions and 19 deletions

View File

@@ -0,0 +1,33 @@
/*
* Copyright [2021] [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.domain.Notices;
/**
* @author Crystal.sea
*
*/
public interface NoticesMapper extends IJpaBaseMapper<Notices> {
public Notices queryLastedNotices();
}

View File

@@ -0,0 +1,45 @@
/*
* Copyright [2021] [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.domain.Notices;
import org.maxkey.persistence.mapper.NoticesMapper;
import org.springframework.stereotype.Repository;
@Repository
public class NoticesService extends JpaBaseService<Notices>{
public NoticesService() {
super(NoticesMapper.class);
}
/* (non-Javadoc)
* @see com.connsec.db.service.BaseService#getMapper()
*/
@Override
public NoticesMapper getMapper() {
// TODO Auto-generated method stub
return (NoticesMapper)super.getMapper();
}
public Notices queryLastedNotices() {
return getMapper().queryLastedNotices();
}
}

View File

@@ -0,0 +1,36 @@
<?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.NoticesMapper">
<sql id="where_statement">
<if test="id != null and id != ''">
AND ID = #{id}
</if>
<if test="title != null and title != ''">
AND TITLE LIKE '%${title}%'
</if>
</sql>
<select id="queryPageResults" parameterType="Notices" resultType="Notices">
SELECT
*
FROM
MXK_NOTICES
WHERE
(1=1)
<include refid="where_statement"/>
ORDER BY MODIFIEDDATE DESC
</select>
<select id="queryLastedNotices" parameterType="Notices" resultType="Notices">
SELECT
*
FROM
MXK_NOTICES
ORDER BY MODIFIEDDATE DESC
LIMIT 1
</select>
</mapper>