智慧农业后台管理
Administrator
2022-05-10 32b0c2663c403998bee7a880f48dff6a6ce2bce4
src/main/java/org/springblade/modules/farm/mapper/FarmMapper.xml
@@ -4,7 +4,34 @@
    <!--自定义查询农场分页数据-->
    <select id="selectFarmPage" resultType="org.springblade.modules.farm.vo.FarmVO">
        select * from sys_farm where 1=1
        select
        id,farm_name,farm_address,farm_area,slogan,introduce,picture,ST_ASTEXT(position) as position,user_id
        from
        sys_farm where 1=1
    </select>
    <!--自定义修改电子围栏数据-->
    <update id="updateFarmById">
        update sys_farm set farm_name = #{farm.farmName},
        farm_address = #{farm.farmAddress},
        farm_area = #{farm.farmArea},
        slogan = #{farm.slogan},
        introduce = #{farm.introduce},
        picture = #{farm.picture},
        <if test="farm.position!=null and farm.position!=''">
            position = ST_GeomFromText(${farm.position}),
        </if>
        update_time = #{farm.updateTime}
        where id = #{farm.id}
    </update>
    <!--详情信息(自定义查询)-->
    <select id="getFarmInfo" resultType="org.springblade.modules.farm.vo.FarmVO">
        select
        id,farm_name,farm_address,farm_area,slogan,introduce,picture,ST_ASTEXT(position) as position,user_id
        from
        sys_farm
        where 1=1
        and user_id = #{farm.userId}
    </select>
</mapper>