Commit 2dd3fed2 authored by 赵啸非's avatar 赵啸非

添加代办员工评价次数

parent 20a4fe85
......@@ -59,9 +59,6 @@ public class H5LoginController extends BaseCRUDJsonBodyMappingController<UserSer
private IAuthTokenService authTokenService;
@Autowired
private CompanyService companyService;
@Autowired
private ResourceService resourceService;
@Autowired
private RoleUserService roleUserService;
......
......@@ -14,4 +14,6 @@ import java.util.List;
public interface StaffDao extends ICRUDDao<StaffEntity,Long>{
Integer getPjTimesByAgent(Long agentUserId);
}
......@@ -4,18 +4,26 @@ package com.mortals.xhx.module.staff.dao.ibatis;
import org.springframework.stereotype.Repository;
import com.mortals.xhx.module.staff.dao.StaffDao;
import com.mortals.xhx.module.staff.model.StaffEntity;
import java.util.Date;
import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis;
import java.util.List;
/**
* 代办帮办人员DaoImpl DAO接口
*
* @author zxfei
* @date 2025-05-08
*/
* 代办帮办人员DaoImpl DAO接口
*
* @author zxfei
* @date 2025-05-08
*/
@Repository("staffDao")
public class StaffDaoImpl extends BaseCRUDDaoMybatis<StaffEntity,Long> implements StaffDao {
public class StaffDaoImpl extends BaseCRUDDaoMybatis<StaffEntity, Long> implements StaffDao {
@Override
public Integer getPjTimesByAgent(Long agentUserId) {
return getSqlSession().selectOne(getSqlId("getPjTimesByAgent"), agentUserId);
}
}
......@@ -20,4 +20,10 @@ public class StaffVo extends BaseEntityLong {
private transient List <Long> idList;
/**
* 累计评价次数
*/
private Integer pjTimes;
}
\ No newline at end of file
......@@ -63,6 +63,17 @@ public class StaffServiceImpl extends AbstractCRUDServiceImpl<StaffDao, StaffEnt
super.saveBefore(entity, context);
}
@Override
protected void findAfter(StaffEntity params, PageInfo pageInfo, Context context, List<StaffEntity> list) throws AppException {
super.findAfter(params, pageInfo, context, list);
list.stream().forEach(item->{
Long userId = item.getUserId();
Integer pjTimesByAgent = dao.getPjTimesByAgent(userId);
item.setPjTimes(pjTimesByAgent);
});
}
@Override
protected void saveAfter(StaffEntity entity, Context context) throws AppException {
//创建用户
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"mybatis-3-mapper.dtd">
<mapper namespace="com.mortals.xhx.module.declare.dao.ibatis.DeclareDaoImpl">
<select id="getPjTimesByAgent" parameterType="Long" resultType="Integer">
SELECT
count( b.score ) AS times
FROM
mortals_agent_declare a
LEFT JOIN mortals_agent_evaluation_info b ON a.id = b.declare_id
WHERE
a.agent_user_id = ${agentUserId}
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment