| | |
| | | <select id="projectList" resultMap="projectResult"> |
| | | <include refid="selectProjectVo"/> |
| | | <if test="params.personId != null and params.personId != ''"> |
| | | left join ass_plan_person a on a.project_id=p.id |
| | | left join ass_plan_person pp on pp.project_id=p.id |
| | | </if> |
| | | <if test="params.lostMaterial != null"> |
| | | left join ass_project_material m on m.project_id=p.id |
| | | </if> |
| | | <where> |
| | | and p.del_flag = 0 |
| | | <if test="safetyCheck != null and safetyCheck == 0"> |
| | | and p.estimate_type != 33 |
| | | </if> |
| | | <if test="safetyCheck != null and safetyCheck == 1"> |
| | | and p.estimate_type = 33 |
| | | </if> |
| | | <if test="unFinish != null and unFinish == 1"> |
| | | and p.report_progress != 14 |
| | | </if> |
| | | <if test="agencyName != null and agencyName != ''"> |
| | | and a.name=#{agencyName} |
| | | </if> |
| | | <if test="name != null and name != ''"> |
| | | AND p.name like concat('%', #{name}, '%') |
| | | </if> |
| | |
| | | and date_format(p.create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d') |
| | | </if> |
| | | <if test="params.personId != null and params.personId != ''"> |
| | | and a.person_id=#{params.personId} and a.del_flag=0 |
| | | and pp.person_id=#{params.personId} and pp.del_flag=0 |
| | | </if> |
| | | <if test="params.lostMaterial != null and params.lostMaterial==1"> |
| | | and (m.file_id is null) |
| | |
| | | |
| | | <select id="getProjectByName" resultType="com.gkhy.assess.system.domain.AssProject"> |
| | | select id,name from ass_project |
| | | where name=#{name} |
| | | where name=#{name} and agency_id=#{agencyId} and del_flag=0 |
| | | <if test="safetyCheck != null and safetyCheck == 0"> |
| | | and estimate_type != 33 |
| | | </if> |
| | | <if test="safetyCheck != null and safetyCheck == 1"> |
| | | and estimate_type = 33 |
| | | </if> |
| | | limit 1 |
| | | </select> |
| | | |
| | | <select id="getReportProgress" resultType="java.lang.Integer"> |
| | | select report_progress from ass_project |
| | | where id=#{projectId} |
| | | </select> |
| | | |
| | | <!--a.id as plan_person_id, sql字段无用 增加后组件分页查询数量有问题--> |
| | | <select id="getMemberProjectByUserId" resultMap="projectResult"> |
| | | select p.id,p.name,p.report_progress,p.code,p.client,p.province,p.city,p.district,p.business,p.create_time,a.id as plan_person_id, |
| | | select distinct p.id,p.name,p.report_progress,p.code,p.client,p.province,p.city,p.district,p.business,p.create_time, |
| | | e.leader_id,u.name as leader_name |
| | | from ass_project p |
| | | left join ass_plan_person a on a.project_id=p.id |
| | |
| | | </select> |
| | | |
| | | <select id="getLeaderProjectByUserId" resultMap="projectResult"> |
| | | select p.id,p.name,p.report_progress,p.code,p.client,p.province,p.city,p.district,p.business,p.create_time,a.id as plan_person_id, |
| | | select distinct p.id,p.name,p.report_progress,p.code,p.client,p.province,p.city,p.district,p.business,p.create_time,a.id as plan_person_id, |
| | | e.leader_id,u.name as leader_name |
| | | from ass_project p |
| | | left join ass_plan_person a on a.project_id=p.id |
| | |
| | | </select> |
| | | |
| | | <select id="getProjectCount" resultType="java.lang.Integer"> |
| | | select count(distinct p.id) from ass_project p |
| | | select Ifnull(count(distinct p.id),0) from ass_project p |
| | | <if test="params.lostMaterial != null"> |
| | | left join ass_project_material m on m.project_id=p.id |
| | | </if> |
| | | <if test="agencyName != null and agencyName != ''"> |
| | | left join sys_agency a on a.id=p.agency_id |
| | | </if> |
| | | <where> |
| | | and p.del_flag=0 |
| | | <if test="safetyCheck != null and safetyCheck == 0"> |
| | | and p.estimate_type != 33 |
| | | </if> |
| | | <if test="safetyCheck != null and safetyCheck == 1"> |
| | | and p.estimate_type = 33 |
| | | </if> |
| | | <if test="unFinish != null and unFinish == 1"> |
| | | and p.report_progress != 14 |
| | | </if> |
| | | <if test="agencyId!=null and agencyId!=''"> |
| | | and p.agency_id=#{agencyId} |
| | | </if> |
| | | <if test="agencyName != null and agencyName != ''"> |
| | | and a.name=#{agencyName} |
| | | </if> |
| | | <if test="name != null and name != ''"> |
| | | AND p.name like concat('%', #{name}, '%') |
| | |
| | | </select> |
| | | |
| | | <select id="getProjectByPersonIds" resultType="com.gkhy.assess.system.domain.vo.PersonProjectVO"> |
| | | select a.person_id,count(*) as project_count,max(p.create_time) as last_estimate_time from ass_project p |
| | | select d.person_id,count(*) as project_count,max(d.create_time) as last_estimate_time from |
| | | (select a.person_id,a.project_id,max(p.create_time) as create_time from ass_project p |
| | | left join ass_plan_person a on a.project_id=p.id |
| | | where a.del_flag=0 and p.del_flag=0 and a.person_id in |
| | | <foreach collection="personIds" item="personId" open="(" separator="," close=")"> |
| | | #{personId} |
| | | </foreach> |
| | | group by a.person_id |
| | | group by a.person_id,a.project_id) d |
| | | group by d.person_id |
| | | </select> |
| | | |
| | | </mapper> |