| | |
| | | </select> |
| | | |
| | | <!--根据村ID获取全部地址--> |
| | | <select id="getNameById" resultType="java.lang.String"> |
| | | select name |
| | | from pr_intake |
| | | where id = #{intakeId, jdbcType=BIGINT} |
| | | </select> |
| | | |
| | | <!--根据村ID获取全部地址--> |
| | | <select id="getAddressByVillageId" parameterType="_long" resultType="java.lang.String"> |
| | | select CONCAT(dis_province.`name`, dis_city.`name`, dis_county.`name`, dis_town.`name`, |
| | | dis_village.`name`) AS address |
| | |
| | | inta.name AS intakeNum, |
| | | inta.lng, |
| | | inta.lat, |
| | | IFNULL(hou.instant_amount, 0) AS instantAmount, |
| | | IFNULL(hou.total_amount, 0) AS totalAmount, |
| | | <if test="onLineMap != null and onLineMap !='' and isOnLine != null"> |
| | | rtus.isOnLine, |
| | |
| | | WHERE id != #{id} |
| | | and `name` = #{intakeName} |
| | | </select> |
| | | <!--app修改取水口经纬度--> |
| | | <update id="updateByPrimaryKeySelective1" parameterType="com.dy.pipIrrGlobal.voPr.IntakeUpdateLngLat"> |
| | | <!--@mbg.generated--> |
| | | update pr_intake |
| | | <set> |
| | | <if test="lng != null"> |
| | | lng = #{lng,jdbcType=DOUBLE}, |
| | | </if> |
| | | <if test="lat != null"> |
| | | lat = #{lat,jdbcType=DOUBLE}, |
| | | </if> |
| | | <if test="operator != null"> |
| | | `operator` = #{operator,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="operateDt != null"> |
| | | operateDt = #{operateDt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | <!--获取未绑定到轮灌组的取水口列表--> |
| | | <select id="getFreeIntakes" resultType="com.dy.pipIrrGlobal.voPr.VoIntakeSimple"> |
| | | SELECT |
| | | id AS intakeId, |
| | | name AS intakeName |
| | | FROM pr_intake inta |
| | | <where> |
| | | AND inta.deleted = 0 |
| | | AND NOT EXISTS (SELECT 1 FROM ir_group_intake gi WHERE gi.intake_id = inta.id) |
| | | <if test="intakeName != null and intakeName != ''"> |
| | | AND LOWER(inta.name) LIKE CONCAT('%', #{intakeName}, '%') |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <!--获取未绑定虚拟卡的取水口列表,给取水口绑虚拟卡使用--> |
| | | <select id="getNotLinkVcIntakes" resultType="com.dy.pipIrrGlobal.voPr.VoIntakeSimple"> |
| | | SELECT |
| | | id AS intakeId, |
| | | name AS intakeName |
| | | FROM pr_intake inta |
| | | WHERE NOT EXISTS ( |
| | | SELECT 1 |
| | | FROM pr_intake_vc iv |
| | | WHERE iv.intake_id = inta.id |
| | | ) AND inta.deleted = 0 |
| | | </select> |
| | | </mapper> |