<?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.yiboshi.science.dao.ComExpertDAO"> <sql id="allColumns"> t.id as id, t.expert_id as expertId, t.spec_id as specId, t.created as created, t.updated as updated </sql> <select id="getListByPage" resultType="com.yiboshi.science.param.dto.ComExpertDTO"> SELECT distinct a.*,e.person_name,e.sex,e.cert_id,e.mobile,e.email,e.unit_id,e.work_unit,e.person_state,e.degree, d.unit_name,d.unit_type,g.name nation_name,h.name education_name, i.name title_name,f.username,f.password,f.id user_id,l.id user_role_id,l.state, (case l.state when 1 then '启用' else '停用' end) state_name FROM com_expert a LEFT JOIN com_person e ON a.person_id = e.id LEFT JOIN com_unit d ON e.unit_id = d.id LEFT JOIN system_user f ON f.person_id = e.id LEFT JOIN system_user_role l ON l.user_id = f.id left join system_parameter g on e.nation=g.id and g.type_id=11 left join system_parameter h on e.education=h.id and h.type_id=8 left join system_parameter i on e.title=i.id and i.type_id=7 left join com_expert_spec p on a.id=p.expert_id left join system_parameter j on p.spec_id=j.id left join system_parameter k on j.parent_id = k.id left join system_parameter m on k.parent_id = m.id <where> ${ew.sqlSegment} </where> ORDER BY a.report_state ASC,d.tree_code ASC,e.person_name desc </select> <select id="getEcaluationStatisticListByPage" resultType="com.yiboshi.science.param.dto.ComExpertDTO"> SELECT a.id, e.person_name,e.cert_id,e.mobile,e.email,e.unit_id,e.work_unit,d.unit_name,d.unit_type,i.name title_name,f.username,f.password, g.group_year, (select count(*) from com_project_group_detail where group_id = b.group_id) as projectCount FROM com_expert a left join com_project_group_assign b on a.id = b.expert_id left join com_project_group g on b.group_id = g.id left join com_person e on a.person_id = e.id left join com_unit d on e.unit_id = d.id left join system_user f on f.person_id = e.id left join system_parameter i on e.title=i.id and i.type_id=7 left join com_expert_spec p on a.id=p.expert_id left join system_parameter j on p.spec_id=j.id left join system_parameter k on j.parent_id = k.id left join system_parameter m on k.parent_id = m.id <where> ${ew.sqlSegment} </where> group by a.id, g.group_year </select> <select id="getExpertById" parameterType="java.lang.String" resultType="com.yiboshi.science.param.dto.ComExpertDTO"> SELECT x.*,a.person_name,a.cert_id,a.sex,a.birthday,a.mobile,a.email,a.education,a.title,a.unit_id,a.work_unit,a.degree ,b.tree_code,b.unit_name,d.name education_name,e.name title_name,f.name degree_name FROM com_expert x LEFT JOIN com_person a ON x.person_id = a.id LEFT JOIN com_unit b ON a.unit_id = b.id left join system_parameter d on a.education=d.id and d.type_id=8 left join system_parameter e on a.title=e.id and e.type_id=7 left join system_parameter f on a.degree=f.id and f.type_id=9 where x.id = #{id} </select> <select id="getExpertByCertId" parameterType="java.lang.String" resultType="com.yiboshi.science.param.dto.ComExpertDTO"> SELECT x.*,a.person_name,a.cert_id,a.sex,a.birthday,a.mobile,a.email,a.title,a.work_unit,a.degree,a.spec,a.address FROM com_expert x LEFT JOIN com_person a ON x.person_id = a.id where a.cert_id = #{certId} </select> <select id="getExpertListByIdList" resultType="com.yiboshi.science.param.dto.ComExpertDTO"> select a.id,c.person_name from com_expert a left join com_person c on a.person_id=c.id <where> ${ew.sqlSegment} </where> </select> </mapper>