refactor(examine): 重构考核模块代码结构
- 将 Dao 接口统一改为 Mapper 接口 - 更新 XML 配置文件路径和内容 - 修改 Service 实现类中的 Dao 调用 - 为 ExamineUser 实体类添加考核状态字段- 新增 ExamineUser 列表查询接口和实现 - 更新 ExamineUserController,增加分页查询功能dev_1.1.0
parent
d28f35e328
commit
e2884835f0
|
@ -6,6 +6,8 @@ import org.springframework.data.domain.Page;
|
|||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import tech.unissense.pms.common.core.controller.BaseController;
|
||||
import tech.unissense.pms.common.core.page.TableDataInfo;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
|
@ -16,8 +18,8 @@ import javax.annotation.Resource;
|
|||
* @since 2025-01-02 10:18:52
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("examineUser")
|
||||
public class ExamineUserController {
|
||||
@RequestMapping("examine/user")
|
||||
public class ExamineUserController extends BaseController {
|
||||
/**
|
||||
* 服务对象
|
||||
*/
|
||||
|
@ -36,6 +38,19 @@ public class ExamineUserController {
|
|||
return ResponseEntity.ok(this.examineUserService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param examineUser
|
||||
* @return tech.unissense.pms.common.core.page.TableDataInfo
|
||||
* @author ch
|
||||
* @date 2025/01/02 10:36
|
||||
*/
|
||||
@GetMapping
|
||||
public TableDataInfo queryPage(ExamineUser examineUser) {
|
||||
startPage();
|
||||
return getDataTable(examineUserService.list(examineUser));
|
||||
}
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
|
|
|
@ -14,7 +14,7 @@ import java.util.List;
|
|||
* @since 2025-01-02 10:17:37
|
||||
*/
|
||||
@Mapper
|
||||
public interface ExamineConfigDao {
|
||||
public interface ExamineConfigMapper {
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
|
@ -1,7 +1,7 @@
|
|||
package tech.unissense.pms.business.examine.config.service.impl;
|
||||
|
||||
import tech.unissense.pms.business.examine.config.domain.ExamineConfig;
|
||||
import tech.unissense.pms.business.examine.config.mapper.ExamineConfigDao;
|
||||
import tech.unissense.pms.business.examine.config.mapper.ExamineConfigMapper;
|
||||
import tech.unissense.pms.business.examine.config.service.ExamineConfigService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
@ -16,7 +16,7 @@ import javax.annotation.Resource;
|
|||
@Service("examineConfigService")
|
||||
public class ExamineConfigServiceImpl implements ExamineConfigService {
|
||||
@Resource
|
||||
private ExamineConfigDao examineConfigDao;
|
||||
private ExamineConfigMapper examineConfigMapper;
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
|
@ -26,7 +26,7 @@ public class ExamineConfigServiceImpl implements ExamineConfigService {
|
|||
*/
|
||||
@Override
|
||||
public ExamineConfig queryById(Integer id) {
|
||||
return this.examineConfigDao.queryById(id);
|
||||
return this.examineConfigMapper.queryById(id);
|
||||
}
|
||||
|
||||
|
||||
|
@ -39,7 +39,7 @@ public class ExamineConfigServiceImpl implements ExamineConfigService {
|
|||
*/
|
||||
@Override
|
||||
public ExamineConfig insert(ExamineConfig examineConfig) {
|
||||
this.examineConfigDao.insert(examineConfig);
|
||||
this.examineConfigMapper.insert(examineConfig);
|
||||
return examineConfig;
|
||||
}
|
||||
|
||||
|
@ -51,7 +51,7 @@ public class ExamineConfigServiceImpl implements ExamineConfigService {
|
|||
*/
|
||||
@Override
|
||||
public ExamineConfig update(ExamineConfig examineConfig) {
|
||||
this.examineConfigDao.update(examineConfig);
|
||||
this.examineConfigMapper.update(examineConfig);
|
||||
return this.queryById(examineConfig.getId());
|
||||
}
|
||||
|
||||
|
@ -63,6 +63,6 @@ public class ExamineConfigServiceImpl implements ExamineConfigService {
|
|||
*/
|
||||
@Override
|
||||
public boolean deleteById(Integer id) {
|
||||
return this.examineConfigDao.deleteById(id) > 0;
|
||||
return this.examineConfigMapper.deleteById(id) > 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ import java.util.List;
|
|||
* @since 2025-01-02 10:18:05
|
||||
*/
|
||||
@Mapper
|
||||
public interface ExamineDetailDao {
|
||||
public interface ExamineDetailMapper {
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
|
@ -1,7 +1,7 @@
|
|||
package tech.unissense.pms.business.examine.detail.service.impl;
|
||||
|
||||
import tech.unissense.pms.business.examine.detail.domain.ExamineDetail;
|
||||
import tech.unissense.pms.business.examine.detail.mapper.ExamineDetailDao;
|
||||
import tech.unissense.pms.business.examine.detail.mapper.ExamineDetailMapper;
|
||||
import tech.unissense.pms.business.examine.detail.service.ExamineDetailService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
@ -16,7 +16,7 @@ import javax.annotation.Resource;
|
|||
@Service("examineDetailService")
|
||||
public class ExamineDetailServiceImpl implements ExamineDetailService {
|
||||
@Resource
|
||||
private ExamineDetailDao examineDetailDao;
|
||||
private ExamineDetailMapper examineDetailMapper;
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
|
@ -26,7 +26,7 @@ public class ExamineDetailServiceImpl implements ExamineDetailService {
|
|||
*/
|
||||
@Override
|
||||
public ExamineDetail queryById(Integer id) {
|
||||
return this.examineDetailDao.queryById(id);
|
||||
return this.examineDetailMapper.queryById(id);
|
||||
}
|
||||
|
||||
|
||||
|
@ -39,7 +39,7 @@ public class ExamineDetailServiceImpl implements ExamineDetailService {
|
|||
*/
|
||||
@Override
|
||||
public ExamineDetail insert(ExamineDetail examineDetail) {
|
||||
this.examineDetailDao.insert(examineDetail);
|
||||
this.examineDetailMapper.insert(examineDetail);
|
||||
return examineDetail;
|
||||
}
|
||||
|
||||
|
@ -51,7 +51,7 @@ public class ExamineDetailServiceImpl implements ExamineDetailService {
|
|||
*/
|
||||
@Override
|
||||
public ExamineDetail update(ExamineDetail examineDetail) {
|
||||
this.examineDetailDao.update(examineDetail);
|
||||
this.examineDetailMapper.update(examineDetail);
|
||||
return this.queryById(examineDetail.getId());
|
||||
}
|
||||
|
||||
|
@ -63,6 +63,6 @@ public class ExamineDetailServiceImpl implements ExamineDetailService {
|
|||
*/
|
||||
@Override
|
||||
public boolean deleteById(Integer id) {
|
||||
return this.examineDetailDao.deleteById(id) > 0;
|
||||
return this.examineDetailMapper.deleteById(id) > 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ import java.util.List;
|
|||
* @since 2025-01-02 10:18:28
|
||||
*/
|
||||
@Mapper
|
||||
public interface ExamineTaskDao {
|
||||
public interface ExamineTaskMapper {
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
|
@ -1,7 +1,7 @@
|
|||
package tech.unissense.pms.business.examine.task.service.impl;
|
||||
|
||||
import tech.unissense.pms.business.examine.task.domain.ExamineTask;
|
||||
import tech.unissense.pms.business.examine.task.mapper.ExamineTaskDao;
|
||||
import tech.unissense.pms.business.examine.task.mapper.ExamineTaskMapper;
|
||||
import tech.unissense.pms.business.examine.task.service.ExamineTaskService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
@ -16,7 +16,7 @@ import javax.annotation.Resource;
|
|||
@Service("examineTaskService")
|
||||
public class ExamineTaskServiceImpl implements ExamineTaskService {
|
||||
@Resource
|
||||
private ExamineTaskDao examineTaskDao;
|
||||
private ExamineTaskMapper examineTaskMapper;
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
|
@ -26,7 +26,7 @@ public class ExamineTaskServiceImpl implements ExamineTaskService {
|
|||
*/
|
||||
@Override
|
||||
public ExamineTask queryById(Integer id) {
|
||||
return this.examineTaskDao.queryById(id);
|
||||
return this.examineTaskMapper.queryById(id);
|
||||
}
|
||||
|
||||
|
||||
|
@ -39,7 +39,7 @@ public class ExamineTaskServiceImpl implements ExamineTaskService {
|
|||
*/
|
||||
@Override
|
||||
public ExamineTask insert(ExamineTask examineTask) {
|
||||
this.examineTaskDao.insert(examineTask);
|
||||
this.examineTaskMapper.insert(examineTask);
|
||||
return examineTask;
|
||||
}
|
||||
|
||||
|
@ -51,7 +51,7 @@ public class ExamineTaskServiceImpl implements ExamineTaskService {
|
|||
*/
|
||||
@Override
|
||||
public ExamineTask update(ExamineTask examineTask) {
|
||||
this.examineTaskDao.update(examineTask);
|
||||
this.examineTaskMapper.update(examineTask);
|
||||
return this.queryById(examineTask.getId());
|
||||
}
|
||||
|
||||
|
@ -63,6 +63,6 @@ public class ExamineTaskServiceImpl implements ExamineTaskService {
|
|||
*/
|
||||
@Override
|
||||
public boolean deleteById(Integer id) {
|
||||
return this.examineTaskDao.deleteById(id) > 0;
|
||||
return this.examineTaskMapper.deleteById(id) > 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,6 +35,14 @@ public class ExamineUser implements Serializable {
|
|||
* 主管评分(权重计算后)
|
||||
*/
|
||||
private Integer manageScore;
|
||||
/**
|
||||
* 个人评分状态 0:待完成 1:已完成
|
||||
*/
|
||||
private String examineStatusSelf;
|
||||
/**
|
||||
* 主管评分状态 0:待完成 1:已完成
|
||||
*/
|
||||
private String examineStatus;
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@ package tech.unissense.pms.business.examine.user.mapper;
|
|||
import org.apache.ibatis.annotations.Mapper;
|
||||
import tech.unissense.pms.business.examine.user.domain.ExamineUser;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -14,7 +13,7 @@ import java.util.List;
|
|||
* @since 2025-01-02 10:18:52
|
||||
*/
|
||||
@Mapper
|
||||
public interface ExamineUserDao {
|
||||
public interface ExamineUserMapper {
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
|
@ -24,15 +23,6 @@ public interface ExamineUserDao {
|
|||
*/
|
||||
ExamineUser queryById(Integer id);
|
||||
|
||||
/**
|
||||
* 查询指定行数据
|
||||
*
|
||||
* @param examineUser 查询条件
|
||||
* @param pageable 分页对象
|
||||
* @return 对象列表
|
||||
*/
|
||||
List<ExamineUser> queryAllByLimit(ExamineUser examineUser, @Param("pageable") Pageable pageable);
|
||||
|
||||
/**
|
||||
* 统计总行数
|
||||
*
|
||||
|
@ -82,5 +72,6 @@ public interface ExamineUserDao {
|
|||
*/
|
||||
int deleteById(Integer id);
|
||||
|
||||
List<ExamineUser> list(ExamineUser examineUser);
|
||||
}
|
||||
|
|
@ -4,6 +4,8 @@ import tech.unissense.pms.business.examine.user.domain.ExamineUser;
|
|||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 考核人员表(ExamineUser)表服务接口
|
||||
*
|
||||
|
@ -45,4 +47,5 @@ public interface ExamineUserService {
|
|||
*/
|
||||
boolean deleteById(Integer id);
|
||||
|
||||
List<ExamineUser> list(ExamineUser examineUser);
|
||||
}
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
package tech.unissense.pms.business.examine.user.service.impl;
|
||||
|
||||
import tech.unissense.pms.business.examine.user.domain.ExamineUser;
|
||||
import tech.unissense.pms.business.examine.user.mapper.ExamineUserDao;
|
||||
import tech.unissense.pms.business.examine.user.mapper.ExamineUserMapper;
|
||||
import tech.unissense.pms.business.examine.user.service.ExamineUserService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 考核人员表(ExamineUser)表服务实现类
|
||||
|
@ -16,7 +17,7 @@ import javax.annotation.Resource;
|
|||
@Service("examineUserService")
|
||||
public class ExamineUserServiceImpl implements ExamineUserService {
|
||||
@Resource
|
||||
private ExamineUserDao examineUserDao;
|
||||
private ExamineUserMapper examineUserMapper;
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
|
@ -26,7 +27,7 @@ public class ExamineUserServiceImpl implements ExamineUserService {
|
|||
*/
|
||||
@Override
|
||||
public ExamineUser queryById(Integer id) {
|
||||
return this.examineUserDao.queryById(id);
|
||||
return this.examineUserMapper.queryById(id);
|
||||
}
|
||||
|
||||
|
||||
|
@ -39,7 +40,7 @@ public class ExamineUserServiceImpl implements ExamineUserService {
|
|||
*/
|
||||
@Override
|
||||
public ExamineUser insert(ExamineUser examineUser) {
|
||||
this.examineUserDao.insert(examineUser);
|
||||
this.examineUserMapper.insert(examineUser);
|
||||
return examineUser;
|
||||
}
|
||||
|
||||
|
@ -51,7 +52,7 @@ public class ExamineUserServiceImpl implements ExamineUserService {
|
|||
*/
|
||||
@Override
|
||||
public ExamineUser update(ExamineUser examineUser) {
|
||||
this.examineUserDao.update(examineUser);
|
||||
this.examineUserMapper.update(examineUser);
|
||||
return this.queryById(examineUser.getId());
|
||||
}
|
||||
|
||||
|
@ -63,6 +64,11 @@ public class ExamineUserServiceImpl implements ExamineUserService {
|
|||
*/
|
||||
@Override
|
||||
public boolean deleteById(Integer id) {
|
||||
return this.examineUserDao.deleteById(id) > 0;
|
||||
return this.examineUserMapper.deleteById(id) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ExamineUser> list(ExamineUser examineUser) {
|
||||
return examineUserMapper.list(examineUser);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +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="tech.unissense.pms.business.examine.config.mapper.ExamineConfigDao">
|
||||
<mapper namespace="tech.unissense.pms.business.examine.config.mapper.ExamineConfigMapper">
|
||||
|
||||
<resultMap type="tech.unissense.pms.business.examine.config.domain.ExamineConfig" id="ExamineConfigMap">
|
||||
<result property="id" column="id" jdbcType="INTEGER"/>
|
|
@ -1,6 +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="tech.unissense.pms.business.examine.detail.mapper.ExamineDetailDao">
|
||||
<mapper namespace="tech.unissense.pms.business.examine.detail.mapper.ExamineDetailMapper">
|
||||
|
||||
<resultMap type="tech.unissense.pms.business.examine.detail.domain.ExamineDetail" id="ExamineDetailMap">
|
||||
<result property="id" column="id" jdbcType="INTEGER"/>
|
|
@ -1,6 +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="tech.unissense.pms.business.examine.task.mapper.ExamineTaskDao">
|
||||
<mapper namespace="tech.unissense.pms.business.examine.task.mapper.ExamineTaskMapper">
|
||||
|
||||
<resultMap type="tech.unissense.pms.business.examine.task.domain.ExamineTask" id="ExamineTaskMap">
|
||||
<result property="id" column="id" jdbcType="INTEGER"/>
|
|
@ -1,6 +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="tech.unissense.pms.business.examine.user.mapper.ExamineUserDao">
|
||||
<mapper namespace="tech.unissense.pms.business.examine.user.mapper.ExamineUserMapper">
|
||||
|
||||
<resultMap type="tech.unissense.pms.business.examine.user.domain.ExamineUser" id="ExamineUserMap">
|
||||
<result property="id" column="id" jdbcType="INTEGER"/>
|
||||
|
@ -9,47 +9,29 @@
|
|||
<result property="score" column="score" jdbcType="INTEGER"/>
|
||||
<result property="judgeContent" column="judge_content" jdbcType="VARCHAR"/>
|
||||
<result property="manageScore" column="manage_score" jdbcType="INTEGER"/>
|
||||
<result property="examineStatus" column="examine_status" jdbcType="VARCHAR"/>
|
||||
<result property="examineStatusSelf" column="examine_status_self" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
|
||||
<!--查询单个-->
|
||||
<select id="queryById" resultMap="ExamineUserMap">
|
||||
<sql id="base_query">
|
||||
select id,
|
||||
task_id,
|
||||
user_id,
|
||||
score,
|
||||
judge_content,
|
||||
manage_score
|
||||
manage_score,
|
||||
examine_status,
|
||||
examine_status_self
|
||||
from pms_examine_user
|
||||
|
||||
</sql>
|
||||
<!--查询单个-->
|
||||
<select id="queryById" resultMap="ExamineUserMap">
|
||||
<include refid="base_query"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<!--查询指定行数据-->
|
||||
<select id="queryAllByLimit" resultMap="ExamineUserMap">
|
||||
select
|
||||
id, task_id, user_id, score, judge_content, manage_score
|
||||
from pms_examine_user
|
||||
<where>
|
||||
<if test="id != null">
|
||||
and id = #{id}
|
||||
</if>
|
||||
<if test="taskId != null">
|
||||
and task_id = #{taskId}
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
and user_id = #{userId}
|
||||
</if>
|
||||
<if test="score != null">
|
||||
and score = #{score}
|
||||
</if>
|
||||
<if test="judgeContent != null and judgeContent != ''">
|
||||
and judge_content = #{judgeContent}
|
||||
</if>
|
||||
<if test="manageScore != null">
|
||||
and manage_score = #{manageScore}
|
||||
</if>
|
||||
</where>
|
||||
limit #{pageable.offset}, #{pageable.pageSize}
|
||||
</select>
|
||||
|
||||
|
||||
<!--统计总行数-->
|
||||
<select id="count" resultType="java.lang.Long">
|
||||
|
@ -76,6 +58,35 @@
|
|||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="list" resultMap="ExamineUserMap">
|
||||
<include refid="base_query"/>
|
||||
<where>
|
||||
<if test="id != null">
|
||||
and id = #{id}
|
||||
</if>
|
||||
<if test="taskId != null">
|
||||
and task_id = #{taskId}
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
and user_id = #{userId}
|
||||
</if>
|
||||
<if test="score != null">
|
||||
and score = #{score}
|
||||
</if>
|
||||
<if test="judgeContent != null and judgeContent != ''">
|
||||
and judge_content = #{judgeContent}
|
||||
</if>
|
||||
<if test="manageScore != null">
|
||||
and manage_score = #{manageScore}
|
||||
</if>
|
||||
<if test="examineStatus != null and examineStatus != ''">
|
||||
and examine_status = #{examineStatus}
|
||||
</if>
|
||||
<if test="examineStatusSelf != null and examineStatusSelf != ''">
|
||||
and examine_status_self = #{examineStatusSelf}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!--新增所有列-->
|
||||
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
Loading…
Reference in New Issue