4 changed files with 229 additions and 0 deletions
@ -0,0 +1,15 @@ |
|||
package com.zdxt.enforcementcode.mapper; |
|||
|
|||
import com.zdxt.enforcementcode.domain.LgSendMessageLog; |
|||
import com.zdxt.enforcementcode.domain.vo.LgSendMessageLogVo; |
|||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; |
|||
|
|||
/** |
|||
* 龙岗发送消息日志Mapper接口 |
|||
* |
|||
* @author Lion Li |
|||
* @date 2026-11-23 |
|||
*/ |
|||
public interface LgSendMessageLogMapper extends BaseMapperPlus<LgSendMessageLog, LgSendMessageLogVo> { |
|||
|
|||
} |
|||
@ -0,0 +1,68 @@ |
|||
package com.zdxt.enforcementcode.service; |
|||
|
|||
import com.zdxt.enforcementcode.domain.vo.LgSendMessageLogVo; |
|||
import com.zdxt.enforcementcode.domain.bo.LgSendMessageLogBo; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
import org.dromara.common.mybatis.core.page.PageQuery; |
|||
|
|||
import java.util.Collection; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 龙岗发送消息日志Service接口 |
|||
* |
|||
* @author Lion Li |
|||
* @date 2026-11-23 |
|||
*/ |
|||
public interface ILgSendMessageLogService { |
|||
|
|||
/** |
|||
* 查询龙岗发送消息日志 |
|||
* |
|||
* @param id 主键 |
|||
* @return 龙岗发送消息日志 |
|||
*/ |
|||
LgSendMessageLogVo queryById(Long id); |
|||
|
|||
/** |
|||
* 分页查询龙岗发送消息日志列表 |
|||
* |
|||
* @param bo 查询条件 |
|||
* @param pageQuery 分页参数 |
|||
* @return 龙岗发送消息日志分页列表 |
|||
*/ |
|||
TableDataInfo<LgSendMessageLogVo> queryPageList(LgSendMessageLogBo bo, PageQuery pageQuery); |
|||
|
|||
/** |
|||
* 查询符合条件的龙岗发送消息日志列表 |
|||
* |
|||
* @param bo 查询条件 |
|||
* @return 龙岗发送消息日志列表 |
|||
*/ |
|||
List<LgSendMessageLogVo> queryList(LgSendMessageLogBo bo); |
|||
|
|||
/** |
|||
* 新增龙岗发送消息日志 |
|||
* |
|||
* @param bo 龙岗发送消息日志 |
|||
* @return 是否新增成功 |
|||
*/ |
|||
Boolean insertByBo(LgSendMessageLogBo bo); |
|||
|
|||
/** |
|||
* 修改龙岗发送消息日志 |
|||
* |
|||
* @param bo 龙岗发送消息日志 |
|||
* @return 是否修改成功 |
|||
*/ |
|||
Boolean updateByBo(LgSendMessageLogBo bo); |
|||
|
|||
/** |
|||
* 校验并批量删除龙岗发送消息日志信息 |
|||
* |
|||
* @param ids 待删除的主键集合 |
|||
* @param isValid 是否进行有效性校验 |
|||
* @return 是否删除成功 |
|||
*/ |
|||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid); |
|||
} |
|||
@ -0,0 +1,140 @@ |
|||
package com.zdxt.enforcementcode.service.impl; |
|||
|
|||
import org.dromara.common.core.utils.MapstructUtils; |
|||
import org.dromara.common.core.utils.StringUtils; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
import org.dromara.common.mybatis.core.page.PageQuery; |
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|||
import lombok.RequiredArgsConstructor; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.stereotype.Service; |
|||
import com.zdxt.enforcementcode.domain.bo.LgSendMessageLogBo; |
|||
import com.zdxt.enforcementcode.domain.vo.LgSendMessageLogVo; |
|||
import com.zdxt.enforcementcode.domain.LgSendMessageLog; |
|||
import com.zdxt.enforcementcode.mapper.LgSendMessageLogMapper; |
|||
import com.zdxt.enforcementcode.service.ILgSendMessageLogService; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
import java.util.Collection; |
|||
|
|||
/** |
|||
* 龙岗发送消息日志Service业务层处理 |
|||
* |
|||
* @author Lion Li |
|||
* @date 2026-11-23 |
|||
*/ |
|||
@Slf4j |
|||
@RequiredArgsConstructor |
|||
@Service |
|||
public class LgSendMessageLogServiceImpl implements ILgSendMessageLogService { |
|||
|
|||
private final LgSendMessageLogMapper baseMapper; |
|||
|
|||
/** |
|||
* 查询龙岗发送消息日志 |
|||
* |
|||
* @param id 主键 |
|||
* @return 龙岗发送消息日志 |
|||
*/ |
|||
@Override |
|||
public LgSendMessageLogVo queryById(Long id){ |
|||
return baseMapper.selectVoById(id); |
|||
} |
|||
|
|||
/** |
|||
* 分页查询龙岗发送消息日志列表 |
|||
* |
|||
* @param bo 查询条件 |
|||
* @param pageQuery 分页参数 |
|||
* @return 龙岗发送消息日志分页列表 |
|||
*/ |
|||
@Override |
|||
public TableDataInfo<LgSendMessageLogVo> queryPageList(LgSendMessageLogBo bo, PageQuery pageQuery) { |
|||
LambdaQueryWrapper<LgSendMessageLog> lqw = buildQueryWrapper(bo); |
|||
Page<LgSendMessageLogVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw); |
|||
return TableDataInfo.build(result); |
|||
} |
|||
|
|||
/** |
|||
* 查询符合条件的龙岗发送消息日志列表 |
|||
* |
|||
* @param bo 查询条件 |
|||
* @return 龙岗发送消息日志列表 |
|||
*/ |
|||
@Override |
|||
public List<LgSendMessageLogVo> queryList(LgSendMessageLogBo bo) { |
|||
LambdaQueryWrapper<LgSendMessageLog> lqw = buildQueryWrapper(bo); |
|||
return baseMapper.selectVoList(lqw); |
|||
} |
|||
|
|||
private LambdaQueryWrapper<LgSendMessageLog> buildQueryWrapper(LgSendMessageLogBo bo) { |
|||
Map<String, Object> params = bo.getParams(); |
|||
LambdaQueryWrapper<LgSendMessageLog> lqw = Wrappers.lambdaQuery(); |
|||
lqw.orderByAsc(LgSendMessageLog::getId); |
|||
lqw.eq(StringUtils.isNotBlank(bo.getTouser()), LgSendMessageLog::getTouser, bo.getTouser()); |
|||
lqw.eq(StringUtils.isNotBlank(bo.getContent()), LgSendMessageLog::getContent, bo.getContent()); |
|||
lqw.eq(StringUtils.isNotBlank(bo.getErrcode()), LgSendMessageLog::getErrcode, bo.getErrcode()); |
|||
lqw.eq(StringUtils.isNotBlank(bo.getErrmsg()), LgSendMessageLog::getErrmsg, bo.getErrmsg()); |
|||
lqw.eq(StringUtils.isNotBlank(bo.getInvaliduser()), LgSendMessageLog::getInvaliduser, bo.getInvaliduser()); |
|||
lqw.eq(StringUtils.isNotBlank(bo.getInvalidparty()), LgSendMessageLog::getInvalidparty, bo.getInvalidparty()); |
|||
lqw.eq(StringUtils.isNotBlank(bo.getJobid()), LgSendMessageLog::getJobid, bo.getJobid()); |
|||
lqw.eq(StringUtils.isNotBlank(bo.getStatus()), LgSendMessageLog::getStatus, bo.getStatus()); |
|||
lqw.eq(StringUtils.isNotBlank(bo.getIsDelete()), LgSendMessageLog::getIsDelete, bo.getIsDelete()); |
|||
return lqw; |
|||
} |
|||
|
|||
/** |
|||
* 新增龙岗发送消息日志 |
|||
* |
|||
* @param bo 龙岗发送消息日志 |
|||
* @return 是否新增成功 |
|||
*/ |
|||
@Override |
|||
public Boolean insertByBo(LgSendMessageLogBo bo) { |
|||
LgSendMessageLog add = MapstructUtils.convert(bo, LgSendMessageLog.class); |
|||
validEntityBeforeSave(add); |
|||
boolean flag = baseMapper.insert(add) > 0; |
|||
if (flag) { |
|||
bo.setId(add.getId()); |
|||
} |
|||
return flag; |
|||
} |
|||
|
|||
/** |
|||
* 修改龙岗发送消息日志 |
|||
* |
|||
* @param bo 龙岗发送消息日志 |
|||
* @return 是否修改成功 |
|||
*/ |
|||
@Override |
|||
public Boolean updateByBo(LgSendMessageLogBo bo) { |
|||
LgSendMessageLog update = MapstructUtils.convert(bo, LgSendMessageLog.class); |
|||
validEntityBeforeSave(update); |
|||
return baseMapper.updateById(update) > 0; |
|||
} |
|||
|
|||
/** |
|||
* 保存前的数据校验 |
|||
*/ |
|||
private void validEntityBeforeSave(LgSendMessageLog entity){ |
|||
//TODO 做一些数据校验,如唯一约束
|
|||
} |
|||
|
|||
/** |
|||
* 校验并批量删除龙岗发送消息日志信息 |
|||
* |
|||
* @param ids 待删除的主键集合 |
|||
* @param isValid 是否进行有效性校验 |
|||
* @return 是否删除成功 |
|||
*/ |
|||
@Override |
|||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) { |
|||
if(isValid){ |
|||
//TODO 做一些业务上的校验,判断是否需要校验
|
|||
} |
|||
return baseMapper.deleteByIds(ids) > 0; |
|||
} |
|||
} |
|||
@ -0,0 +1,6 @@ |
|||
<?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.zdxt.enforcementcode.mapper.LgSendMessageLogMapper"> |
|||
</mapper> |
|||
Loading…
Reference in new issue