智慧农业后台管理
guoshilong
2022-07-21 f6d0e3738bba6c4651249c3a934893f2376e02cf
src/main/java/org/springblade/modules/farm/mapper/FarmMapper.xml
@@ -18,6 +18,30 @@
        <if test="farm.farmName!=null and farm.farmName!=''">
            and farm_name like concat('%',#{farm.farmName},'%')
        </if>
        <if test="farm.deptId!=null and farm.deptId!=''">
            and dept_id = #{farm.deptId}
        </if>
    </select>
    <!--自定义查询农场列表数据(不分页)-->
    <select id="getFarmList" resultType="org.springblade.modules.farm.vo.FarmVO">
        select id,
               farm_name,
               farm_address,
               farm_area,
               slogan,
               introduce,
               picture,
               ST_ASTEXT(position) as position
        from
            sys_farm
        where 1=1
        <if test="farm.farmName!=null and farm.farmName!=''">
            and farm_name like concat('%',#{farm.farmName},'%')
        </if>
        <if test="farm.deptId!=null and farm.deptId!=''">
            and dept_id = #{farm.deptId}
        </if>
    </select>
    <!--自定义修改农场围栏数据-->
@@ -28,6 +52,9 @@
        slogan = #{farm.slogan},
        introduce = #{farm.introduce},
        picture = #{farm.picture},
        province = #{farm.province},
        city = #{farm.city},
        district = #{farm.district},
        <if test="farm.position!=null and farm.position!=''">
            position = ST_GeomFromText(${farm.position}),
        </if>
@@ -45,7 +72,7 @@
                ST_GeomFromText(${farm.position}),
            </when>
            <otherwise>
                '',
                null,
            </otherwise>
        </choose>
        #{farm.createTime},#{farm.updateTime},#{farm.deptId})
@@ -60,6 +87,9 @@
               slogan,
               introduce,
               picture,
               province,
               city,
               district,
               ST_ASTEXT(position) as position,dept_id
        from
            sys_farm