北京经济技术开发区经开区虚拟城市项目-【后端】-服务,Poi,企业,地块等定制接口
1
13693261870
2023-10-06 120136539788c9bc347d35c80de2cb93f35469ed
1
已添加2个文件
已修改3个文件
113 ■■■■ 文件已修改
src/main/java/com/smartearth/poiexcel/config/InitConfig.java 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/smartearth/poiexcel/entity/EntEntity.java 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/smartearth/poiexcel/mapper/QiYeMapper.java 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/application.properties 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/QiYeMapper.xml 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/smartearth/poiexcel/config/InitConfig.java
@@ -3,11 +3,9 @@
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.smartearth.poiexcel.entity.EntEntity;
import com.smartearth.poiexcel.entity.EntResult;
import com.smartearth.poiexcel.entity.Result;
import com.smartearth.poiexcel.entity.TokenResult;
import com.smartearth.poiexcel.entity.*;
import com.smartearth.poiexcel.mapper.EntMapper;
import com.smartearth.poiexcel.mapper.QiYeMapper;
import com.smartearth.poiexcel.service.EntService;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -30,6 +28,9 @@
    @Resource
    EntMapper entMapper;
    @Resource
    QiYeMapper qiYeMapper;
    private final static Log log = LogFactory.getLog(InitConfig.class);
    @Override
@@ -48,7 +49,16 @@
     * æµ‹è¯•
     */
    private void test() {
        List<EntEntity> list = entMapper.selectList(new QueryWrapper<>());
        int count = qiYeMapper.selectCount();
        int pages = (count - 1) / StaticData.I100 + 1;
        int pageSize = 2, pageIndex = 1;
        List<EntEntity> list = qiYeMapper.selectByPage(pageSize, pageSize * (pageIndex - 1));
        list.get(0).setX(119.0);
        list.get(0).setY(39.0);
        //qiYeMapper.update(list.get(0));
        int cc = qiYeMapper.updates(list);
        // List<EntEntity> list = entMapper.selectList(new QueryWrapper<>())
        String tokenJson = "{\"success\":true,\"code\":200,\"message\":\"成功\",\"data\":{\"ctoken\":\"ZmYxZTgyN2QxZTYyNDMxMDhjZjgzNDNiNDZiN2RjMDVAYTc3ZmFlOGE5ZGM0OGQ1Y2ZmODY4ZTFmNWYwZTEzM2E=\",\"userInfo\":{\"loginLogId\":\"1ab1675c3632428a84dc0ebe579cd66f\",\"phoneNumber\":\"\",\"displayName\":\"时空一张图\",\"userMail\":\"\",\"departLevel\":\"5-1\",\"id\":\"ff1e827d1e6243108cf8343b46b7dc05\",\"userID\":\"shikong001\",\"uniqueID\":\"\",\"departName\":\"汽车和智能制造产业专班\"},\"expires\":3600,\"roles\":[]}}";
        Result rsToken = JSON.parseObject(tokenJson, Result.class);
src/main/java/com/smartearth/poiexcel/entity/EntEntity.java
@@ -29,9 +29,9 @@
    private String fingerId;
    private Integer regCapital;
    private String regCapital;
    private Integer regCapitalCNY;
    private String regCapitalCNY;
    private String legalPerson;
@@ -58,7 +58,7 @@
    public EntEntity() {
    }
    public EntEntity(String entName, String fingerId, Integer regCapital, Integer regCapitalCNY, String legalPerson, String address, Date buildDate, String entType, String industryCategory, String businessScope, String qylabel, String creator, Double x, Double y, String enterprise_area) {
    public EntEntity(String entName, String fingerId, String regCapital, String regCapitalCNY, String legalPerson, String address, Date buildDate, String entType, String industryCategory, String businessScope, String qylabel, String creator, Double x, Double y, String enterprise_area) {
        this.entName = entName;
        this.fingerId = fingerId;
        this.regCapital = regCapital;
@@ -100,19 +100,19 @@
        this.fingerId = fingerId;
    }
    public Integer getRegCapital() {
    public String getRegCapital() {
        return regCapital;
    }
    public void setRegCapital(Integer regCapital) {
    public void setRegCapital(String regCapital) {
        this.regCapital = regCapital;
    }
    public Integer getRegCapitalCNY() {
    public String getRegCapitalCNY() {
        return regCapitalCNY;
    }
    public void setRegCapitalCNY(Integer regCapitalCNY) {
    public void setRegCapitalCNY(String regCapitalCNY) {
        this.regCapitalCNY = regCapitalCNY;
    }
src/main/java/com/smartearth/poiexcel/mapper/QiYeMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,48 @@
package com.smartearth.poiexcel.mapper;
import com.smartearth.poiexcel.entity.EntEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
 * ä¼ä¸šMapper
 * @author WWW
 */
@Mapper
@Repository
public interface QiYeMapper {
    /**
     * æŸ¥è¯¢è¡Œæ•°
     *
     * @return
     */
    public Integer selectCount();
    /**
     * åˆ†é¡µæŸ¥è¯¢
     *
     * @param limit
     * @param offset
     * @return
     */
    public List<EntEntity> selectByPage(@Param("limit") Integer limit, @Param("offset") Integer offset);
    /**
     * æ›´æ–°ä¸€æ¡
     *
     * @param entity
     * @return
     */
    public Integer update(EntEntity entity);
    /**
     * æ›´æ–°å¤šæ¡
     *
     * @param list
     * @return
     */
    public Integer updates(List<EntEntity> list);
}
src/main/resources/application.properties
@@ -9,7 +9,7 @@
# æ•°æ®æºé…ç½®
spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/smart_earth?useUnicode=true&rewriteBatchedStatements=true&characterEncoding=utf-8&useSSL=true&serverTimezone=GMT%2B8
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/smart_earth?allowMultiQueries=true&useUnicode=true&rewriteBatchedStatements=true&characterEncoding=utf-8&useSSL=true&serverTimezone=GMT%2B8
spring.datasource.username=root
spring.datasource.password=mysql
src/main/resources/mapper/QiYeMapper.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.smartearth.poiexcel.mapper.QiYeMapper">
    <select id="selectCount" resultType="java.lang.Integer">
        select count(*)
        from smart_earth.yz_qiyexinxi
        where x is null or y is null;
    </select>
    <select id="selectByPage" resultType="com.smartearth.poiexcel.entity.EntEntity">
        select *
        from smart_earth.yz_qiyexinxi
        where x is null or y
        order by id
        limit #{limit} offset #{offset};
    </select>
    <update id="update">
        update smart_earth.yz_qiyexinxi
        set x=#{x},y=#{y}
        where id=#{id};
    </update>
    <update id="updates">
        <foreach collection="list" item="item" index="index">
            update smart_earth.yz_qiyexinxi set x=#{item.x},y=#{item.y} where id=#{item.id};
        </foreach>
    </update>
</mapper>