<?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.jeecg.modules.subscribe.mapper.SubscribeMapper"><select id="getAllSubscribe" resultType="org.jeecg.modules.subscribe.entity.vo.OneVo">
SELECT
user_id as userId,
province_name as provinceName,
city_name as cityName,
begin_time as beginTimel,
end_time as endTime
FROM
gk_subscribe
WHERE
subscribe_state =1</select><insert id="insertInto">
INSERT INTO gk_subscribe_notice (
notice_create_time,
notice_name,
site_sheng,
site_shi,
site_qx,
site_name,
notice_url,
notice_type,
user_id
)
VALUES
(#{noticeCreateTime},
#{noticeName},
#{siteSheng},
#{siteShi},
#{qx},
#{siteName},
#{noticeUrl},
#{noticeType},
#{userId})</insert><select id="getAllNoticeInfoNb" resultType="org.jeecg.modules.subscribe.entity.vo.TwoVo">
SELECT
notice_url AS noticeUrl,
site_sheng AS siteSheng,
site_shi AS siteShi,
site_qx AS qx,
site_name AS siteName,
notice_name AS noticeName,
notice_create_time AS noticeCreateTime,
notice_type as noticeType
FROM
cj_notice_info
<where><if test="provinceName !=null and provinceName !=''">
AND site_sheng=#{provinceName}</if><if test="cityName !=null and cityName !=''">
AND site_shi=#{cityName}</if><if test ="beginTimel != null and endTime != null">
and notice_create_time between #{beginTimel} and #{endTime}</if></where></select><select id="selectCount" resultType="int">
SELECT
COUNT(1)
FROM
gk_subscribe_notice
WHERE
notice_url = #{noticeUrl}
AND user_id = #{userId}</select></mapper>
Vo
@DatapublicclassOneVo{private String userId;private String provinceName;private String cityName;/** 開始時間*/@JsonFormat(timezone ="GMT+8",pattern ="yyyy-MM-dd")@DateTimeFormat(pattern="yyyy-MM-dd")private Date beginTimel;/** 結束時間*/@JsonFormat(timezone ="GMT+8",pattern ="yyyy-MM-dd")@DateTimeFormat(pattern="yyyy-MM-dd")private Date endTime;private List<TwoVo> twoVo;