Merge branch 'master' of http://114.55.171.231:3000/Euni4U/backend
This commit is contained in:
commit
570ea1e405
@ -22,20 +22,29 @@ import org.apache.ibatis.annotations.Select;
|
|||||||
public interface DeviceMapper extends BaseMapperX<DeviceDO> {
|
public interface DeviceMapper extends BaseMapperX<DeviceDO> {
|
||||||
|
|
||||||
default PageResult<DeviceDO> selectPage(DevicePageReqVO reqVO) {
|
default PageResult<DeviceDO> selectPage(DevicePageReqVO reqVO) {
|
||||||
return selectPage(reqVO, new LambdaQueryWrapperX<DeviceDO>()
|
LambdaQueryWrapperX<DeviceDO> wrapper = new LambdaQueryWrapperX<>();
|
||||||
.likeIfPresent(DeviceDO::getDevicename, reqVO.getDevicename())
|
|
||||||
.eqIfPresent(DeviceDO::getDevicecode, reqVO.getDevicecode())
|
wrapper.likeIfPresent(DeviceDO::getDevicename, reqVO.getDevicename());
|
||||||
.eqIfPresent(DeviceDO::getDevicetype, reqVO.getDevicetype())
|
wrapper.eqIfPresent(DeviceDO::getDevicecode, reqVO.getDevicecode());
|
||||||
.eqIfPresent(DeviceDO::getLocation, reqVO.getLocation())
|
wrapper.eqIfPresent(DeviceDO::getDevicetype, reqVO.getDevicetype());
|
||||||
.eqIfPresent(DeviceDO::getDevicestatus, reqVO.getDevicestatus())
|
wrapper.eqIfPresent(DeviceDO::getLocation, reqVO.getLocation());
|
||||||
.eqIfPresent(DeviceDO::getOrgid, reqVO.getOrgid())
|
wrapper.eqIfPresent(DeviceDO::getDevicestatus, reqVO.getDevicestatus());
|
||||||
.likeIfPresent(DeviceDO::getOrgname, reqVO.getOrgname())
|
|
||||||
.eqIfPresent(DeviceDO::getDescription, reqVO.getDescription())
|
// 手动处理 orgid:只有非 null 且不等于 0 时才添加
|
||||||
.betweenIfPresent(DeviceDO::getCreatetime, reqVO.getCreatetime())
|
Integer orgid = reqVO.getOrgid();
|
||||||
.betweenIfPresent(DeviceDO::getUpdatetime, reqVO.getUpdatetime())
|
if (orgid != null && orgid != 0) {
|
||||||
.eqIfPresent(DeviceDO::getCreateby, reqVO.getCreateby())
|
wrapper.eq(DeviceDO::getOrgid, orgid);
|
||||||
.eqIfPresent(DeviceDO::getUpdateby, reqVO.getUpdateby())
|
}
|
||||||
.orderByDesc(DeviceDO::getId));
|
|
||||||
|
wrapper.likeIfPresent(DeviceDO::getOrgname, reqVO.getOrgname());
|
||||||
|
wrapper.eqIfPresent(DeviceDO::getDescription, reqVO.getDescription());
|
||||||
|
wrapper.betweenIfPresent(DeviceDO::getCreatetime, reqVO.getCreatetime());
|
||||||
|
wrapper.betweenIfPresent(DeviceDO::getUpdatetime, reqVO.getUpdatetime());
|
||||||
|
wrapper.eqIfPresent(DeviceDO::getCreateby, reqVO.getCreateby());
|
||||||
|
wrapper.eqIfPresent(DeviceDO::getUpdateby, reqVO.getUpdateby());
|
||||||
|
wrapper.orderByDesc(DeviceDO::getId);
|
||||||
|
|
||||||
|
return selectPage(reqVO, wrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
default PageResult<DeviceDO> selectNotBindPage(DevicePageReqVO reqVO) {
|
default PageResult<DeviceDO> selectNotBindPage(DevicePageReqVO reqVO) {
|
||||||
|
|||||||
@ -38,15 +38,16 @@
|
|||||||
DATE(vipstarttime) AS vip_date,
|
DATE(vipstarttime) AS vip_date,
|
||||||
COUNT(*) AS count
|
COUNT(*) AS count
|
||||||
FROM tb_user
|
FROM tb_user
|
||||||
WHERE isvip = 1
|
|
||||||
<where>
|
<where>
|
||||||
|
isvip = 1
|
||||||
<!-- 如果 orgid 不等于 0,则加上 orgid 条件 -->
|
<!-- 如果 orgid 不等于 0,则加上 orgid 条件 -->
|
||||||
<if test="orgid != null and orgid != 0">
|
<if test="orgid != null and orgid != 0">
|
||||||
AND orgid = #{orgid}
|
AND orgid = #{orgid}
|
||||||
</if>
|
</if>
|
||||||
|
AND vipstarttime >= DATE_SUB(CURDATE(), INTERVAL 6 DAY)
|
||||||
|
AND vipstarttime < DATE_ADD(CURDATE(), INTERVAL 1 DAY)
|
||||||
</where>
|
</where>
|
||||||
AND vipstarttime >= DATE_SUB(CURDATE(), INTERVAL 6 DAY)
|
|
||||||
AND vipstarttime < DATE_ADD(CURDATE(), INTERVAL 1 DAY)
|
|
||||||
GROUP BY DATE(vipstarttime)
|
GROUP BY DATE(vipstarttime)
|
||||||
)
|
)
|
||||||
SELECT
|
SELECT
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user