19 changed files with 1241 additions and 37 deletions
@ -0,0 +1,101 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.dto; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
import lombok.Data; |
|||
|
|||
|
|||
/** |
|||
* 按业务类型积分总计 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-04-20 |
|||
*/ |
|||
@Data |
|||
public class BizPointTotalDetailDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 组织Id |
|||
*/ |
|||
private String agencyId; |
|||
|
|||
/** |
|||
* 网格ID |
|||
*/ |
|||
private String gridId; |
|||
|
|||
/** |
|||
* 业务类型:小组:group |
|||
*/ |
|||
private String bizType; |
|||
|
|||
/** |
|||
* 业务类型的对象id |
|||
*/ |
|||
private String objectId; |
|||
|
|||
/** |
|||
* OBJECTID的总积分 总积分=objectId下所有的用户积分 |
|||
*/ |
|||
private Integer totalPoint; |
|||
|
|||
/** |
|||
* 删除标识 |
|||
*/ |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
} |
|||
@ -0,0 +1,106 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.dto; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
import lombok.Data; |
|||
|
|||
|
|||
/** |
|||
* 按业务类型积分总计 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-04-20 |
|||
*/ |
|||
@Data |
|||
public class BizPointUserTotalDetailDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 组织Id |
|||
*/ |
|||
private String agencyId; |
|||
|
|||
/** |
|||
* 网格ID |
|||
*/ |
|||
private String gridId; |
|||
|
|||
/** |
|||
* 用户ID |
|||
*/ |
|||
private String userId; |
|||
|
|||
/** |
|||
* 业务类型:小组:group |
|||
*/ |
|||
private String bizType; |
|||
|
|||
/** |
|||
* 业务类型的对象id |
|||
*/ |
|||
private String objectId; |
|||
|
|||
/** |
|||
* OBJECTID的总积分 总积分=objectId下所有的用户积分 |
|||
*/ |
|||
private Integer totalPoint; |
|||
|
|||
/** |
|||
* 删除标识 |
|||
*/ |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
} |
|||
@ -0,0 +1,43 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.dao; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.dto.BizPointTotalDetailDTO; |
|||
import com.epmet.entity.BizPointTotalDetailEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
/** |
|||
* 按业务类型积分总计 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-04-20 |
|||
*/ |
|||
@Mapper |
|||
public interface BizPointTotalDetailDao extends BaseDao<BizPointTotalDetailEntity> { |
|||
/** |
|||
* 根据业务类型查找数据 |
|||
* @author zhaoqifeng |
|||
* @date 2021/4/20 16:57 |
|||
* @param type |
|||
* @param objectId |
|||
* @return com.epmet.dto.BizPointTotalDetailDTO |
|||
*/ |
|||
BizPointTotalDetailDTO selectDataByObject(@Param("type")String type, @Param("objectId")String objectId); |
|||
} |
|||
@ -0,0 +1,33 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.dao; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.entity.BizPointUserTotalDetailEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* 按业务类型积分总计 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-04-20 |
|||
*/ |
|||
@Mapper |
|||
public interface BizPointUserTotalDetailDao extends BaseDao<BizPointUserTotalDetailEntity> { |
|||
|
|||
} |
|||
@ -0,0 +1,71 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
|
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 按业务类型积分总计 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-04-20 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("biz_point_total_detail") |
|||
public class BizPointTotalDetailEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 组织Id |
|||
*/ |
|||
private String agencyId; |
|||
|
|||
/** |
|||
* 网格ID |
|||
*/ |
|||
private String gridId; |
|||
|
|||
/** |
|||
* 业务类型:小组:group |
|||
*/ |
|||
private String bizType; |
|||
|
|||
/** |
|||
* 业务类型的对象id |
|||
*/ |
|||
private String objectId; |
|||
|
|||
/** |
|||
* OBJECTID的总积分 总积分=objectId下所有的用户积分 |
|||
*/ |
|||
private Integer totalPoint; |
|||
|
|||
} |
|||
@ -0,0 +1,76 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
|
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 按业务类型积分总计 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-04-20 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("biz_point_user_total_detail") |
|||
public class BizPointUserTotalDetailEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 组织Id |
|||
*/ |
|||
private String agencyId; |
|||
|
|||
/** |
|||
* 网格ID |
|||
*/ |
|||
private String gridId; |
|||
|
|||
/** |
|||
* 用户ID |
|||
*/ |
|||
private String userId; |
|||
|
|||
/** |
|||
* 业务类型:小组:group |
|||
*/ |
|||
private String bizType; |
|||
|
|||
/** |
|||
* 业务类型的对象id |
|||
*/ |
|||
private String objectId; |
|||
|
|||
/** |
|||
* OBJECTID的总积分 总积分=objectId下所有的用户积分 |
|||
*/ |
|||
private Integer totalPoint; |
|||
|
|||
} |
|||
@ -0,0 +1,105 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.service; |
|||
|
|||
import com.epmet.commons.mybatis.service.BaseService; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.dto.BizPointTotalDetailDTO; |
|||
import com.epmet.entity.BizPointTotalDetailEntity; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 按业务类型积分总计 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-04-20 |
|||
*/ |
|||
public interface BizPointTotalDetailService extends BaseService<BizPointTotalDetailEntity> { |
|||
|
|||
/** |
|||
* 默认分页 |
|||
* |
|||
* @param params |
|||
* @return PageData<BizPointTotalDetailDTO> |
|||
* @author generator |
|||
* @date 2021-04-20 |
|||
*/ |
|||
PageData<BizPointTotalDetailDTO> page(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 默认查询 |
|||
* |
|||
* @param params |
|||
* @return java.util.List<BizPointTotalDetailDTO> |
|||
* @author generator |
|||
* @date 2021-04-20 |
|||
*/ |
|||
List<BizPointTotalDetailDTO> list(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 单条查询 |
|||
* |
|||
* @param id |
|||
* @return BizPointTotalDetailDTO |
|||
* @author generator |
|||
* @date 2021-04-20 |
|||
*/ |
|||
BizPointTotalDetailDTO get(String id); |
|||
|
|||
/** |
|||
* 默认保存 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2021-04-20 |
|||
*/ |
|||
void save(BizPointTotalDetailDTO dto); |
|||
|
|||
/** |
|||
* 默认更新 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2021-04-20 |
|||
*/ |
|||
void update(BizPointTotalDetailDTO dto); |
|||
|
|||
/** |
|||
* 批量删除 |
|||
* |
|||
* @param ids |
|||
* @return void |
|||
* @author generator |
|||
* @date 2021-04-20 |
|||
*/ |
|||
void delete(String[] ids); |
|||
|
|||
/** |
|||
* 根据业务类型查找数据 |
|||
* @author zhaoqifeng |
|||
* @date 2021/4/20 16:53 |
|||
* @param type |
|||
* @param objectId |
|||
* @return com.epmet.dto.BizPointTotalDetailDTO |
|||
*/ |
|||
BizPointTotalDetailDTO getDataByObject(String type, String objectId); |
|||
} |
|||
@ -0,0 +1,117 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.service; |
|||
|
|||
import com.epmet.commons.mybatis.service.BaseService; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.dto.BizPointUserTotalDetailDTO; |
|||
import com.epmet.entity.BizPointUserTotalDetailEntity; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 按业务类型积分总计 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-04-20 |
|||
*/ |
|||
public interface BizPointUserTotalDetailService extends BaseService<BizPointUserTotalDetailEntity> { |
|||
|
|||
/** |
|||
* 默认分页 |
|||
* |
|||
* @param params |
|||
* @return PageData<BizPointUserTotalDetailDTO> |
|||
* @author generator |
|||
* @date 2021-04-20 |
|||
*/ |
|||
PageData<BizPointUserTotalDetailDTO> page(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 默认查询 |
|||
* |
|||
* @param params |
|||
* @return java.util.List<BizPointUserTotalDetailDTO> |
|||
* @author generator |
|||
* @date 2021-04-20 |
|||
*/ |
|||
List<BizPointUserTotalDetailDTO> list(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 单条查询 |
|||
* |
|||
* @param id |
|||
* @return BizPointUserTotalDetailDTO |
|||
* @author generator |
|||
* @date 2021-04-20 |
|||
*/ |
|||
BizPointUserTotalDetailDTO get(String id); |
|||
|
|||
/** |
|||
* 默认保存 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2021-04-20 |
|||
*/ |
|||
void save(BizPointUserTotalDetailDTO dto); |
|||
|
|||
/** |
|||
* 默认更新 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2021-04-20 |
|||
*/ |
|||
void update(BizPointUserTotalDetailDTO dto); |
|||
|
|||
/** |
|||
* 批量删除 |
|||
* |
|||
* @param ids |
|||
* @return void |
|||
* @author generator |
|||
* @date 2021-04-20 |
|||
*/ |
|||
void delete(String[] ids); |
|||
|
|||
|
|||
/** |
|||
* 根据业务类型查找用户数据 |
|||
* @author zhaoqifeng |
|||
* @date 2021/4/20 16:53 |
|||
* @param type |
|||
* @param objectId |
|||
* @param userId |
|||
* @return com.epmet.dto.BizPointTotalDetailDTO |
|||
*/ |
|||
BizPointUserTotalDetailDTO getDataByObject(String type, String objectId, String userId); |
|||
|
|||
/** |
|||
* 根据业务类型查找积分总和 |
|||
* @author zhaoqifeng |
|||
* @date 2021/4/20 17:21 |
|||
* @param type |
|||
* @param objectId |
|||
* @return java.lang.Integer |
|||
*/ |
|||
Integer getTotalByObject(String type, String objectId); |
|||
} |
|||
@ -0,0 +1,115 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.commons.tools.utils.ConvertUtils; |
|||
import com.epmet.commons.tools.constant.FieldConstant; |
|||
import com.epmet.dao.BizPointTotalDetailDao; |
|||
import com.epmet.dto.BizPointTotalDetailDTO; |
|||
import com.epmet.entity.BizPointTotalDetailEntity; |
|||
import com.epmet.service.BizPointTotalDetailService; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
import java.util.Arrays; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 按业务类型积分总计 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-04-20 |
|||
*/ |
|||
@Service |
|||
public class BizPointTotalDetailServiceImpl extends BaseServiceImpl<BizPointTotalDetailDao, BizPointTotalDetailEntity> implements BizPointTotalDetailService { |
|||
|
|||
|
|||
@Override |
|||
public PageData<BizPointTotalDetailDTO> page(Map<String, Object> params) { |
|||
IPage<BizPointTotalDetailEntity> page = baseDao.selectPage( |
|||
getPage(params, FieldConstant.CREATED_TIME, false), |
|||
getWrapper(params) |
|||
); |
|||
return getPageData(page, BizPointTotalDetailDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
public List<BizPointTotalDetailDTO> list(Map<String, Object> params) { |
|||
List<BizPointTotalDetailEntity> entityList = baseDao.selectList(getWrapper(params)); |
|||
|
|||
return ConvertUtils.sourceToTarget(entityList, BizPointTotalDetailDTO.class); |
|||
} |
|||
|
|||
private QueryWrapper<BizPointTotalDetailEntity> getWrapper(Map<String, Object> params){ |
|||
String id = (String)params.get(FieldConstant.ID_HUMP); |
|||
|
|||
QueryWrapper<BizPointTotalDetailEntity> wrapper = new QueryWrapper<>(); |
|||
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
|||
|
|||
return wrapper; |
|||
} |
|||
|
|||
@Override |
|||
public BizPointTotalDetailDTO get(String id) { |
|||
BizPointTotalDetailEntity entity = baseDao.selectById(id); |
|||
return ConvertUtils.sourceToTarget(entity, BizPointTotalDetailDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void save(BizPointTotalDetailDTO dto) { |
|||
BizPointTotalDetailEntity entity = ConvertUtils.sourceToTarget(dto, BizPointTotalDetailEntity.class); |
|||
insert(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void update(BizPointTotalDetailDTO dto) { |
|||
BizPointTotalDetailEntity entity = ConvertUtils.sourceToTarget(dto, BizPointTotalDetailEntity.class); |
|||
updateById(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void delete(String[] ids) { |
|||
// 逻辑删除(@TableLogic 注解)
|
|||
baseDao.deleteBatchIds(Arrays.asList(ids)); |
|||
} |
|||
|
|||
/** |
|||
* 根据业务类型查找数据 |
|||
* |
|||
* @param type |
|||
* @param objectId |
|||
* @return com.epmet.dto.BizPointTotalDetailDTO |
|||
* @author zhaoqifeng |
|||
* @date 2021/4/20 16:53 |
|||
*/ |
|||
@Override |
|||
public BizPointTotalDetailDTO getDataByObject(String type, String objectId) { |
|||
return baseDao.selectDataByObject(type, objectId); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,142 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|||
import com.epmet.commons.tools.constant.NumConstant; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.commons.tools.utils.ConvertUtils; |
|||
import com.epmet.commons.tools.constant.FieldConstant; |
|||
import com.epmet.dao.BizPointUserTotalDetailDao; |
|||
import com.epmet.dto.BizPointUserTotalDetailDTO; |
|||
import com.epmet.entity.BizPointUserTotalDetailEntity; |
|||
import com.epmet.service.BizPointUserTotalDetailService; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
import java.util.Arrays; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 按业务类型积分总计 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-04-20 |
|||
*/ |
|||
@Service |
|||
public class BizPointUserTotalDetailServiceImpl extends BaseServiceImpl<BizPointUserTotalDetailDao, BizPointUserTotalDetailEntity> implements BizPointUserTotalDetailService { |
|||
|
|||
|
|||
@Override |
|||
public PageData<BizPointUserTotalDetailDTO> page(Map<String, Object> params) { |
|||
IPage<BizPointUserTotalDetailEntity> page = baseDao.selectPage( |
|||
getPage(params, FieldConstant.CREATED_TIME, false), |
|||
getWrapper(params) |
|||
); |
|||
return getPageData(page, BizPointUserTotalDetailDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
public List<BizPointUserTotalDetailDTO> list(Map<String, Object> params) { |
|||
List<BizPointUserTotalDetailEntity> entityList = baseDao.selectList(getWrapper(params)); |
|||
|
|||
return ConvertUtils.sourceToTarget(entityList, BizPointUserTotalDetailDTO.class); |
|||
} |
|||
|
|||
private QueryWrapper<BizPointUserTotalDetailEntity> getWrapper(Map<String, Object> params){ |
|||
String id = (String)params.get(FieldConstant.ID_HUMP); |
|||
|
|||
QueryWrapper<BizPointUserTotalDetailEntity> wrapper = new QueryWrapper<>(); |
|||
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
|||
|
|||
return wrapper; |
|||
} |
|||
|
|||
@Override |
|||
public BizPointUserTotalDetailDTO get(String id) { |
|||
BizPointUserTotalDetailEntity entity = baseDao.selectById(id); |
|||
return ConvertUtils.sourceToTarget(entity, BizPointUserTotalDetailDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void save(BizPointUserTotalDetailDTO dto) { |
|||
BizPointUserTotalDetailEntity entity = ConvertUtils.sourceToTarget(dto, BizPointUserTotalDetailEntity.class); |
|||
insert(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void update(BizPointUserTotalDetailDTO dto) { |
|||
BizPointUserTotalDetailEntity entity = ConvertUtils.sourceToTarget(dto, BizPointUserTotalDetailEntity.class); |
|||
updateById(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void delete(String[] ids) { |
|||
// 逻辑删除(@TableLogic 注解)
|
|||
baseDao.deleteBatchIds(Arrays.asList(ids)); |
|||
} |
|||
|
|||
/** |
|||
* 根据业务类型查找用户数据 |
|||
* |
|||
* @param type |
|||
* @param objectId |
|||
* @param userId |
|||
* @return com.epmet.dto.BizPointTotalDetailDTO |
|||
* @author zhaoqifeng |
|||
* @date 2021/4/20 16:53 |
|||
*/ |
|||
@Override |
|||
public BizPointUserTotalDetailDTO getDataByObject(String type, String objectId, String userId) { |
|||
QueryWrapper<BizPointUserTotalDetailEntity> wrapper = new QueryWrapper<>(); |
|||
wrapper.eq("BIZ_TYPE", type) |
|||
.eq("OBJECT_ID", objectId) |
|||
.eq("USER_ID", userId); |
|||
BizPointUserTotalDetailEntity entity = baseDao.selectOne(wrapper); |
|||
return ConvertUtils.sourceToTarget(entity, BizPointUserTotalDetailDTO.class); |
|||
} |
|||
|
|||
/** |
|||
* 根据业务类型查找积分总和 |
|||
* |
|||
* @param type |
|||
* @param objectId |
|||
* @return java.lang.Integer |
|||
* @author zhaoqifeng |
|||
* @date 2021/4/20 17:21 |
|||
*/ |
|||
@Override |
|||
public Integer getTotalByObject(String type, String objectId) { |
|||
QueryWrapper<BizPointUserTotalDetailEntity> wrapper = new QueryWrapper<>(); |
|||
wrapper.select("sum(TOTAL_POINT) as TOTAL_POINT").eq("BIZ_TYPE", type) |
|||
.eq("OBJECT_ID", objectId); |
|||
BizPointUserTotalDetailEntity entity = baseDao.selectOne(wrapper); |
|||
if (null == entity) { |
|||
return NumConstant.ZERO; |
|||
} |
|||
return entity.getTotalPoint(); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,33 @@ |
|||
<?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.epmet.dao.BizPointTotalDetailDao"> |
|||
|
|||
<resultMap type="com.epmet.entity.BizPointTotalDetailEntity" id="bizPointTotalDetailMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="customerId" column="CUSTOMER_ID"/> |
|||
<result property="agencyId" column="AGENCY_ID"/> |
|||
<result property="gridId" column="GRID_ID"/> |
|||
<result property="bizType" column="BIZ_TYPE"/> |
|||
<result property="objectId" column="OBJECT_ID"/> |
|||
<result property="totalPoint" column="TOTAL_POINT"/> |
|||
<result property="delFlag" column="DEL_FLAG"/> |
|||
<result property="revision" column="REVISION"/> |
|||
<result property="createdBy" column="CREATED_BY"/> |
|||
<result property="createdTime" column="CREATED_TIME"/> |
|||
<result property="updatedBy" column="UPDATED_BY"/> |
|||
<result property="updatedTime" column="UPDATED_TIME"/> |
|||
</resultMap> |
|||
<select id="selectDataByObject" resultType="com.epmet.dto.BizPointTotalDetailDTO"> |
|||
select ID, |
|||
CUSTOMER_ID, |
|||
AGENCY_ID, |
|||
GRID_ID, |
|||
TOTAL_POINT |
|||
from biz_point_total_detail |
|||
where BIZ_TYPE = #{type} |
|||
and OBJECT_ID = #{objectId} |
|||
</select> |
|||
|
|||
|
|||
</mapper> |
|||
@ -0,0 +1,24 @@ |
|||
<?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.epmet.dao.BizPointUserTotalDetailDao"> |
|||
|
|||
<resultMap type="com.epmet.entity.BizPointUserTotalDetailEntity" id="bizPointUserTotalDetailMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="customerId" column="CUSTOMER_ID"/> |
|||
<result property="agencyId" column="AGENCY_ID"/> |
|||
<result property="gridId" column="GRID_ID"/> |
|||
<result property="userId" column="USER_ID"/> |
|||
<result property="bizType" column="BIZ_TYPE"/> |
|||
<result property="objectId" column="OBJECT_ID"/> |
|||
<result property="totalPoint" column="TOTAL_POINT"/> |
|||
<result property="delFlag" column="DEL_FLAG"/> |
|||
<result property="revision" column="REVISION"/> |
|||
<result property="createdBy" column="CREATED_BY"/> |
|||
<result property="createdTime" column="CREATED_TIME"/> |
|||
<result property="updatedBy" column="UPDATED_BY"/> |
|||
<result property="updatedTime" column="UPDATED_TIME"/> |
|||
</resultMap> |
|||
|
|||
|
|||
</mapper> |
|||
Loading…
Reference in new issue