11 changed files with 223 additions and 152 deletions
@ -0,0 +1,35 @@ |
|||||
|
package com.ccsens.carbasics.bean.vo; |
||||
|
|
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @description: |
||||
|
* @author: whj |
||||
|
* @time: 2021/8/31 11:25 |
||||
|
*/ |
||||
|
public class FirstAidLogVo { |
||||
|
|
||||
|
@ApiModel("参与者") |
||||
|
@Data |
||||
|
public static class JoinMember{ |
||||
|
@ApiModelProperty("急救ID") |
||||
|
private Long firstAidId; |
||||
|
@ApiModelProperty("参与者信息") |
||||
|
private List<Member> doctors; |
||||
|
} |
||||
|
|
||||
|
@ApiModel("参与者-成员") |
||||
|
@Data |
||||
|
public static class Member{ |
||||
|
@ApiModelProperty("日志ID") |
||||
|
private Long id; |
||||
|
@ApiModelProperty("角色 0:分诊护士 1:神内医生 2:神外医生") |
||||
|
private byte role; |
||||
|
@ApiModelProperty("医生名字") |
||||
|
private String name; |
||||
|
} |
||||
|
} |
@ -0,0 +1,22 @@ |
|||||
|
package com.ccsens.carbasics.persist.dao; |
||||
|
|
||||
|
import com.ccsens.carbasics.bean.vo.FirstAidLogVo; |
||||
|
import com.ccsens.carbasics.persist.mapper.FirstAidLogMapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @description: |
||||
|
* @author: whj |
||||
|
* @time: 2021/8/31 11:32 |
||||
|
*/ |
||||
|
public interface FirstAidLogDao extends FirstAidLogMapper { |
||||
|
|
||||
|
/** |
||||
|
* 查询参与急救的医生\护士信息 |
||||
|
* @param firstAidIds 急救列表 |
||||
|
* @return 医生信息 |
||||
|
*/ |
||||
|
List<FirstAidLogVo.JoinMember> queryMember(@Param("firstAidIds") List<Long> firstAidIds); |
||||
|
} |
@ -0,0 +1,35 @@ |
|||||
|
<?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.ccsens.carbasics.persist.dao.FirstAidLogDao"> |
||||
|
|
||||
|
<resultMap id="memberMap" type="com.ccsens.carbasics.bean.vo.FirstAidLogVo$JoinMember"> |
||||
|
<id column="first_aid_id" property="firstAidId"/> |
||||
|
<collection property="doctors" ofType="com.ccsens.carbasics.bean.vo.FirstAidLogVo$Member"> |
||||
|
<id column="id" property="id"/> |
||||
|
<result column="role" property="role"/> |
||||
|
<result column="name" property="name"/> |
||||
|
</collection> |
||||
|
</resultMap> |
||||
|
|
||||
|
|
||||
|
<select id="queryMember" resultMap="memberMap"> |
||||
|
SELECT |
||||
|
l.id, |
||||
|
l.first_aid_id, |
||||
|
l.operation_role as role, |
||||
|
m.name |
||||
|
FROM |
||||
|
t_qcp_first_aid_log l, |
||||
|
t_organization_member m |
||||
|
WHERE |
||||
|
l.operation_user_id = m.user_id |
||||
|
AND l.operation_type IN ( 0, 7 ) |
||||
|
AND l.operation_role IN ( 0, 1, 2 ) |
||||
|
AND l.first_aid_id IN |
||||
|
<foreach collection="firstAidIds" item="id" open="(" close=")" separator=","> |
||||
|
#{id} |
||||
|
</foreach> |
||||
|
AND l.rec_status = 0 |
||||
|
AND m.rec_status = 0 |
||||
|
</select> |
||||
|
</mapper> |
Loading…
Reference in new issue