| | |
| | | import javax.validation.Valid; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | /** |
| | | * 自定义查询所有农场信息(不分页) |
| | | * @param farm |
| | | * @return |
| | | */ |
| | | @GetMapping("/getFarmList") |
| | | public R<List<FarmVO>> getFarmList(FarmVO farm) { |
| | | List<FarmVO> farmList = farmService.getFarmList(farm); |
| | | return R.data(farmList); |
| | | } |
| | | |
| | | /** |
| | | * 新增 |
| | | */ |
| | | @PostMapping("/save") |
| | |
| | | private Date updateTime; |
| | | |
| | | /** |
| | | * 农场id |
| | | * 公司id |
| | | */ |
| | | private String deptId; |
| | | |
| | |
| | | * @return |
| | | */ |
| | | int saveFarmInfo(@Param("farm") Farm farm); |
| | | |
| | | /** |
| | | * 自定义查询所有农场信息(不分页) |
| | | * @param farm |
| | | * @return |
| | | */ |
| | | List<FarmVO> getFarmList(@Param("farm") FarmVO farm); |
| | | } |
| | |
| | | <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> |
| | | |
| | | <!--自定义修改农场围栏数据--> |
| | |
| | | import org.springblade.modules.farm.entity.Farm; |
| | | import org.springblade.modules.farm.vo.FarmVO; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 农场服务类 |
| | | * @since 2022-05-10 |
| | |
| | | * @return |
| | | */ |
| | | boolean saveFarmInfo(Farm farm); |
| | | |
| | | /** |
| | | * 自定义查询所有农场信息(不分页) |
| | | * @param farm |
| | | * @return |
| | | */ |
| | | List<FarmVO> getFarmList(FarmVO farm); |
| | | } |
| | |
| | | import org.springblade.modules.farm.vo.FarmVO; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 农场服务实现类 |
| | | * @since 2022-05-10 |
| | |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 自定义查询所有农场信息(不分页) |
| | | * @param farm |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<FarmVO> getFarmList(FarmVO farm) { |
| | | return baseMapper.getFarmList(farm); |
| | | } |
| | | } |
| | |
| | | |
| | | |
| | | /** |
| | | * 地块列表(不分页) |
| | | * @param land |
| | | * @return |
| | | */ |
| | | @GetMapping("/getLandList") |
| | | public R getLandList(LandVO land) { |
| | | return R.data(landService.getLandList(land)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 首页地块统计接口 |
| | | */ |
| | | @GetMapping("/selectCount") |
| | |
| | | * @return |
| | | */ |
| | | boolean saveLandInfo(@Param("land") Land land); |
| | | |
| | | /** |
| | | * 详情信息(自定义查询) |
| | | * @param land |
| | | * @return |
| | | */ |
| | | Land getLandInfo(@Param("land") LandVO land); |
| | | |
| | | /** |
| | | * 更新地块信息 |
| | | * @param farm |
| | | * @param land |
| | | * @return |
| | | */ |
| | | int updateLandById(@Param("land") Land land); |
| | | |
| | | List selectLandList(String userid); |
| | | |
| | | List selectNum(String deptId); |
| | | |
| | | List<Map<String, Object>> selectZAre(String deptId); |
| | | |
| | | List<Map<String, Object>> selectSAre(String deptId); |
| | | |
| | | List<Map<String, Object>> selectWAre(String deptId); |
| | | |
| | | /** |
| | | * 地块列表(不分页) |
| | | * @param land |
| | | * @return |
| | | */ |
| | | List<LandVO> getLandList(LandVO land); |
| | | } |
| | |
| | | </if> |
| | | </select> |
| | | |
| | | <!--查询地块列表(不分页)--> |
| | | <select id="getLandList" resultType="org.springblade.modules.lang.vo.LandVO"> |
| | | SELECT |
| | | id, |
| | | land_name, |
| | | land_area, |
| | | ST_ASTEXT(land_range) as land_range, |
| | | url |
| | | FROM sys_land |
| | | where is_deleted = 0 |
| | | <if test="land.landType!=null and land.landType != ''"> |
| | | and land_type = #{land.landType} |
| | | </if> |
| | | <if test="land.landName!=null and land.landName != ''"> |
| | | and land_name like concat('%', #{land.landName},'%') |
| | | </if> |
| | | <if test="land.deptId!=null and land.deptId != ''"> |
| | | and dept_id=#{land.deptId} |
| | | </if> |
| | | <if test="land.type!=null and land.type != ''"> |
| | | and type=#{land.type} |
| | | </if> |
| | | <if test="land.tenantId!=null and land.tenantId != ''"> |
| | | and tenant_id =#{land.tenantId} |
| | | </if> |
| | | </select> |
| | | |
| | | <insert id="saveLandInfo"> |
| | | insert into sys_land |
| | | (user_id,land_name,land_type,land_area,land_range,type,land_unit,dept_id,url) |
| | |
| | | List<Map<String, Object>> selectSAre(String deptId); |
| | | List<Map<String, Object>> selectWAre(String deptId); |
| | | List selectNum(String deptId); |
| | | |
| | | /** |
| | | * 地块列表(不分页) |
| | | * @param land |
| | | * @return |
| | | */ |
| | | List<LandVO> getLandList(LandVO land); |
| | | } |
| | |
| | | return baseMapper.selectNum(deptId); |
| | | } |
| | | |
| | | /** |
| | | * 地块列表(不分页) |
| | | * @param land |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<LandVO> getLandList(LandVO land) { |
| | | return baseMapper.getLandList(land); |
| | | } |
| | | } |