parent
ae6c6fe204
commit
67b8ebcad1
@ -0,0 +1,124 @@
|
||||
package com.ssf.mysqloracletest.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Entity基类
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class BaseEntity implements Serializable
|
||||
{
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 搜索值 */
|
||||
@TableField(exist = false)
|
||||
private String searchValue;
|
||||
|
||||
/** 创建者 */
|
||||
@TableField(exist = false)
|
||||
private String createBy;
|
||||
|
||||
/** 创建时间 */
|
||||
@TableField(exist = false)
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
/** 更新者 */
|
||||
@TableField(exist = false)
|
||||
private String updateBy;
|
||||
|
||||
/** 更新时间 */
|
||||
@TableField(exist = false)
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
|
||||
/** 备注 */
|
||||
@TableField(exist = false)
|
||||
private String remark;
|
||||
|
||||
/** 请求参数 */
|
||||
@TableField(exist = false)
|
||||
private Map<String, Object> params;
|
||||
|
||||
public String getSearchValue()
|
||||
{
|
||||
return searchValue;
|
||||
}
|
||||
|
||||
public void setSearchValue(String searchValue)
|
||||
{
|
||||
this.searchValue = searchValue;
|
||||
}
|
||||
|
||||
public String getCreateBy()
|
||||
{
|
||||
return createBy;
|
||||
}
|
||||
|
||||
public void setCreateBy(String createBy)
|
||||
{
|
||||
this.createBy = createBy;
|
||||
}
|
||||
|
||||
public Date getCreateTime()
|
||||
{
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Date createTime)
|
||||
{
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public String getUpdateBy()
|
||||
{
|
||||
return updateBy;
|
||||
}
|
||||
|
||||
public void setUpdateBy(String updateBy)
|
||||
{
|
||||
this.updateBy = updateBy;
|
||||
}
|
||||
|
||||
public Date getUpdateTime()
|
||||
{
|
||||
return updateTime;
|
||||
}
|
||||
|
||||
public void setUpdateTime(Date updateTime)
|
||||
{
|
||||
this.updateTime = updateTime;
|
||||
}
|
||||
|
||||
public String getRemark()
|
||||
{
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(String remark)
|
||||
{
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public Map<String, Object> getParams()
|
||||
{
|
||||
if (params == null)
|
||||
{
|
||||
params = new HashMap<>();
|
||||
}
|
||||
return params;
|
||||
}
|
||||
|
||||
public void setParams(Map<String, Object> params)
|
||||
{
|
||||
this.params = params;
|
||||
}
|
||||
}
|
@ -0,0 +1,246 @@
|
||||
package com.ssf.mysqloracletest.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 场所信息表
|
||||
* @TableName base_place_info
|
||||
*/
|
||||
@TableName(value ="base_place_info")
|
||||
@Data
|
||||
public class BasePlaceInfo implements Serializable {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 场所编码
|
||||
*/
|
||||
private String placeCode;
|
||||
|
||||
/**
|
||||
* 场所名称
|
||||
*/
|
||||
private String placeName;
|
||||
|
||||
/**
|
||||
* 场所平面图
|
||||
*/
|
||||
private String placePic;
|
||||
|
||||
/**
|
||||
* 场所类别
|
||||
*/
|
||||
private Integer placeCategory;
|
||||
|
||||
/**
|
||||
* 场所类型
|
||||
*/
|
||||
private Integer placeType;
|
||||
|
||||
/**
|
||||
* 场所性质
|
||||
*/
|
||||
private Integer placeNature;
|
||||
|
||||
/**
|
||||
* 占地面积
|
||||
*/
|
||||
private String coversAcreage;
|
||||
|
||||
/**
|
||||
* 建筑面积
|
||||
*/
|
||||
private String structureAcreage;
|
||||
|
||||
/**
|
||||
* 建成时间
|
||||
*/
|
||||
private String neighBulitTime;
|
||||
|
||||
/**
|
||||
* 启用时间
|
||||
*/
|
||||
private String activeuseTime;
|
||||
|
||||
/**
|
||||
* 接入状态
|
||||
*/
|
||||
private Integer accessType;
|
||||
|
||||
/**
|
||||
* 绿化率
|
||||
*/
|
||||
private String afforestationRate;
|
||||
|
||||
/**
|
||||
* 容积率
|
||||
*/
|
||||
private String plotRate;
|
||||
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
private BigDecimal longitude;
|
||||
|
||||
/**
|
||||
* 纬度
|
||||
*/
|
||||
private BigDecimal latitude;
|
||||
|
||||
/**
|
||||
* 场所标准地址
|
||||
*/
|
||||
private String placeAddress;
|
||||
|
||||
/**
|
||||
* 省编码
|
||||
*/
|
||||
private String provinceCode;
|
||||
|
||||
/**
|
||||
* 省名称
|
||||
*/
|
||||
private String provinceName;
|
||||
|
||||
/**
|
||||
* 城市编码
|
||||
*/
|
||||
private String cityCode;
|
||||
|
||||
/**
|
||||
* 城市名称
|
||||
*/
|
||||
private String cityName;
|
||||
|
||||
/**
|
||||
* 区域编码
|
||||
*/
|
||||
private String areaCode;
|
||||
|
||||
/**
|
||||
* 区域名称
|
||||
*/
|
||||
private String areaName;
|
||||
|
||||
/**
|
||||
* 街道/乡镇编码
|
||||
*/
|
||||
private String streetCode;
|
||||
|
||||
/**
|
||||
* 街道/乡镇名称
|
||||
*/
|
||||
private String streetName;
|
||||
|
||||
/**
|
||||
* 社区/村编码
|
||||
*/
|
||||
private String blockCode;
|
||||
|
||||
/**
|
||||
* 社区/村名称
|
||||
*/
|
||||
private String blockName;
|
||||
|
||||
/**
|
||||
* 开发商名称
|
||||
*/
|
||||
private String estateDeveloper;
|
||||
|
||||
/**
|
||||
* 开发商联系人照片
|
||||
*/
|
||||
private String developerPic;
|
||||
|
||||
/**
|
||||
* 开发商联系人姓名
|
||||
*/
|
||||
private String developerName;
|
||||
|
||||
/**
|
||||
* 开发商联系电话
|
||||
*/
|
||||
private String developerPhone;
|
||||
|
||||
/**
|
||||
* 物业公司名称
|
||||
*/
|
||||
private String propertyCompany;
|
||||
|
||||
/**
|
||||
* 物业联系人姓名
|
||||
*/
|
||||
private String propertyName;
|
||||
|
||||
/**
|
||||
* 物业联系人电话
|
||||
*/
|
||||
private String propertyPhone;
|
||||
|
||||
/**
|
||||
* 物业联系人照片
|
||||
*/
|
||||
private String propertyPic;
|
||||
|
||||
/**
|
||||
* 警务区名称
|
||||
*/
|
||||
private String policeDistrict;
|
||||
|
||||
/**
|
||||
* 警务区编码
|
||||
*/
|
||||
private String policeDistrictCode;
|
||||
|
||||
/**
|
||||
* 责任民警姓名
|
||||
*/
|
||||
private String policeName;
|
||||
|
||||
/**
|
||||
* 警员编号
|
||||
*/
|
||||
private String policeNo;
|
||||
|
||||
/**
|
||||
* 责任民警电话
|
||||
*/
|
||||
private String policePhone;
|
||||
|
||||
/**
|
||||
* 责任民警照片
|
||||
*/
|
||||
private String policePic;
|
||||
|
||||
/**
|
||||
* 维数场所编码
|
||||
*/
|
||||
private String dimensoftVillageCode;
|
||||
|
||||
/**
|
||||
* 20位目录编码
|
||||
*/
|
||||
private String policeVillageCode;
|
||||
|
||||
/**
|
||||
* 管辖单位编码
|
||||
*/
|
||||
private String jurisdictionalUnitCode;
|
||||
|
||||
/**
|
||||
* 0:不活跃,1:活跃
|
||||
*/
|
||||
private Integer isActive;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
@ -0,0 +1,191 @@
|
||||
package com.ssf.mysqloracletest.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 住户信息表
|
||||
* @TableName base_user_info
|
||||
*/
|
||||
@TableName(value ="base_user_info")
|
||||
@Data
|
||||
public class BaseUserInfo implements Serializable {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 场所编码
|
||||
*/
|
||||
private String placeCode;
|
||||
|
||||
/**
|
||||
* 场所名称
|
||||
*/
|
||||
private String placeName;
|
||||
|
||||
/**
|
||||
* 网格编码
|
||||
*/
|
||||
private String gridCode;
|
||||
|
||||
/**
|
||||
* 网格名称
|
||||
*/
|
||||
private String gridName;
|
||||
|
||||
/**
|
||||
* 楼栋编码
|
||||
*/
|
||||
private String buildingCode;
|
||||
|
||||
/**
|
||||
* 楼栋名称
|
||||
*/
|
||||
private String buildingName;
|
||||
|
||||
/**
|
||||
* 单元编码
|
||||
*/
|
||||
private String unitCode;
|
||||
|
||||
/**
|
||||
* 单元名称
|
||||
*/
|
||||
private String unitName;
|
||||
|
||||
/**
|
||||
* 房屋编码
|
||||
*/
|
||||
private String homeCode;
|
||||
|
||||
/**
|
||||
* 房屋名称
|
||||
*/
|
||||
private String homeName;
|
||||
|
||||
/**
|
||||
* 人员姓名
|
||||
*/
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 证件号码
|
||||
*/
|
||||
private String idCard;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 住户照片
|
||||
*/
|
||||
private String userPic;
|
||||
|
||||
/**
|
||||
* 常口库标准照片
|
||||
*/
|
||||
private String userStandardPic;
|
||||
|
||||
/**
|
||||
* 性别
|
||||
*/
|
||||
private Integer sex;
|
||||
|
||||
/**
|
||||
* 年龄
|
||||
*/
|
||||
private Integer age;
|
||||
|
||||
/**
|
||||
* 籍贯
|
||||
*/
|
||||
private String nativeplace;
|
||||
|
||||
/**
|
||||
* 户籍
|
||||
*/
|
||||
private String houseHoldRegister;
|
||||
|
||||
/**
|
||||
* 户籍地址
|
||||
*/
|
||||
private String houseHoldAddress;
|
||||
|
||||
/**
|
||||
* 实际居住地
|
||||
*/
|
||||
private String habitation;
|
||||
|
||||
/**
|
||||
* 人员类型
|
||||
*/
|
||||
private Integer personType;
|
||||
|
||||
/**
|
||||
* 人员类别
|
||||
*/
|
||||
private Integer personCategory;
|
||||
|
||||
/**
|
||||
* 关爱人员标签
|
||||
*/
|
||||
private Integer caringLabel;
|
||||
|
||||
/**
|
||||
* 是否户主
|
||||
*/
|
||||
private Integer isHouseholder;
|
||||
|
||||
/**
|
||||
* 与户主关系
|
||||
*/
|
||||
private Integer householderRelation;
|
||||
|
||||
/**
|
||||
* 人户关系
|
||||
*/
|
||||
private Integer userHomeRel;
|
||||
|
||||
/**
|
||||
* 实有人口更新数据标识
|
||||
*/
|
||||
private String actualPopulationFlag;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
private Integer createBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 更新者
|
||||
*/
|
||||
private Integer updateBy;
|
||||
|
||||
/**
|
||||
* 0:不活跃,1:活跃
|
||||
*/
|
||||
private Integer isActive;
|
||||
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
@ -0,0 +1,296 @@
|
||||
package com.ssf.mysqloracletest.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 从未出现住户信息表
|
||||
* @TableName model_notfound_user_info
|
||||
*/
|
||||
@TableName(value ="model_notfound_user_info")
|
||||
@Data
|
||||
public class ModelNotfoundUserInfo implements Serializable {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 小区编码
|
||||
*/
|
||||
private String placeCode;
|
||||
|
||||
/**
|
||||
* 小区名称
|
||||
*/
|
||||
private String placeName;
|
||||
|
||||
/**
|
||||
* 网格编码
|
||||
*/
|
||||
private String gridCode;
|
||||
|
||||
/**
|
||||
* 网格名称
|
||||
*/
|
||||
private String gridName;
|
||||
|
||||
/**
|
||||
* 楼栋编号
|
||||
*/
|
||||
private String buildingCode;
|
||||
|
||||
/**
|
||||
* 楼栋名称
|
||||
*/
|
||||
private String buildingName;
|
||||
|
||||
/**
|
||||
* 单元编码
|
||||
*/
|
||||
private String unitCode;
|
||||
|
||||
/**
|
||||
* 单元名称
|
||||
*/
|
||||
private String unitName;
|
||||
|
||||
/**
|
||||
* 房屋编码
|
||||
*/
|
||||
private String homeCode;
|
||||
|
||||
/**
|
||||
* 房屋名称
|
||||
*/
|
||||
private String homeName;
|
||||
|
||||
/**
|
||||
* 人员姓名
|
||||
*/
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 人员照片
|
||||
*/
|
||||
private String userPic;
|
||||
|
||||
/**
|
||||
* 常口库标准照片
|
||||
*/
|
||||
private String userStandardPic;
|
||||
|
||||
/**
|
||||
* 证件类型
|
||||
*/
|
||||
private Integer identityType;
|
||||
|
||||
/**
|
||||
* 证件号码
|
||||
*/
|
||||
private String idcard;
|
||||
|
||||
/**
|
||||
* 性别
|
||||
*/
|
||||
private Integer sex;
|
||||
|
||||
/**
|
||||
* 民族
|
||||
*/
|
||||
private Integer nation;
|
||||
|
||||
/**
|
||||
* 出生日期
|
||||
*/
|
||||
private Date birthday;
|
||||
|
||||
/**
|
||||
* 公司名称
|
||||
*/
|
||||
private String company;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 国籍
|
||||
*/
|
||||
private Integer nationality;
|
||||
|
||||
/**
|
||||
* 籍贯
|
||||
*/
|
||||
private String nativeplace;
|
||||
|
||||
/**
|
||||
* 学历
|
||||
*/
|
||||
private Integer education;
|
||||
|
||||
/**
|
||||
* 户籍
|
||||
*/
|
||||
private String houseHoldRegister;
|
||||
|
||||
/**
|
||||
* 户籍地址
|
||||
*/
|
||||
private String houseHoldAddress;
|
||||
|
||||
/**
|
||||
* 现居行政区编码
|
||||
*/
|
||||
private String areaCode;
|
||||
|
||||
/**
|
||||
* 现居行政区名称
|
||||
*/
|
||||
private String areaName;
|
||||
|
||||
/**
|
||||
* 实际居住地
|
||||
*/
|
||||
private String habitation;
|
||||
|
||||
/**
|
||||
* 宗教信仰
|
||||
*/
|
||||
private String religious;
|
||||
|
||||
/**
|
||||
* 政治面貌
|
||||
*/
|
||||
private Integer politicalOutlook;
|
||||
|
||||
/**
|
||||
* 入境时间
|
||||
*/
|
||||
private Long entryTime;
|
||||
|
||||
/**
|
||||
* 婚姻状况
|
||||
*/
|
||||
private Integer marriage;
|
||||
|
||||
/**
|
||||
* 人员类型
|
||||
*/
|
||||
private Integer personType;
|
||||
|
||||
/**
|
||||
* 人员类别
|
||||
*/
|
||||
private Integer personCategory;
|
||||
|
||||
/**
|
||||
* 关爱人员标签
|
||||
*/
|
||||
private Integer caringLabel;
|
||||
|
||||
/**
|
||||
* 是否户主
|
||||
*/
|
||||
private Integer isHouseholder;
|
||||
|
||||
/**
|
||||
* 与户主关系
|
||||
*/
|
||||
private Integer householderRelation;
|
||||
|
||||
/**
|
||||
* 是否接种疫苗
|
||||
*/
|
||||
private Integer isVaccinate;
|
||||
|
||||
/**
|
||||
* 是否接种第一针疫苗
|
||||
*/
|
||||
private Integer isFirstVaccinate;
|
||||
|
||||
/**
|
||||
* 是否接种第二针疫苗
|
||||
*/
|
||||
private Integer isSecondVaccinate;
|
||||
|
||||
/**
|
||||
* 是否接种第三针疫苗
|
||||
*/
|
||||
private Integer isThirdVaccinate;
|
||||
|
||||
/**
|
||||
* 统计任务开始时间
|
||||
*/
|
||||
private String taskStartTime;
|
||||
|
||||
/**
|
||||
* 统计任务结束时间
|
||||
*/
|
||||
private String taskEndTime;
|
||||
|
||||
/**
|
||||
* 任务统计天数
|
||||
*/
|
||||
private String taskDay;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createtime;
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
private Integer createby;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updatetime;
|
||||
|
||||
/**
|
||||
* 更新者
|
||||
*/
|
||||
private Integer updateby;
|
||||
|
||||
/**
|
||||
* 0:不活跃,1:活跃
|
||||
*/
|
||||
private Integer isactive;
|
||||
|
||||
/**
|
||||
* 扩展字段c1
|
||||
*/
|
||||
private String c1;
|
||||
|
||||
/**
|
||||
* 扩展字段c2
|
||||
*/
|
||||
private String c2;
|
||||
|
||||
/**
|
||||
* 扩展字段c3
|
||||
*/
|
||||
private String c3;
|
||||
|
||||
/**
|
||||
* 扩展字段c4
|
||||
*/
|
||||
private String c4;
|
||||
|
||||
/**
|
||||
* 扩展字段c5
|
||||
*/
|
||||
private String c5;
|
||||
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package com.ssf.mysqloracletest.mapper;
|
||||
|
||||
import com.ssf.mysqloracletest.domain.BasePlaceInfo;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author 28758
|
||||
* @description 针对表【base_place_info(场所信息表)】的数据库操作Mapper
|
||||
* @createDate 2024-03-15 09:40:51
|
||||
* @Entity com.ssf.mysqloracletest.domain.BasePlaceInfo
|
||||
*/
|
||||
@Mapper
|
||||
public interface BasePlaceInfoMapper extends BaseMapper<BasePlaceInfo> {
|
||||
|
||||
|
||||
public List<BasePlaceInfo> selectVillageBaseInfoList(BasePlaceInfo basePlaceInfo);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,23 @@
|
||||
package com.ssf.mysqloracletest.mapper;
|
||||
|
||||
import com.ssf.mysqloracletest.domain.BaseUserInfo;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author 28758
|
||||
* @description 针对表【base_user_info(住户信息表)】的数据库操作Mapper
|
||||
* @createDate 2024-03-15 09:40:26
|
||||
* @Entity com.ssf.mysqloracletest.domain.BaseUserInfo
|
||||
*/
|
||||
@Mapper
|
||||
public interface BaseUserInfoMapper extends BaseMapper<BaseUserInfo> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,42 @@
|
||||
package com.ssf.mysqloracletest.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Mapper
|
||||
public interface GoalPersonMapper {
|
||||
|
||||
List<String> queryUserRecordsByCount(Map<String, Object> map);
|
||||
|
||||
List<String> queryUserRecordsByDay(Map<String, Object> map);
|
||||
|
||||
List<String> goalPersonNeverAppear(Map<String, Object> map);
|
||||
|
||||
/**
|
||||
* 以档案的方式 次数
|
||||
*/
|
||||
List<String> queryUserRecordsByCountDossier(Map<String, Object> map);
|
||||
|
||||
/**
|
||||
* 以档案的方式 天数
|
||||
*/
|
||||
List<String> queryUserRecordsByDayDossier(Map<String, Object> map);
|
||||
|
||||
/**
|
||||
* 查询疑似迁出住户
|
||||
*/
|
||||
List<String> queryUserRecordsForLeave(Map<String, Object> map);
|
||||
|
||||
/**
|
||||
* 以身份证的方式 次数 华尊方案
|
||||
*/
|
||||
List<String> queryUserRecordsByCountHz(Map<String, Object> map);
|
||||
|
||||
/**
|
||||
* 以身份证的方式 天数 华尊方案
|
||||
*/
|
||||
List<String> queryUserRecordsByDayHz(Map<String, Object> map);
|
||||
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package com.ssf.mysqloracletest.mapper;
|
||||
|
||||
import com.ssf.mysqloracletest.domain.ModelNotfoundUserInfo;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author 28758
|
||||
* @description 针对表【model_notfound_user_info(从未出现住户信息表)】的数据库操作Mapper
|
||||
* @createDate 2024-03-15 09:58:45
|
||||
* @Entity com.ssf.mysqloracletest.domain.ModelNotfoundUserInfo
|
||||
*/
|
||||
@Mapper
|
||||
public interface ModelNotfoundUserInfoMapper extends BaseMapper<ModelNotfoundUserInfo> {
|
||||
|
||||
public void cleanModelNotfoundUserInfo();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,16 @@
|
||||
package com.ssf.mysqloracletest.service;
|
||||
|
||||
import com.ssf.mysqloracletest.domain.BasePlaceInfo;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author 28758
|
||||
* @description 针对表【base_place_info(场所信息表)】的数据库操作Service
|
||||
* @createDate 2024-03-15 09:40:51
|
||||
*/
|
||||
public interface BasePlaceInfoService extends IService<BasePlaceInfo> {
|
||||
|
||||
public List<BasePlaceInfo> queryVillageInfos();
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package com.ssf.mysqloracletest.service;
|
||||
|
||||
import com.ssf.mysqloracletest.domain.BaseUserInfo;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @author 28758
|
||||
* @description 针对表【base_user_info(住户信息表)】的数据库操作Service
|
||||
* @createDate 2024-03-15 09:40:26
|
||||
*/
|
||||
public interface BaseUserInfoService extends IService<BaseUserInfo> {
|
||||
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package com.ssf.mysqloracletest.service;
|
||||
|
||||
import com.ssf.mysqloracletest.domain.ModelNotfoundUserInfo;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @author 28758
|
||||
* @description 针对表【model_notfound_user_info(从未出现住户信息表)】的数据库操作Service
|
||||
* @createDate 2024-03-15 09:58:45
|
||||
*/
|
||||
public interface ModelNotfoundUserInfoService extends IService<ModelNotfoundUserInfo> {
|
||||
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
package com.ssf.mysqloracletest.service.impl;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ssf.mysqloracletest.domain.BasePlaceInfo;
|
||||
import com.ssf.mysqloracletest.service.BasePlaceInfoService;
|
||||
import com.ssf.mysqloracletest.mapper.BasePlaceInfoMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author 28758
|
||||
* @description 针对表【base_place_info(场所信息表)】的数据库操作Service实现
|
||||
* @createDate 2024-03-15 09:40:51
|
||||
*/
|
||||
@Service
|
||||
@DS("mysql")
|
||||
public class BasePlaceInfoServiceImpl extends ServiceImpl<BasePlaceInfoMapper, BasePlaceInfo>
|
||||
implements BasePlaceInfoService {
|
||||
|
||||
@Autowired
|
||||
private BasePlaceInfoMapper basePlaceInfoMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public List<BasePlaceInfo> queryVillageInfos() {
|
||||
BasePlaceInfo villageBaseInfo = new BasePlaceInfo();
|
||||
try {
|
||||
List<BasePlaceInfo> villageBaseInfos = basePlaceInfoMapper.selectVillageBaseInfoList(villageBaseInfo);
|
||||
return villageBaseInfos;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,24 @@
|
||||
package com.ssf.mysqloracletest.service.impl;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ssf.mysqloracletest.domain.BaseUserInfo;
|
||||
import com.ssf.mysqloracletest.service.BaseUserInfoService;
|
||||
import com.ssf.mysqloracletest.mapper.BaseUserInfoMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author 28758
|
||||
* @description 针对表【base_user_info(住户信息表)】的数据库操作Service实现
|
||||
* @createDate 2024-03-15 09:40:26
|
||||
*/
|
||||
@Service
|
||||
@DS("mysql")
|
||||
public class BaseUserInfoServiceImpl extends ServiceImpl<BaseUserInfoMapper, BaseUserInfo>
|
||||
implements BaseUserInfoService{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,24 @@
|
||||
package com.ssf.mysqloracletest.service.impl;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ssf.mysqloracletest.domain.ModelNotfoundUserInfo;
|
||||
import com.ssf.mysqloracletest.service.ModelNotfoundUserInfoService;
|
||||
import com.ssf.mysqloracletest.mapper.ModelNotfoundUserInfoMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author 28758
|
||||
* @description 针对表【model_notfound_user_info(从未出现住户信息表)】的数据库操作Service实现
|
||||
* @createDate 2024-03-15 09:58:45
|
||||
*/
|
||||
@Service
|
||||
@DS("mysql")
|
||||
public class ModelNotfoundUserInfoServiceImpl extends ServiceImpl<ModelNotfoundUserInfoMapper, ModelNotfoundUserInfo>
|
||||
implements ModelNotfoundUserInfoService{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,195 @@
|
||||
package com.ssf.mysqloracletest.task;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||
import com.ssf.mysqloracletest.domain.BasePlaceInfo;
|
||||
import com.ssf.mysqloracletest.domain.BaseUserInfo;
|
||||
import com.ssf.mysqloracletest.domain.ModelNotfoundUserInfo;
|
||||
import com.ssf.mysqloracletest.mapper.BaseUserInfoMapper;
|
||||
import com.ssf.mysqloracletest.mapper.GoalPersonMapper;
|
||||
import com.ssf.mysqloracletest.mapper.ModelNotfoundUserInfoMapper;
|
||||
import com.ssf.mysqloracletest.service.BasePlaceInfoService;
|
||||
import com.ssf.mysqloracletest.service.BaseUserInfoService;
|
||||
import com.ssf.mysqloracletest.service.ModelNotfoundUserInfoService;
|
||||
import com.ssf.mysqloracletest.utils.ConfigParam;
|
||||
import com.ssf.mysqloracletest.utils.DateTool;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.lang.ref.PhantomReference;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class NotFoundUserTask {
|
||||
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(AlarmInfoTask.class);
|
||||
|
||||
@Resource
|
||||
DateTool dateTool;
|
||||
|
||||
private final BasePlaceInfoService basePlaceInfoService;
|
||||
|
||||
private final ModelNotfoundUserInfoMapper modelNotfoundUserInfoMapper;
|
||||
|
||||
private final ModelNotfoundUserInfoService modelNotfoundUserInfoService;
|
||||
|
||||
private final BaseUserInfoService baseUserInfoService;
|
||||
|
||||
private final GoalPersonMapper goalPersonMapper;
|
||||
|
||||
@Scheduled(initialDelay = 100, fixedDelay = 3000)
|
||||
// @Scheduled(cron = "0 0 0 * * ?") // 每天凌晨执行
|
||||
public void goalPersonNeverAppear() {
|
||||
|
||||
if (!"true".equals(ConfigParam.NotFoundUserTaskSwitch)) {
|
||||
return;
|
||||
}
|
||||
String nearlyDays = "30";
|
||||
logger.info("goalPersonNeverAppear 人员分析 从未出现住户 nearlyDays:" + nearlyDays + ", threadName:" + Thread.currentThread().getName());
|
||||
if (StringUtils.isBlank(nearlyDays)) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
Integer.parseInt(nearlyDays.trim());
|
||||
nearlyDays = nearlyDays.trim();
|
||||
} catch (Exception ex) {
|
||||
return;
|
||||
}
|
||||
List<BasePlaceInfo> villageBaseInfos = basePlaceInfoService.queryVillageInfos();
|
||||
if (CollectionUtils.isEmpty(villageBaseInfos)) {
|
||||
return;
|
||||
}
|
||||
String villageCode = "";
|
||||
// 4.清空临时结果表为入数据做准备
|
||||
modelNotfoundUserInfoMapper.cleanModelNotfoundUserInfo();
|
||||
for (BasePlaceInfo villageBaseInfo : villageBaseInfos) {
|
||||
villageCode = villageBaseInfo.getPlaceCode();
|
||||
if (StringUtils.isBlank(villageCode)) {
|
||||
continue;
|
||||
}
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("startTime", dateTool.getDayStart(Integer.parseInt(nearlyDays)));
|
||||
map.put("endTime", dateTool.getDayEnd(1));
|
||||
map.put("placeCode", villageCode);
|
||||
// 1.查询出拥有共同的idcard
|
||||
List<String> neverAppearList = goalPersonMapper.goalPersonNeverAppear(map);
|
||||
// 2.查询出这些没有出现的住户信息
|
||||
List<ModelNotfoundUserInfo> notfoundUserInfos = getNotfoundUserInfo(villageCode, neverAppearList);
|
||||
// 3.批量入库
|
||||
if (notfoundUserInfos.size() > 0) {
|
||||
for (ModelNotfoundUserInfo notfoundUserInfo : notfoundUserInfos) {
|
||||
notfoundUserInfo.setTaskStartTime(String.valueOf(map.get("startTime")));
|
||||
notfoundUserInfo.setTaskEndTime(String.valueOf(map.get("endTime")));
|
||||
notfoundUserInfo.setTaskDay(nearlyDays);
|
||||
List<ModelNotfoundUserInfo> modelNotfoundUserInfos = modelNotfoundUserInfoService.list(new QueryWrapper<>(notfoundUserInfo));
|
||||
if (CollectionUtils.isNotEmpty(modelNotfoundUserInfos)) {
|
||||
//已经存在需要更新任务时间字段
|
||||
modelNotfoundUserInfoService.updateById(notfoundUserInfo);
|
||||
logger.info("人员分析 从未出现住户 更新已推送过记录保持最新一次 " + JSONObject.toJSONString(notfoundUserInfo));
|
||||
} else {
|
||||
modelNotfoundUserInfoService.save(notfoundUserInfo);
|
||||
logger.info("人员分析 从未出现住户 新增推送 " + JSONObject.toJSONString(notfoundUserInfo));
|
||||
}
|
||||
}
|
||||
}
|
||||
neverAppearList.clear();
|
||||
notfoundUserInfos.clear();
|
||||
}
|
||||
logger.info("goalPersonNeverAppear 人员分析 从未出现住户 结束, 时间:" + dateTool.getDateTime(System.currentTimeMillis() / 1000));
|
||||
}
|
||||
|
||||
private List<ModelNotfoundUserInfo> getNotfoundUserInfo(String villageCode, List<String> list) {
|
||||
List<ModelNotfoundUserInfo> modelNotfoundUserInfos = new ArrayList<>();
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
return modelNotfoundUserInfos;
|
||||
}
|
||||
//查询出小区的住户
|
||||
List<BaseUserInfo> villageUserInfos = queryVillageUserInfos(villageCode);
|
||||
//存放小区住户没在通行记录中出现过的小区住户信息
|
||||
List<BaseUserInfo> villageUserInfoTempList = new ArrayList<>();
|
||||
if (CollectionUtils.isNotEmpty(villageUserInfos)) {
|
||||
villageUserInfoTempList.addAll(villageUserInfos);
|
||||
for (BaseUserInfo userInfo : villageUserInfos) {
|
||||
for (String idCard : list) {
|
||||
if (StringUtils.isNotBlank(idCard)) {
|
||||
if (userInfo.getIdCard().equals(idCard)) {
|
||||
villageUserInfoTempList.remove(userInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (villageUserInfoTempList.size() > 0) {
|
||||
for (BaseUserInfo userInfo : villageUserInfoTempList) {
|
||||
ModelNotfoundUserInfo modelNotfoundUserInfo = new ModelNotfoundUserInfo();
|
||||
modelNotfoundUserInfo.setPlaceCode(userInfo.getPlaceCode());
|
||||
modelNotfoundUserInfo.setPlaceName(userInfo.getPlaceName());
|
||||
modelNotfoundUserInfo.setGridCode(userInfo.getGridCode());
|
||||
modelNotfoundUserInfo.setGridName(userInfo.getGridName());
|
||||
modelNotfoundUserInfo.setBuildingCode(userInfo.getBuildingCode());
|
||||
modelNotfoundUserInfo.setBuildingName(userInfo.getBuildingName());
|
||||
modelNotfoundUserInfo.setUnitCode(userInfo.getUnitCode());
|
||||
modelNotfoundUserInfo.setUnitName(userInfo.getUnitName());
|
||||
modelNotfoundUserInfo.setHomeCode(userInfo.getHomeCode());
|
||||
modelNotfoundUserInfo.setHomeName(userInfo.getHomeName());
|
||||
modelNotfoundUserInfo.setUserName(userInfo.getUserName());
|
||||
modelNotfoundUserInfo.setUserPic(userInfo.getUserPic());
|
||||
modelNotfoundUserInfo.setUserStandardPic(userInfo.getUserStandardPic());
|
||||
modelNotfoundUserInfo.setIdcard(userInfo.getIdCard());
|
||||
modelNotfoundUserInfo.setSex(userInfo.getSex());
|
||||
// modelNotfoundUserInfo.setNation(userInfo.getNation());
|
||||
// modelNotfoundUserInfo.setBirthday(userInfo.getBirthday());
|
||||
// modelNotfoundUserInfo.setCompany(userInfo.getCompany());
|
||||
modelNotfoundUserInfo.setPhone(userInfo.getPhone());
|
||||
// modelNotfoundUserInfo.setNationality(userInfo.getNationality());
|
||||
modelNotfoundUserInfo.setNativeplace(userInfo.getNativeplace());
|
||||
// modelNotfoundUserInfo.setEducation(userInfo.getEducation());
|
||||
modelNotfoundUserInfo.setHouseHoldRegister(userInfo.getHouseHoldRegister());
|
||||
modelNotfoundUserInfo.setHouseHoldAddress(userInfo.getHouseHoldAddress());
|
||||
// modelNotfoundUserInfo.setAreaCode(userInfo.getAreaCode());
|
||||
// modelNotfoundUserInfo.setAreaName(userInfo.getAreaName());
|
||||
modelNotfoundUserInfo.setHabitation(userInfo.getHabitation());
|
||||
// modelNotfoundUserInfo.setReligious(userInfo.getReligious());
|
||||
// modelNotfoundUserInfo.setPoliticalOutlook(userInfo.getPoliticalOutlook());
|
||||
// modelNotfoundUserInfo.setEntryTime(userInfo.getEntryTime());
|
||||
// modelNotfoundUserInfo.setMarriage(userInfo.getMarriage());
|
||||
modelNotfoundUserInfo.setPersonType(userInfo.getPersonType());
|
||||
modelNotfoundUserInfo.setPersonCategory(userInfo.getPersonCategory());
|
||||
modelNotfoundUserInfo.setCaringLabel(userInfo.getCaringLabel());
|
||||
modelNotfoundUserInfo.setIsHouseholder(userInfo.getIsHouseholder());
|
||||
modelNotfoundUserInfo.setHouseholderRelation(userInfo.getHouseholderRelation());
|
||||
// modelNotfoundUserInfo.setIsVaccinate(userInfo.getIsVaccinate());
|
||||
// modelNotfoundUserInfo.setIsFirstVaccinate(userInfo.getIsFirstVaccinate());
|
||||
// modelNotfoundUserInfo.setIsSecondVaccinate(userInfo.getIsSecondVaccinate());
|
||||
// modelNotfoundUserInfo.setIsThirdVaccinate(userInfo.getIsThirdVaccinate());
|
||||
// modelNotfoundUserInfo.setIsactive(userInfo.getIsactive());
|
||||
modelNotfoundUserInfos.add(modelNotfoundUserInfo);
|
||||
}
|
||||
}
|
||||
return modelNotfoundUserInfos;
|
||||
}
|
||||
|
||||
|
||||
private List<BaseUserInfo> queryVillageUserInfos(String villageCode) {
|
||||
BaseUserInfo villageUserInfo = new BaseUserInfo();
|
||||
villageUserInfo.setPlaceCode(villageCode);
|
||||
List<BaseUserInfo> villageUserInfos = baseUserInfoService.lambdaQuery()
|
||||
.isNotNull(BaseUserInfo::getIdCard)
|
||||
.eq(BaseUserInfo::getPlaceCode,villageCode).list();
|
||||
if (CollectionUtils.isEmpty(villageUserInfos)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return villageUserInfos;
|
||||
}
|
||||
}
|
@ -0,0 +1,473 @@
|
||||
package com.ssf.mysqloracletest.utils;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.TimeZone;
|
||||
|
||||
/**
|
||||
* 时间小工具
|
||||
*/
|
||||
@Component
|
||||
public class DateTool {
|
||||
|
||||
private static final long SECOND = 24 * 60 * 60 * 1000L;
|
||||
private static final SimpleDateFormat ym = new SimpleDateFormat("yyyyMM");
|
||||
private static final SimpleDateFormat ymd = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
private static final SimpleDateFormat ymdhms = new SimpleDateFormat("yyyyMMddHHmmss");
|
||||
private static final SimpleDateFormat yyyy = new SimpleDateFormat("yyyy");
|
||||
private static final SimpleDateFormat yMMdd = new SimpleDateFormat("MM-dd");
|
||||
private static final SimpleDateFormat yyyyMMdd = new SimpleDateFormat("yyyyMMdd");
|
||||
private static final SimpleDateFormat HHmmss = new SimpleDateFormat("HH:mm:ss");
|
||||
private static final SimpleDateFormat YYYYMMDD = new SimpleDateFormat("yyyy-MM-dd");
|
||||
|
||||
/**
|
||||
* 年
|
||||
* 2022
|
||||
*/
|
||||
public int getYear(Date date) {
|
||||
int rel = 0;
|
||||
if (null == date) {
|
||||
return 0;
|
||||
}
|
||||
try {
|
||||
rel = Integer.parseInt(yyyy.format(date));
|
||||
} catch (Exception e) {
|
||||
return rel;
|
||||
}
|
||||
return rel;
|
||||
}
|
||||
|
||||
/**
|
||||
* 年月
|
||||
* 202205
|
||||
*/
|
||||
public String yearMonth() {
|
||||
return ym.format(new Date());
|
||||
}
|
||||
|
||||
/**
|
||||
* 当日开始时间
|
||||
*/
|
||||
public String getStartTime() {
|
||||
long current = System.currentTimeMillis();//当前时间毫秒数
|
||||
//今天零点零分零秒的毫秒数
|
||||
long zero = ((current / SECOND) * SECOND - TimeZone.getDefault().getRawOffset());
|
||||
return ymd.format(zero);
|
||||
}
|
||||
|
||||
/**
|
||||
* 带T时间处理
|
||||
*
|
||||
* @param time
|
||||
* @return
|
||||
*/
|
||||
public String getDateTimeT(long time) {
|
||||
String ymd = YYYYMMDD.format(new Date(time * 1000));
|
||||
String hms = HHmmss.format(new Date(time * 1000));
|
||||
return (ymd + "T" + hms);
|
||||
}
|
||||
|
||||
/**
|
||||
* 今日0点的绝对秒
|
||||
*/
|
||||
public Long getStartTimeLong() {
|
||||
long current = System.currentTimeMillis();//当前时间毫秒数
|
||||
//今天零点零分零秒的毫秒数
|
||||
long zero = ((current / SECOND) * SECOND - TimeZone.getDefault().getRawOffset());
|
||||
return zero / 1000;
|
||||
}
|
||||
|
||||
/**
|
||||
* 当日结束时间
|
||||
*/
|
||||
public String getEndTime() {
|
||||
long current = System.currentTimeMillis();//当前时间毫秒数
|
||||
//今天零点零分零秒的毫秒数
|
||||
long zero = (current / SECOND) * SECOND - TimeZone.getDefault().getRawOffset();
|
||||
//今天23点59分59秒的毫秒数
|
||||
long twelve = (zero + SECOND - 1);
|
||||
return ymd.format(twelve);
|
||||
}
|
||||
|
||||
/**
|
||||
* 今天23点59分59秒 绝对秒
|
||||
*/
|
||||
public Long getEndTimeLong() {
|
||||
long current = System.currentTimeMillis();//当前时间毫秒数
|
||||
//今天零点零分零秒的毫秒数
|
||||
long zero = (current / SECOND) * SECOND - TimeZone.getDefault().getRawOffset();
|
||||
//今天23点59分59秒的毫秒数
|
||||
long twelve = (zero + SECOND - 1);
|
||||
return twelve / 1000;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取日期格式字符串时间
|
||||
*/
|
||||
public String getDateTime(long time) {
|
||||
if (time == 0L) {
|
||||
return "";
|
||||
}
|
||||
String format = ymd.format(new Date(time * 1000));
|
||||
if (StringUtils.isNotBlank(format)) {
|
||||
return format;
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 今天 2022-08-18 00:00:00
|
||||
*/
|
||||
public String getDayStart() {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(new Date());
|
||||
String startDate = ymd.format(calendar.getTime());
|
||||
startDate = startDate.substring(0, 10) + " 00:00:00";
|
||||
return startDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* 今天 2022-08-18 23:59:59
|
||||
*/
|
||||
public String getDayEnd() {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(new Date());
|
||||
String endDate = ymd.format(calendar.getTime());
|
||||
endDate = endDate.substring(0, 10) + " 23:59:59";
|
||||
return endDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取前一天 2022-08-15 00:00:00
|
||||
*/
|
||||
public static String getLastDayStart() {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(new Date());
|
||||
calendar.add(Calendar.DAY_OF_MONTH, -1);
|
||||
String startDate = ymd.format(calendar.getTime());
|
||||
startDate = startDate.substring(0, 10) + " 00:00:00";
|
||||
return startDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取前一天 时间戳
|
||||
*/
|
||||
public static String getLastDayStartTimestamp() {
|
||||
try {
|
||||
String format = "yyyy-MM-dd HH:mm:ss";
|
||||
String dateStr = getLastDayStart();
|
||||
SimpleDateFormat ft = new SimpleDateFormat(format);
|
||||
Date date = ft.parse(dateStr);
|
||||
long resL = date.getTime();
|
||||
String res = StringKit.toString(resL / 1000);
|
||||
return StringKit.toString(res);
|
||||
} catch (Exception e) {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取前一天 2022-08-15 23:59:59
|
||||
*/
|
||||
public String getLastDayEnd() {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(new Date());
|
||||
calendar.add(Calendar.DAY_OF_MONTH, -1);
|
||||
String endDate = ymd.format(calendar.getTime());
|
||||
endDate = endDate.substring(0, 10) + " 23:59:59";
|
||||
return endDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取前一天 年月日
|
||||
*/
|
||||
public String getDayStr() {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(new Date());
|
||||
calendar.add(Calendar.DAY_OF_MONTH, -1);
|
||||
String dayStr = yyyyMMdd.format(calendar.getTime());
|
||||
return dayStr;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取年月日时间
|
||||
* yyyyMMdd
|
||||
*/
|
||||
public String getDayStr(long longStr) {
|
||||
String rel = "";
|
||||
try {
|
||||
rel = yyyyMMdd.format(longStr * 1000);
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
return rel;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取年月日时间
|
||||
* yyyyMMdd
|
||||
*/
|
||||
public String getDayStr2(String date) {
|
||||
String rel = "";
|
||||
try {
|
||||
rel = yyyyMMdd.format(ymd.parse(date));
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
return rel;
|
||||
}
|
||||
|
||||
/**
|
||||
* 日期字符串 计算 绝对秒
|
||||
*/
|
||||
public long getDayLong(String date) {
|
||||
try {
|
||||
Date parse = ymd.parse(date);
|
||||
return parse.getTime() / 1000;
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return 0L;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前年份
|
||||
*/
|
||||
public String getYear() {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(new Date());
|
||||
calendar.add(Calendar.DAY_OF_MONTH, -1);
|
||||
String endDate = ymd.format(calendar.getTime());
|
||||
endDate = endDate.substring(0, 10) + " 23:59:59";
|
||||
return endDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取每个月的第一天
|
||||
*/
|
||||
public String getMonthFirst() {
|
||||
// Calendar calendar = Calendar.getInstance();
|
||||
// calendar.setTime(new Date());
|
||||
// calendar.add(Calendar.DAY_OF_MONTH, -1);
|
||||
// String endDate = ymd.format(calendar.getTime());
|
||||
// endDate = endDate.substring(0, 10) + " 23:59:59";
|
||||
// return endDate;
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.set(Calendar.DATE, 1);
|
||||
calendar.roll(Calendar.DATE, -1);
|
||||
|
||||
SimpleDateFormat sdfTwo = new SimpleDateFormat("yyyy-MM-");
|
||||
String startTime = sdfTwo.format(new Date()) + "01 00:00:00";
|
||||
return startTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取每个月的最后一天
|
||||
*/
|
||||
// public String getMonthLast() {
|
||||
// Calendar calendar = Calendar.getInstance();
|
||||
// calendar.setTime(new Date());
|
||||
// calendar.add(Calendar.DAY_OF_MONTH, -1);
|
||||
// String endDate = ymd.format(calendar.getTime());
|
||||
// endDate = endDate.substring(0, 10) + " 23:59:59";
|
||||
// return endDate;
|
||||
// }
|
||||
|
||||
/**
|
||||
* 获取每个月的最后一天
|
||||
*/
|
||||
public String getMonthLast() {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.set(Calendar.DATE, 1);
|
||||
calendar.roll(Calendar.DATE, -1);
|
||||
|
||||
int maxDate = calendar.get(Calendar.DATE);
|
||||
SimpleDateFormat sdfTwo = new SimpleDateFormat("yyyy-MM-");
|
||||
String endTime = sdfTwo.format(new Date()) + maxDate + " 23:59:59";
|
||||
// System.out.println(endTime);
|
||||
return endTime;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取前n天 2022-08-15 23:59:59
|
||||
*/
|
||||
public String getDayStart(int n) {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(new Date());
|
||||
calendar.add(Calendar.DAY_OF_MONTH, -n);
|
||||
String startDate = ymd.format(calendar.getTime());
|
||||
startDate = startDate.substring(0, 10) + " 00:00:00";
|
||||
return startDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取前n天 2022-08-15 23:59:59
|
||||
*/
|
||||
public String getDayStartYYYYMMDD(int n) {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(new Date());
|
||||
calendar.add(Calendar.DAY_OF_MONTH, -n);
|
||||
String startDate = ymd.format(calendar.getTime());
|
||||
startDate = startDate.substring(0, 10);
|
||||
return startDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取前n天 2022-08-15 23:59:59
|
||||
*/
|
||||
public String getDayEnd(int n) {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(new Date());
|
||||
calendar.add(Calendar.DAY_OF_MONTH, -n);
|
||||
String endDate = ymd.format(calendar.getTime());
|
||||
endDate = endDate.substring(0, 10) + " 23:59:59";
|
||||
return endDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取n天前的指定日期
|
||||
*/
|
||||
public String getYMD(int n) {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(new Date());
|
||||
calendar.add(Calendar.DAY_OF_MONTH, -n);
|
||||
String ymd = yyyyMMdd.format(calendar.getTime());
|
||||
return ymd;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前ymdhms日期格式
|
||||
*/
|
||||
public String getYmdhms() {
|
||||
return ymdhms.format(new Date());
|
||||
}
|
||||
|
||||
/**
|
||||
* yyyyMMdd转mm.dd
|
||||
*/
|
||||
public String timeConversion(String yyyyMMdd) {
|
||||
String rel = "";
|
||||
try {
|
||||
if (StringUtils.isBlank(yyyyMMdd)) {
|
||||
return rel;
|
||||
}
|
||||
if (yyyyMMdd.length() != 8) {
|
||||
return rel;
|
||||
}
|
||||
String mm = yyyyMMdd.substring(4, 6);
|
||||
String dd = yyyyMMdd.substring(6, 8);
|
||||
rel = String.valueOf(Integer.parseInt(mm)) + "." + String.valueOf(Integer.parseInt(dd));
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
return rel;
|
||||
}
|
||||
|
||||
/**
|
||||
* 年月
|
||||
* m=0表示当月
|
||||
* m=1表示前一月
|
||||
* m=2表示前两月
|
||||
*/
|
||||
public String yearMonth(int m) {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(new Date());
|
||||
calendar.add(Calendar.MONTH, -m);
|
||||
return ym.format(calendar.getTime());
|
||||
}
|
||||
|
||||
public String getDayStr3(String date) {
|
||||
String rel = "";
|
||||
try {
|
||||
Date parse = yyyyMMdd.parse(date);
|
||||
} catch (ParseException e) {
|
||||
|
||||
}
|
||||
return rel;
|
||||
}
|
||||
|
||||
public long daysBetween(String one, String two) {
|
||||
long difference = 0L;
|
||||
try {
|
||||
Date parseOne = yyyyMMdd.parse(one);
|
||||
Date parseTwo = yyyyMMdd.parse(two);
|
||||
difference = (parseOne.getTime() - parseTwo.getTime()) / 86400000;
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return Math.abs(difference) + 1;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取前N天 MMdd
|
||||
*/
|
||||
public static String getLastDayMmdd(int num) {
|
||||
if (num == 0) {
|
||||
num = 1;
|
||||
}
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(new Date());
|
||||
calendar.add(Calendar.DAY_OF_MONTH, -num);
|
||||
String startDate = yMMdd.format(calendar.getTime());
|
||||
return startDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* n个月前的1号开始时间
|
||||
*/
|
||||
public String getMonthFirst(int n) {
|
||||
// Calendar calendar = Calendar.getInstance();
|
||||
// calendar.set(Calendar.MONTH, 2-n);
|
||||
// calendar.set(Calendar.DATE, 1);
|
||||
// calendar.roll(Calendar.DATE, -1);
|
||||
//
|
||||
// SimpleDateFormat sdfTwo = new SimpleDateFormat("yyyy-MM-");
|
||||
// String startTime = sdfTwo.format(calendar.getTime()) + "01 00:00:00";
|
||||
// return startTime;
|
||||
SimpleDateFormat sdfTwo = new SimpleDateFormat("yyyy-MM");
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(new Date());
|
||||
calendar.add(Calendar.MONTH, -n);
|
||||
Date m = calendar.getTime();
|
||||
String format = sdfTwo.format(m);
|
||||
return format + "-01 00:00:00";
|
||||
}
|
||||
|
||||
/**
|
||||
* n个月前的最后一天结束时间
|
||||
*/
|
||||
public String getMonthLast(int n) {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.set(Calendar.MONTH, 1-n + 2);
|
||||
calendar.set(Calendar.DATE, 1);
|
||||
calendar.roll(Calendar.DATE, -1);
|
||||
int maxDate = calendar.get(Calendar.DATE);
|
||||
SimpleDateFormat sdfTwo = new SimpleDateFormat("yyyy-MM-");
|
||||
String endTime = sdfTwo.format(calendar.getTime()) + maxDate + " 23:59:59";
|
||||
|
||||
// n = n - 1;
|
||||
// Calendar calendar = Calendar.getInstance();
|
||||
// calendar.set(Calendar.MONTH, 1 - n);
|
||||
// calendar.set(Calendar.DATE, 1);
|
||||
// calendar.roll(Calendar.DATE, -1);
|
||||
//
|
||||
// int maxDate = calendar.get(Calendar.DATE);
|
||||
// SimpleDateFormat sdfTwo = new SimpleDateFormat("yyyy-MM-");
|
||||
// String endTime = sdfTwo.format(calendar.getTime()) + maxDate + " 23:59:59";
|
||||
return endTime;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
DateTool tool = new DateTool();
|
||||
System.out.println(tool.getMonthFirst(4));
|
||||
System.out.println(tool.getMonthLast(4));
|
||||
}
|
||||
}
|
@ -0,0 +1,88 @@
|
||||
<?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.ssf.mysqloracletest.mapper.BasePlaceInfoMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.ssf.mysqloracletest.domain.BasePlaceInfo">
|
||||
<id property="id" column="id" jdbcType="BIGINT"/>
|
||||
<result property="placeCode" column="place_code" jdbcType="VARCHAR"/>
|
||||
<result property="placeName" column="place_name" jdbcType="VARCHAR"/>
|
||||
<result property="placePic" column="place_pic" jdbcType="VARCHAR"/>
|
||||
<result property="placeCategory" column="place_category" jdbcType="TINYINT"/>
|
||||
<result property="placeType" column="place_type" jdbcType="TINYINT"/>
|
||||
<result property="placeNature" column="place_nature" jdbcType="TINYINT"/>
|
||||
<result property="coversAcreage" column="covers_acreage" jdbcType="VARCHAR"/>
|
||||
<result property="structureAcreage" column="structure_acreage" jdbcType="VARCHAR"/>
|
||||
<result property="neighBulitTime" column="neigh_bulit_time" jdbcType="VARCHAR"/>
|
||||
<result property="activeuseTime" column="activeuse_time" jdbcType="VARCHAR"/>
|
||||
<result property="accessType" column="access_type" jdbcType="TINYINT"/>
|
||||
<result property="afforestationRate" column="afforestation_rate" jdbcType="VARCHAR"/>
|
||||
<result property="plotRate" column="plot_rate" jdbcType="VARCHAR"/>
|
||||
<result property="longitude" column="longitude" jdbcType="DECIMAL"/>
|
||||
<result property="latitude" column="latitude" jdbcType="DECIMAL"/>
|
||||
<result property="placeAddress" column="place_address" jdbcType="VARCHAR"/>
|
||||
<result property="provinceCode" column="province_code" jdbcType="VARCHAR"/>
|
||||
<result property="provinceName" column="province_name" jdbcType="VARCHAR"/>
|
||||
<result property="cityCode" column="city_code" jdbcType="VARCHAR"/>
|
||||
<result property="cityName" column="city_name" jdbcType="VARCHAR"/>
|
||||
<result property="areaCode" column="area_code" jdbcType="VARCHAR"/>
|
||||
<result property="areaName" column="area_name" jdbcType="VARCHAR"/>
|
||||
<result property="streetCode" column="street_code" jdbcType="VARCHAR"/>
|
||||
<result property="streetName" column="street_name" jdbcType="VARCHAR"/>
|
||||
<result property="blockCode" column="block_code" jdbcType="VARCHAR"/>
|
||||
<result property="blockName" column="block_name" jdbcType="VARCHAR"/>
|
||||
<result property="estateDeveloper" column="estate_developer" jdbcType="VARCHAR"/>
|
||||
<result property="developerPic" column="developer_pic" jdbcType="VARCHAR"/>
|
||||
<result property="developerName" column="developer_name" jdbcType="VARCHAR"/>
|
||||
<result property="developerPhone" column="developer_phone" jdbcType="VARCHAR"/>
|
||||
<result property="propertyCompany" column="property_company" jdbcType="VARCHAR"/>
|
||||
<result property="propertyName" column="property_name" jdbcType="VARCHAR"/>
|
||||
<result property="propertyPhone" column="property_phone" jdbcType="VARCHAR"/>
|
||||
<result property="propertyPic" column="property_pic" jdbcType="VARCHAR"/>
|
||||
<result property="policeDistrict" column="police_district" jdbcType="VARCHAR"/>
|
||||
<result property="policeDistrictCode" column="police_district_code" jdbcType="VARCHAR"/>
|
||||
<result property="policeName" column="police_name" jdbcType="VARCHAR"/>
|
||||
<result property="policeNo" column="police_no" jdbcType="VARCHAR"/>
|
||||
<result property="policePhone" column="police_phone" jdbcType="VARCHAR"/>
|
||||
<result property="policePic" column="police_pic" jdbcType="VARCHAR"/>
|
||||
<result property="dimensoftVillageCode" column="dimensoft_village_code" jdbcType="VARCHAR"/>
|
||||
<result property="policeVillageCode" column="police_village_code" jdbcType="VARCHAR"/>
|
||||
<result property="jurisdictionalUnitCode" column="jurisdictional_unit_code" jdbcType="VARCHAR"/>
|
||||
<result property="isActive" column="is_active" jdbcType="TINYINT"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
select id,place_code,place_name,
|
||||
place_pic,place_category,place_type,
|
||||
place_nature,covers_acreage,structure_acreage,
|
||||
neigh_bulit_time,activeuse_time,access_type,
|
||||
afforestation_rate,plot_rate,longitude,
|
||||
latitude,place_address,province_code,
|
||||
province_name,city_code,city_name,
|
||||
area_code,area_name,street_code,
|
||||
street_name,block_code,block_name,
|
||||
estate_developer,developer_pic,developer_name,
|
||||
developer_phone,property_company,property_name,
|
||||
property_phone,property_pic,police_district,
|
||||
police_district_code,police_name,police_no,
|
||||
police_phone,police_pic,dimensoft_village_code,
|
||||
police_village_code,jurisdictional_unit_code,
|
||||
is_active
|
||||
from base_place_info
|
||||
</sql>
|
||||
|
||||
<select id="selectVillageBaseInfoList" parameterType="com.ssf.mysqloracletest.domain.BasePlaceInfo" resultMap="BaseResultMap">
|
||||
<include refid="Base_Column_List"/>
|
||||
<where>
|
||||
and isactive = '1'
|
||||
<if test="id != null and id != ''">and id = #{id}</if>
|
||||
<if test="placeCode != null and placeCode != ''">and placeCode = #{placeCode}</if>
|
||||
<if test="placeName != null and placeName != ''">and placeName like concat('%', #{placeName},
|
||||
'%')
|
||||
</if>
|
||||
<if test="blockCode != null and blockCode != ''">and block_code = #{blockCode}</if>
|
||||
<if test="placeType != null and placeType != ''">and place_type = #{placeType}</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
@ -0,0 +1,59 @@
|
||||
<?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.ssf.mysqloracletest.mapper.BaseUserInfoMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.ssf.mysqloracletest.domain.BaseUserInfo">
|
||||
<id property="id" column="id" jdbcType="BIGINT"/>
|
||||
<result property="placeCode" column="place_code" jdbcType="VARCHAR"/>
|
||||
<result property="placeName" column="place_name" jdbcType="VARCHAR"/>
|
||||
<result property="gridCode" column="grid_code" jdbcType="VARCHAR"/>
|
||||
<result property="gridName" column="grid_name" jdbcType="VARCHAR"/>
|
||||
<result property="buildingCode" column="building_code" jdbcType="VARCHAR"/>
|
||||
<result property="buildingName" column="building_name" jdbcType="VARCHAR"/>
|
||||
<result property="unitCode" column="unit_code" jdbcType="VARCHAR"/>
|
||||
<result property="unitName" column="unit_name" jdbcType="VARCHAR"/>
|
||||
<result property="homeCode" column="home_code" jdbcType="VARCHAR"/>
|
||||
<result property="homeName" column="home_name" jdbcType="VARCHAR"/>
|
||||
<result property="userName" column="user_name" jdbcType="VARCHAR"/>
|
||||
<result property="idCard" column="id_card" jdbcType="VARCHAR"/>
|
||||
<result property="phone" column="phone" jdbcType="VARCHAR"/>
|
||||
<result property="userPic" column="user_pic" jdbcType="VARCHAR"/>
|
||||
<result property="userStandardPic" column="user_standard_pic" jdbcType="VARCHAR"/>
|
||||
<result property="sex" column="sex" jdbcType="TINYINT"/>
|
||||
<result property="age" column="age" jdbcType="INTEGER"/>
|
||||
<result property="nativeplace" column="nativeplace" jdbcType="VARCHAR"/>
|
||||
<result property="houseHoldRegister" column="house_hold_register" jdbcType="VARCHAR"/>
|
||||
<result property="houseHoldAddress" column="house_hold_address" jdbcType="VARCHAR"/>
|
||||
<result property="habitation" column="habitation" jdbcType="VARCHAR"/>
|
||||
<result property="personType" column="person_type" jdbcType="TINYINT"/>
|
||||
<result property="personCategory" column="person_category" jdbcType="TINYINT"/>
|
||||
<result property="caringLabel" column="caring_label" jdbcType="TINYINT"/>
|
||||
<result property="isHouseholder" column="is_householder" jdbcType="TINYINT"/>
|
||||
<result property="householderRelation" column="householder_relation" jdbcType="TINYINT"/>
|
||||
<result property="userHomeRel" column="user_home_rel" jdbcType="TINYINT"/>
|
||||
<result property="actualPopulationFlag" column="actual_population_flag" jdbcType="VARCHAR"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="createBy" column="create_by" jdbcType="INTEGER"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateBy" column="update_by" jdbcType="INTEGER"/>
|
||||
<result property="isActive" column="is_active" jdbcType="TINYINT"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,place_code,place_name,
|
||||
grid_code,grid_name,building_code,
|
||||
building_name,unit_code,unit_name,
|
||||
home_code,home_name,user_name,
|
||||
id_card,phone,user_pic,
|
||||
user_standard_pic,sex,age,
|
||||
nativeplace,house_hold_register,house_hold_address,
|
||||
habitation,person_type,person_category,
|
||||
caring_label,is_householder,householder_relation,
|
||||
user_home_rel,actual_population_flag,create_time,
|
||||
create_by,update_time,update_by,
|
||||
is_active
|
||||
</sql>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,51 @@
|
||||
<?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.ssf.mysqloracletest.mapper.GoalPersonMapper">
|
||||
|
||||
<!--查询满足次数要求-->
|
||||
<select id="queryUserRecordsByCount" parameterType="java.util.Map" resultType="java.lang.String" flushCache="true"
|
||||
useCache="false">
|
||||
select idcard from (select idcard,count(1) as num from village_user_record where isactive='1' and village_code=#{villageCode} and partition_field between #{startTime} and #{endTime} group by idcard)r where r.num>#{appearTimes}
|
||||
</select>
|
||||
<!--查询满足天数要求-->
|
||||
<select id="queryUserRecordsByDay" parameterType="java.util.Map" resultType="java.lang.String" flushCache="true"
|
||||
useCache="false">
|
||||
select m.idcard as idcard from (select idcard,FROM_UNIXTIME(pass_time,'%Y%m%d') as passDate from village_user_record where isactive='1' and village_code=#{villageCode} and partition_field between #{startTime} and #{endTime} group by idcard,passDate)m group by m.idcard having count(distinct m.passDate)>#{appearDays}
|
||||
</select>
|
||||
<!--查询从未出现的住户-->
|
||||
<select id="goalPersonNeverAppear" parameterType="java.util.Map" resultType="java.lang.String" flushCache="true"
|
||||
useCache="false">
|
||||
select a.idcard as idcard from (select idcard from village_user_record where village_code=#{villageCode} and partition_field between #{startTime} and #{endTime})a inner join (select idcard from village_user_info where isactive='1' and village_code = #{villageCode})b on a.idcard=b.idcard
|
||||
</select>
|
||||
<!--查询满足次数要求 Dossier-->
|
||||
<select id="queryUserRecordsByCountDossier" parameterType="java.util.Map" resultType="java.lang.String"
|
||||
flushCache="true"
|
||||
useCache="false">
|
||||
select dossier_code from (select dossier_code,count(1) as num from village_user_record where village_code=#{villageCode} and partition_field between #{startTime} and #{endTime} group by dossier_code)r where r.num>#{appearTimes}
|
||||
</select>
|
||||
<!--查询满足天数要求 Dossier-->
|
||||
<select id="queryUserRecordsByDayDossier" parameterType="java.util.Map" resultType="java.lang.String"
|
||||
flushCache="true"
|
||||
useCache="false">
|
||||
select m.dossier_code as dossier_code from (select dossier_code,FROM_UNIXTIME(pass_time,'%Y%m%d') as passDate from village_user_record where village_code=#{villageCode} and partition_field between #{startTime} and #{endTime} group by dossier_code,passDate)m group by m.dossier_code having count(distinct m.passDate)>#{appearDays}
|
||||
</select>
|
||||
<!--查询满足天数要求的疑似离开住户-->
|
||||
<select id="queryUserRecordsForLeave" parameterType="java.util.Map" resultType="java.lang.String" flushCache="true"
|
||||
useCache="false">
|
||||
select FROM_UNIXTIME(pass_time,'%Y%m%d') as passDate from village_user_record where isactive='1' and village_code = #{villageCode} and idcard=#{idCard} and partition_field between #{startTime} and #{endTime} group by passDate
|
||||
</select>
|
||||
|
||||
<!--查询满足次数要求 idCard-->
|
||||
<select id="queryUserRecordsByCountHz" parameterType="java.util.Map" resultType="java.lang.String"
|
||||
flushCache="true"
|
||||
useCache="false">
|
||||
select idcard from (select idcard,count(1) as num from village_user_record where village_code=#{villageCode} and partition_field between #{startTime} and #{endTime} group by idcard)r where r.num>#{appearTimes}
|
||||
</select>
|
||||
<!--查询满足天数要求 idCard-->
|
||||
<select id="queryUserRecordsByDayHz" parameterType="java.util.Map" resultType="java.lang.String"
|
||||
flushCache="true"
|
||||
useCache="false">
|
||||
select m.idcard as idcard from (select idcard,FROM_UNIXTIME(pass_time,'%Y%m%d') as passDate from village_user_record where village_code=#{villageCode} and partition_field between #{startTime} and #{endTime} group by idcard,passDate)m group by m.idcard having count(distinct m.passDate)>#{appearDays}
|
||||
</select>
|
||||
</mapper>
|
@ -0,0 +1,125 @@
|
||||
<?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.ssf.mysqloracletest.mapper.ModelNotfoundUserInfoMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.ssf.mysqloracletest.domain.ModelNotfoundUserInfo">
|
||||
<id property="id" column="id" jdbcType="BIGINT"/>
|
||||
<result property="placeCode" column="place_code" jdbcType="VARCHAR"/>
|
||||
<result property="placeName" column="place_name" jdbcType="VARCHAR"/>
|
||||
<result property="gridCode" column="grid_code" jdbcType="VARCHAR"/>
|
||||
<result property="gridName" column="grid_name" jdbcType="VARCHAR"/>
|
||||
<result property="buildingCode" column="building_code" jdbcType="VARCHAR"/>
|
||||
<result property="buildingName" column="building_name" jdbcType="VARCHAR"/>
|
||||
<result property="unitCode" column="unit_code" jdbcType="VARCHAR"/>
|
||||
<result property="unitName" column="unit_name" jdbcType="VARCHAR"/>
|
||||
<result property="homeCode" column="home_code" jdbcType="VARCHAR"/>
|
||||
<result property="homeName" column="home_name" jdbcType="VARCHAR"/>
|
||||
<result property="userName" column="user_name" jdbcType="VARCHAR"/>
|
||||
<result property="userPic" column="user_pic" jdbcType="VARCHAR"/>
|
||||
<result property="userStandardPic" column="user_standard_pic" jdbcType="VARCHAR"/>
|
||||
<result property="identityType" column="identity_type" jdbcType="TINYINT"/>
|
||||
<result property="idcard" column="idcard" jdbcType="VARCHAR"/>
|
||||
<result property="sex" column="sex" jdbcType="TINYINT"/>
|
||||
<result property="nation" column="nation" jdbcType="TINYINT"/>
|
||||
<result property="birthday" column="birthday" jdbcType="TIMESTAMP"/>
|
||||
<result property="company" column="company" jdbcType="VARCHAR"/>
|
||||
<result property="phone" column="phone" jdbcType="VARCHAR"/>
|
||||
<result property="nationality" column="nationality" jdbcType="TINYINT"/>
|
||||
<result property="nativeplace" column="nativeplace" jdbcType="VARCHAR"/>
|
||||
<result property="education" column="education" jdbcType="TINYINT"/>
|
||||
<result property="houseHoldRegister" column="house_hold_register" jdbcType="VARCHAR"/>
|
||||
<result property="houseHoldAddress" column="house_hold_address" jdbcType="VARCHAR"/>
|
||||
<result property="areaCode" column="area_code" jdbcType="VARCHAR"/>
|
||||
<result property="areaName" column="area_name" jdbcType="VARCHAR"/>
|
||||
<result property="habitation" column="habitation" jdbcType="VARCHAR"/>
|
||||
<result property="religious" column="religious" jdbcType="VARCHAR"/>
|
||||
<result property="politicalOutlook" column="political_outlook" jdbcType="TINYINT"/>
|
||||
<result property="entryTime" column="entry_time" jdbcType="BIGINT"/>
|
||||
<result property="marriage" column="marriage" jdbcType="TINYINT"/>
|
||||
<result property="personType" column="person_type" jdbcType="TINYINT"/>
|
||||
<result property="personCategory" column="person_category" jdbcType="TINYINT"/>
|
||||
<result property="caringLabel" column="caring_label" jdbcType="TINYINT"/>
|
||||
<result property="isHouseholder" column="is_householder" jdbcType="TINYINT"/>
|
||||
<result property="householderRelation" column="householder_relation" jdbcType="TINYINT"/>
|
||||
<result property="isVaccinate" column="is_vaccinate" jdbcType="TINYINT"/>
|
||||
<result property="isFirstVaccinate" column="is_first_vaccinate" jdbcType="TINYINT"/>
|
||||
<result property="isSecondVaccinate" column="is_second_vaccinate" jdbcType="TINYINT"/>
|
||||
<result property="isThirdVaccinate" column="is_third_vaccinate" jdbcType="TINYINT"/>
|
||||
<result property="taskStartTime" column="task_start_time" jdbcType="VARCHAR"/>
|
||||
<result property="taskEndTime" column="task_end_time" jdbcType="VARCHAR"/>
|
||||
<result property="taskDay" column="task_day" jdbcType="VARCHAR"/>
|
||||
<result property="createtime" column="createtime" jdbcType="TIMESTAMP"/>
|
||||
<result property="createby" column="createby" jdbcType="INTEGER"/>
|
||||
<result property="updatetime" column="updatetime" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateby" column="updateby" jdbcType="INTEGER"/>
|
||||
<result property="isactive" column="isactive" jdbcType="TINYINT"/>
|
||||
<result property="c1" column="c1" jdbcType="VARCHAR"/>
|
||||
<result property="c2" column="c2" jdbcType="VARCHAR"/>
|
||||
<result property="c3" column="c3" jdbcType="VARCHAR"/>
|
||||
<result property="c4" column="c4" jdbcType="VARCHAR"/>
|
||||
<result property="c5" column="c5" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectModelNotfoundUserInfoVo">
|
||||
select id,
|
||||
place_code,
|
||||
place_name,
|
||||
grid_code,
|
||||
grid_name,
|
||||
building_code,
|
||||
building_name,
|
||||
unit_code,
|
||||
unit_name,
|
||||
home_code,
|
||||
home_name,
|
||||
user_name,
|
||||
user_pic,
|
||||
user_standard_pic,
|
||||
identity_type,
|
||||
idcard,
|
||||
sex,
|
||||
nation,
|
||||
birthday,
|
||||
company,
|
||||
phone,
|
||||
nationality,
|
||||
nativeplace,
|
||||
education,
|
||||
house_hold_register,
|
||||
house_hold_address,
|
||||
area_code,
|
||||
area_name,
|
||||
habitation,
|
||||
religious,
|
||||
political_outlook,
|
||||
entry_time,
|
||||
marriage,
|
||||
person_type,
|
||||
person_category,
|
||||
caring_label,
|
||||
is_householder,
|
||||
householder_relation,
|
||||
is_vaccinate,
|
||||
is_first_vaccinate,
|
||||
is_second_vaccinate,
|
||||
is_third_vaccinate,
|
||||
task_start_time,
|
||||
task_end_time,
|
||||
task_day,
|
||||
createtime,
|
||||
createby,
|
||||
updatetime,
|
||||
updateby,
|
||||
isactive,
|
||||
c1,
|
||||
c2,
|
||||
c3,
|
||||
c4,
|
||||
c5
|
||||
from model_notfound_user_info
|
||||
</sql>
|
||||
|
||||
|
||||
</mapper>
|
Loading…
Reference in new issue