| | |
| | | </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> |
| | | <if test="land.farmId!=null and land.farmId != ''"> |
| | | and farm_id =#{land.farmId} |
| | | </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) |
| | | (user_id,land_name,land_type,land_area,land_range,type,land_unit,dept_id,url,farm_id) |
| | | values |
| | | (#{land.userId},#{land.landName},#{land.landType},#{land.landArea}, |
| | | <if test="land.landRange!=null and land.landRange!=''"> |
| | | ST_GeomFromText(${land.landRange}), |
| | | </if> |
| | | #{land.type},#{land.landUnit},#{land.deptId},#{land.url}) |
| | | <choose> |
| | | <when test="land.landRange!=null and land.landRange!=''"> |
| | | ST_GeomFromText(${land.landRange}), |
| | | </when> |
| | | <otherwise> |
| | | null, |
| | | </otherwise> |
| | | </choose> |
| | | #{land.type},#{land.landUnit},#{land.deptId},#{land.url},#{land.farmId}) |
| | | </insert> |
| | | |
| | | <!--详情信息(自定义查询)--> |
| | |
| | | </if> |
| | | type = #{land.type}, |
| | | land_unit = #{land.landUnit}, |
| | | farm_id = #{land.farmId}, |
| | | url = #{land.url}, |
| | | where id = #{land.id} |
| | | </update> |