|  |  |  | 
|---|
|  |  |  | left join ir_project pro on pro.id = gro.project_id | 
|---|
|  |  |  | left join se_client cli on cli.id = gro.operator | 
|---|
|  |  |  | left join ir_group_unit gu on gu.group_id = gro.id | 
|---|
|  |  |  | where gro.id = #{id,jdbcType=BIGINT} and gro.deleted = 0 and gu.deleted = 0 and pro.deleted = 0 | 
|---|
|  |  |  | where gro.id = #{id,jdbcType=BIGINT} and gro.deleted = 0  and pro.deleted != 1 | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <!--分页查轮灌组--> | 
|---|
|  |  |  | 
|---|
|  |  |  | left join se_client cli on cli.id = gro.operator | 
|---|
|  |  |  | left join ir_group_unit gu on gu.group_id = gro.id | 
|---|
|  |  |  | <where> | 
|---|
|  |  |  | gro.deleted = 0 and gu.deleted = 0 and pro.deleted = 0 | 
|---|
|  |  |  | gro.deleted = 0  and pro.deleted != 1 | 
|---|
|  |  |  | <if test="projectName != null and projectName != ''"> | 
|---|
|  |  |  | AND pro.project_name LIKE CONCAT('%', #{projectName}, '%') | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | 
|---|
|  |  |  | AND gro.group_code = #{groupCode} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | </where> | 
|---|
|  |  |  | GROUP BY gro.id | 
|---|
|  |  |  | ORDER BY gro.operate_time DESC | 
|---|
|  |  |  | <if test="pageCurr != null and pageSize != null"> | 
|---|
|  |  |  | LIMIT ${(pageCurr-1)*pageSize}, ${pageSize} | 
|---|
|  |  |  | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  | <!--分页查轮灌组记录数--> | 
|---|
|  |  |  | <select id="getRecordCount" resultType="java.lang.Long"> | 
|---|
|  |  |  | SELECT COUNT(*) AS recordCount | 
|---|
|  |  |  | SELECT COUNT(*) FROM( | 
|---|
|  |  |  | SELECT COUNT(*),gro.id AS recordCount | 
|---|
|  |  |  | from ir_irrigate_group gro | 
|---|
|  |  |  | left join ir_project pro on pro.id = gro.project_id | 
|---|
|  |  |  | left join se_client cli on cli.id = gro.operator | 
|---|
|  |  |  | left join ir_group_unit gu on gu.group_id = gro.id | 
|---|
|  |  |  | <where> | 
|---|
|  |  |  | gro.deleted = 0 and gu.deleted = 0 and pro.deleted = 0 | 
|---|
|  |  |  | gro.deleted = 0  and pro.deleted != 1 | 
|---|
|  |  |  | <if test="projectName != null and projectName != ''"> | 
|---|
|  |  |  | AND pro.project_name LIKE CONCAT('%', #{projectName}, '%') | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | 
|---|
|  |  |  | AND gro.group_code = #{groupCode} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | </where> | 
|---|
|  |  |  | GROUP BY gro.id | 
|---|
|  |  |  | ) a | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <!--根据轮灌组编号获取取水口列表--> | 
|---|
|  |  |  | <select id="getIntakesByGroupId" resultType="java.lang.Long"> | 
|---|
|  |  |  | SELECT | 
|---|
|  |  |  | uni.intake_id AS intakeId | 
|---|
|  |  |  | FROM ir_irrigate_group grp | 
|---|
|  |  |  | INNER JOIN ir_group_unit gu ON gu.group_id = grp.id | 
|---|
|  |  |  | INNER JOIN ir_irrigate_unit uni ON uni.id = gu.unit_id | 
|---|
|  |  |  | WHERE grp.deleted = 0 AND grp.id = #{groupId} | 
|---|
|  |  |  |  | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  | </mapper> | 
|---|