|  |  |  | 
|---|
|  |  |  | INNER JOIN pr_intake inta ON con.intakeId = inta.id | 
|---|
|  |  |  | <where> | 
|---|
|  |  |  | AND ic.operateType = 1 | 
|---|
|  |  |  | AND deleted = 0 | 
|---|
|  |  |  | AND con.deleted = 0 | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <if test = "id != null and id > 0"> | 
|---|
|  |  |  | AND con.id = ${id} | 
|---|
|  |  |  | 
|---|
|  |  |  | <!--根据指定条件获取控制器记录--> | 
|---|
|  |  |  | <select id="getControllers" resultType="com.dy.pipIrrGlobal.voPr.VoController"> | 
|---|
|  |  |  | SELECT | 
|---|
|  |  |  | CAST(con.id AS char) AS id, | 
|---|
|  |  |  | con.rtuAddr AS rtuAddr, | 
|---|
|  |  |  | inta.name AS intakeName, | 
|---|
|  |  |  | (SELECT COUNT(*) FROM pr_intake_controller WHERE controllerId = con.id AND intakeId = inta.id AND operateType = 1) AS bindNumber, | 
|---|
|  |  |  | 
|---|
|  |  |  | INNER JOIN pr_intake inta ON con.intakeId = inta.id | 
|---|
|  |  |  | <where> | 
|---|
|  |  |  | AND ic.operateType = 1 | 
|---|
|  |  |  | AND deleted = 0 | 
|---|
|  |  |  | AND con.deleted = 0 | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <if test = "id != null and id > 0"> | 
|---|
|  |  |  | AND con.id = ${id} | 
|---|
|  |  |  | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | </where> | 
|---|
|  |  |  | ORDER BY con.operateDt DESC | 
|---|
|  |  |  | <if test="pageCurr != null and pageSize != null"> | 
|---|
|  |  |  | LIMIT ${pageCurr}, ${pageSize} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <trim prefix="limit " > | 
|---|
|  |  |  | <if test="start != null and count != null"> | 
|---|
|  |  |  | #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | </trim> | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <!--根据控制器地址获取控制器列表--> | 
|---|