SpringBoot项目——送水管理系统

news2024/9/22 19:32:09

1、导入坐标

坐标作用
pagehelper-spring-boot-startermybatis分页插件
spring-boot-starter-thymeleafJSP模板引擎
mybatis-spring-boot-startermybatis
spring-boot-starter-webweb
spring-boot-starter-testtest
lombok不需要再写getter、setter或equals方法,只要有一个注解
mybatis-plus-boot-startermybatis plus
druid-spring-boot-starterdruid连接数据库
hutool-allhutool工具类
bootstrap前端
jquery前端
mysql-connector-javamysql

2、配置文件application.yml

# 应用服务 WEB 访问端口
server:
  port: 8080

spring:
  datasource:
    driver-class-name: com.mysql.jdbc.Driver
    url: jdbc:mysql://localhost:3306/minzu?useUnicode=true&characterEncoding=utf8
    username: root
    password: root
    type: com.alibaba.druid.pool.DruidDataSource
    druid:
      min-idle: 5
      max-active: 10
      max-wait: 3000
  thymeleaf:
    prefix: classpath:/templates/water/
    suffix: .html
mybatis-plus:
  configuration:
    map-underscore-to-camel-case: true
    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
  global-config:
    db-config:
      id-type: auto
pagehelper:
  helper-dialect: mysql

3、登录功能

需要tb_account表
在这里插入图片描述
在pojo实体包下创建Account实体类
使用@TableName("tb_account")注解,用于标识实体类对应的数据库表名
在service层提供登录方法,分为接口和接口实现

@Service
public class AccountServiceImpl implements AccountService {

    @Autowired
    //自动注入AccountMapper,AccountMapper继承了BaseMapper<Account>,是mybatisplus接口,有基本的CURD
    private AccountMapper accountMapper;
    @Override
    public boolean login(String user, String password) {
        QueryWrapper<Account> qw = new QueryWrapper<>();
        qw.eq("user_name",user);//精确查找
        Account account = accountMapper.selectOne(qw);//从数据库中选择上面查找到的对象
        if(account == null){
            return false;
        }
        String userPwd = account.getUserPwd();
        //String s = DigestUtil.md5Hex(password);
        //System.out.println(s);
        if(Objects.equals(userPwd,password)){//比较密码
            return true;
        }else{
            return false;
        }
    }
}

登录方法的controller

@Controller
public class AccountController {

    @Autowired
    private AccountService accountService;

    @PostMapping("/login")
    public String login(String userName, String userPwd, Model model, HttpSession session){
        boolean login = accountService.login(userName,userPwd);//接收前端参数userName和userPwd
        if(login){
            session.setAttribute("currentUser",userName);
            return "waterMainMenu";
            //用的thymeleaf,配置文件中已经写好路径与.html,直接跳转
        }else{
            model.addAttribute("msg","用户名或者密码错误");
            return "index";
        }
    }

}

4、主页展示

需要tb_history表
在这里插入图片描述

@RestController
@RequestMapping("main")
public class MainMenuController {
    @Autowired
    private HistoryService historyService;
    @Autowired
    private WorkerService workerService;


    @RequestMapping("mainMenu")
    public List<MainMenu> list(){
        List<MainMenu> list = new ArrayList<>();

        Map<Integer,Integer> map = new HashMap<>();

        historyService.queryHistory().forEach(h -> {//遍历数据库,将对应workerId键放入map中,值为sendWaterCount
            map.put(h.getWorkerId(),map.getOrDefault(h.getWorkerId(),0)+h.getSendWaterCount());
        });

        workerService.queryWorker().forEach(w ->{//遍历数据库中的所有数据,这些数据最后是需要展示的
            //MainMenu中只有WorkerName和SendWaterCount属性
            MainMenu mainMenu = new MainMenu();
            //设置WorkerName
            mainMenu.setWorkerName(w.getWorkerName());
            //设置SendWaterCount
            mainMenu.setSendWaterCount(map.get(w.getWid())==null?0:map.get(w.getWid()));
            list.add((mainMenu));
        });
        //将所有拿到的数据排序,只取前12个
        Collections.sort(list,(o1,o2)->{
            if(o1.getSendWaterCount()>o2.getSendWaterCount()){
                return -1;
            }else if(o1.getSendWaterCount()<o2.getSendWaterCount()){
                return 1;
            }else{
                return 0;
            }
        });

        if(list.size()<12){
            return list;
        }
        List<MainMenu> arrList = new ArrayList<>();
        for(int i=0;i<12;i++){
            arrList.add(list.get(i));
        }
        return arrList;
    }

}

5、客户管理功能模块

需要tb_customer表
在这里插入图片描述
用的是PageInfo<>(listCust)前端展示页面
业务层

@Service
public class CustomerServiceImpl implements CustomerService {

    @Autowired
    //自动注入CustmoerMapper,用于连接操作数据库
    private CustomerMapper customerMapper;

    @Override
    //查询展示所有
    //返回值是一个PageInfo对象,里面放的是从数据库查询到的每个Customer对象
    public PageInfo<Customer> list(Customer customer) {
        QueryWrapper<Customer> qw = new QueryWrapper<>();
        String custName = customer.getCustName();
        String custMobile = customer.getCustMobile();
        if(!StringUtils.isNullOrEmpty(custName)){
            //custName模糊查询
            qw.like("cust_name",custName);
        }
        if(!StringUtils.isNullOrEmpty(custMobile)){
            //custMobile精确查询
            qw.eq("cust_mobile",custMobile);
        }
        //selectList查询多条数据,封装成集合返回
        List<Customer> listCust = customerMapper.selectList(qw);
        return new PageInfo<>(listCust);
    }

    @Override
    //添加
    public int addCust(Customer customer) {
        //调用insert方法
        return customerMapper.insert(customer);
    }


    //删除
    //前端留的接口数据就是cid
    @Override
    public int deleteCust(int id) {
        QueryWrapper<Customer> qw = new QueryWrapper<>();
        qw.eq("cid",id);//精确比较cid,拿到对象
        int delete = customerMapper.delete(qw);//用Mapper中的delete方法从数据中删除上面拿到的qw
        return delete;
    }
}

Controller

@Controller
@RequestMapping("cust")
//前端留的接口就是cust
public class CustomerController {

    @Autowired
    private CustomerService customerService;


    //Customer页面显示
    @RequestMapping("listCust")
    public String list(@RequestParam(required = false,defaultValue = "1",value = "pageNum") Integer pageNum,
                       @RequestParam(required = false,defaultValue = "10",value = "pageSize") Integer pageSize,
                       Model model, Customer customer){
        if(pageNum<=0 || pageNum.equals("")||pageNum==null){
            pageNum = 1;
        }
        if(pageSize<=0 || pageSize.equals("")||pageSize==null){
            pageNum = 10;
        }
        PageHelper.startPage(pageNum,pageSize);
        PageInfo<Customer> pageInfo = customerService.list(customer);
        model.addAttribute("pageInfo",pageInfo);//前端留的pageInfo
        return "customerList";
    }


    //跳转到添加数据页面,有一个单独的custSave.html页面
    @RequestMapping("preSaveCust")
    public String preSave(){
        return "custSave";
    }
    //真正的添加数据页面,保存数据
    @RequestMapping("saveCust")
    public String save(Customer customer){
        int i = customerService.addCust(customer);
        return "redirect:/cust/listCust";
    }

    //删除Customer数据
    @RequestMapping("delCust/{cid}")
    public String deleteCust(@PathVariable int cid){
        int i = customerService.deleteCust(cid);
        return "redirect:/cust/listCust";
    }
}

6、送水工管理模块

需要tb_worker表
在这里插入图片描述
业务层

@Service
public class WorkerServiceImpl implements WorkerService {

    @Autowired
    private WorkerMapper workerMapper;

    @Override
    //查询所有
    public List<Worker> queryWorker() {
        return workerMapper.selectList(null);
    }

    @Override
    //查询所有带分页
    public PageInfo<Worker> list(Worker worker) {
        String workName = worker.getWorkerName();
        QueryWrapper<Worker> qw = new QueryWrapper<>();
        if(!StringUtils.isNullOrEmpty(workName)){
            qw.like("worker_name",workName);
        }
        List<Worker> workers = workerMapper.selectList(qw);
        return new PageInfo<>(workers);
    }

    @Override
    //添加
    public int addWorker(Worker worker) {
        return workerMapper.insert(worker);
    }

    @Override
    public Worker getWorkerById(Integer id) {
        QueryWrapper<Worker> qw = new QueryWrapper<>();
        qw.eq("wid",id);
        Worker worker = workerMapper.selectOne(qw);
        return worker;
    }


    @Override
    //更新
    public int updateWorker(Worker worker) {
        Integer wid = worker.getWid();
        QueryWrapper<Worker> qw = new QueryWrapper<>();
        qw.eq("wid",wid);
        int update = workerMapper.update(worker, qw);
        return update;

    }

    @Override
    //更新薪资
    public int updateSalary(Integer wid, String workerSalary) {
        QueryWrapper<Worker> qw = new QueryWrapper<>();
        qw.eq("wid",wid);
        Worker worker = workerMapper.selectOne(qw);
        worker.setWorkerSalary(workerSalary);
        int update = workerMapper.update(worker, qw);
        return update;
    }
}

Controller

@Controller
@RequestMapping("worker")
public class WorkerController {

    @Value("${location}")
    private String location;
    @Autowired
    private WorkerService workerService;

    @RequestMapping("workerList")
    public String list(@RequestParam(required = false,defaultValue = "1",value = "pageNum") Integer pageNum,
                       @RequestParam(required = false,defaultValue = "10",value = "pageSize") Integer pageSize,
                       Model model, Worker worker){//Model用于存PageInfo
        if (pageNum<=0||pageNum.equals("")||pageNum==null){
            pageNum = 1;
        }
        if (pageSize<=0||pageSize.equals("")||pageSize==null){
            pageSize = 10;
        }
        PageHelper.startPage(pageNum,pageSize);
        PageInfo<Worker> list = workerService.list(worker);
        model.addAttribute("pageInfo",list);
        return "workerList";
    }


    @RequestMapping("preSaveWorker")
    public String preAdd(){
        return "workerSave";
    }

    @PostMapping("workerSave")
    public String add(Worker worker, MultipartFile file){
        transFile(worker,file);
        workerService.addWorker(worker);
        return "redirect:/worker/workerList";
    }

    private void transFile(Worker worker, MultipartFile file) {
        String originalFileName = file.getOriginalFilename();
        int index = originalFileName.lastIndexOf(".");
        String suffix = originalFileName.substring(index);
        String prefix = System.nanoTime()+"";
        String path = prefix+suffix;
        File file1 = new File(location);
        if(!file1.exists()){
            file1.mkdirs();
        }
        File file2 = new File(file1,path);
        try {
            file.transferTo(file2);
        } catch (IOException e) {
            e.printStackTrace();
        }
        worker.setWorkerImage(path);
    }

    @RequestMapping("preUpdateWorker/{id}")
    public String preUpdate(@PathVariable Integer id,Model model){
        Worker worker = workerService.getWorkerById(id);
        model.addAttribute("worker",worker);
        return "workerUpdate";
    }

    @RequestMapping("updateWorker")
    public String update(Worker worker,MultipartFile file){
        transFile(worker,file);
        int i = workerService.updateWorker(worker);
        return "redirect:/worker/workerList";
    }

    //ajax传参数放在Data里了,不用@PathVariable接收,也不用跳转
    @PostMapping("addSalary")
    @ResponseBody
    public String addSalary(Integer wid,String workerSalary){
        int i = workerService.updateSalary(wid, workerSalary);
        if(i>0){
            //返回值根据前端ajax(workerList.html中)写好的参数返回
            return "OK";
        }else{
            return "error";
        }
    }
}

7、送水历史管理模块

需要tb_history表
在这里插入图片描述
需要用到一些mybatisPlus没有的方法,需要在mapper下写需要的方法,具体实现在resources/com/example/HistoryMapper.xml

@Repository
public interface HistoryMapper extends BaseMapper<History> {
    List<History> listHistory(Map<String,Object> map);

    //除了mybatisPlus自己的一些方法,如果有其他方法,需要自己在下面写
    //相当于接口,具体实现在resources下的HistoryMapper.xml文件里,写SQL语句

    //添加
    int addHis(History history);

    //批量删除
    int deleteHis(List<Integer> ids);

    //根据id获取history对象
    History getHisById(Integer id);

    //修改
    int updateHis(History history);
}

HistoryMapper.xml文件

<?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"><!--记住 我的电脑这里只能是http才能出来小鸟-->
<mapper namespace="com.example.mapper.HistoryMapper">

    <resultMap id="historyMap" type="com.example.pojo.History">
        <id column="hid" property="hid"/>
        <result column="send_water_time" property="sendWaterTime"/>
        <result column="send_water_count" property="sendWaterCount"/>
        <association property="customer">
            <id column="cid" property="cid"/>
            <result column="cust_name" property="custName"/>
        </association>

        <association property="worker">
            <id column="wid" property="wid"/>
            <result column="worker_name" property="workerName"/>
        </association>
    </resultMap>



    <select id="listHistory" resultType="com.example.pojo.History" resultMap="historyMap">
        select h.hid, w.worker_name, c.cust_name, h.send_water_time, h.send_water_count
        from tb_history h,tb_customer c,tb_worker w
        <where>
            AND h.cust_id=c.cid AND h.worker_id=w.wid
            <if test="workerName != null and workerName!='' ">
                and w.worker_name like  concat('%',#{workerName},'%')
            </if>
            <if test="sendWaterTime != null and sendWaterTime !='' ">
                and h.send_water_time like  concat('%',#{sendWaterTime},'%')
            </if>
        </where>
    </select>


    <insert id="addHis">
        insert  into tb_history (cust_id,worker_id,send_water_time,send_water_count)
        values (#{customer.cid},#{worker.wid},#{sendWaterTime},#{sendWaterCount})
    </insert>

    <delete id="deleteHis">
        delete from tb_history
        where hid in
        <foreach collection="ids" item="hid" open="(" close=")" separator=",">
            #{hid}
        </foreach>
    </delete>

    <select id="getHisById" resultType="com.example.pojo.History" resultMap="historyMap">
        select h.hid, w.worker_name, c.cust_name, h.send_water_time, h.send_water_count
        from tb_history h,tb_customer c,tb_worker w where h.cust_id=c.cid and h.worker_id=w.wid and  hid=#{id}
    </select>

    <update id="updateHis">
        update tb_history set cust_id=#{customer.cid},worker_id=#{worker.wid},send_water_time=#{sendWaterTime},send_water_count=#{sendWaterCount}
        where  hid=#{hid}
    </update>
</mapper>

然后在业务层完成业务,controller层完成,controller层有一个数据回显的功能模块

    @RequestMapping("preSaveHis")
    //添加功能需要数据回显,必须是已经存在的worker和customer
    //数据回显是放在model中的
    public String preAddHis(Model model){
        List<Worker> workers = workerService.queryWorker();
        List<Customer> customer = customerService.querycustomer();
        //在historySave.html中有变量名,"custList"需要保持一致
        model.addAttribute("custList",customer);
        model.addAttribute("workerList",workers);
        return "historySave";
    }

8、计算薪资模块

在pojo创建Salary实体类
在mapper下创建SalaryMapper(用@Repository注解)
主要是sql语句
SalaryMapper.xml文件

<?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"><!--记住 我的电脑这里只能是http才能出来小鸟-->
<mapper namespace="com.example.mapper.SalaryMapper">

    <select id="list" resultType="com.example.pojo.Salary">
        SELECT  w.worker_name,w.worker_salary,w.worker_money,
       IFNULL(SUM(h.send_water_count),0) as send_water_count,
       IFNULL(SUM(w.worker_money*h.send_water_count)+w.worker_salary , w.worker_salary) as final_salary
        FROM
       tb_worker w LEFT JOIN tb_history h on w.wid=h.worker_id
       <where>
           <if test="startDate!=null and startDate!='' and endDate!=null and endDate != '' ">
           and h.send_water_time between #{startDate} and #{endDate}
           </if>
       </where>
       GROUP BY w.wid
        ORDER BY final_salary DESC

    </select>
    <select id="listAll" resultType="com.example.pojo.Salary">
        SELECT  w.worker_name,w.worker_salary,w.worker_money,
        IFNULL(SUM(h.send_water_count),0) as send_water_count,
        IFNULL(SUM(w.worker_money*h.send_water_count)+w.worker_salary , w.worker_salary) as final_salary
        FROM
        tb_worker w LEFT JOIN tb_history h on w.wid=h.worker_id
        GROUP BY w.wid
        ORDER BY final_salary DESC
    </select>
    <select id="listNull" resultType="com.example.pojo.Salary">
        SELECT  w.worker_name,w.worker_salary,w.worker_money,
        IFNULL(SUM(h.send_water_count),0) as send_water_count,
        IFNULL(SUM(w.worker_money*h.send_water_count)+w.worker_salary , w.worker_salary) as final_salary
        FROM
        tb_worker w LEFT JOIN tb_history h on w.wid=h.worker_id
        where h.worker_id is null
        GROUP BY w.wid
        ORDER BY final_salary DESC
    </select>
</mapper>

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1906802.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

建立有效的DNS性能检测机制

今天来分享如何建立有效的DNS性能监测机制&#xff0c;实时或定期监测关键指标。 一、建立DNS性能监测机制 &#xff08;一&#xff09;选择合适的监测工具 市场上有多种DNS性能监测工具可供选择&#xff0c;如IP数据云DNS检测功能。其具备强大的功能&#xff0c;能够针对多种…

简过网:快来看看你的专业能考哪个类型的事业单位?

你的专业能考哪个类型的事业单位&#xff0c;你知道吗&#xff1f;想考事业单位的姐妹&#xff0c;一定要在备考之前&#xff0c;查清楚你的专业适不适合考事业单位、考哪类事业编以及能报考哪些岗位&#xff1f;这个才能上岸的几率更高一些&#xff01; 事业单位有5类岗位&am…

Java动态执行jar包中类的方法

动态加载执行jar包&#xff0c;在实际开发中经常会需要用到&#xff0c;尤其涉及平台和业务的关系的时候&#xff0c;业务逻辑部分可以独立出去交给业务方管理&#xff0c;业务方只需要提供jar包&#xff0c;就能在平台上运行。 结论 通过反射可以实现动态调用jar包中的类的方…

免费可商用的Navicat Premium Lite要不要用?小心收到律丝函!

作者公众号&#xff1a;霸王龙的日常 专注数据库&#xff0c;分享实用的项目实战经验。 上周五写了一篇关于Navicat Premium Lite的文章&#xff0c;有网友去官网下载&#xff0c;反馈当前官网Navicat Premium Lite简介和我之前文章中的介绍的有出入。 我赶紧打开网站看了下Na…

修改CentOS7.9跟Unbantu24的ip地址

修改CentOS的IP地址 ip addr 查看IP地址 cd /etc/sysconfig/network-scripts ls vi ifcfg-ens33修改ip地址跟干网关地址 TYPE"Ethernet" PROXY_METHOD"none" BROWSER_ONLY"no" BOOTPROTO"static" DEFROUTE"yes" IPV4_FA…

排序 -- 手撕归并排序(递归和非递归写法)

一、基本思想 归并排序&#xff08;MERGE-SORT&#xff09;是建立在归并操作上的一种有效的排序算法,该算法是采用分治法&#xff08;Divide and Conquer&#xff09;的一个非常典型的应用。将已有序的子序列合并&#xff0c;得到完全有序的序列&#xff1b;即先使每个子序列有…

掌上教务系统-计算机毕业设计源码84604

摘要 在数字化教育日益成为主流的今天&#xff0c;教务管理系统的智能化和便捷性显得尤为重要。为满足学校、教师、学生及家长对教务管理的高效需求&#xff0c;我们基于Spring Boot框架设计并实现了一款掌上教务系统。该系统不仅具备课程分类管理功能&#xff0c;使各类课程信…

软件架构之开发方法

软件架构之开发方法 第6章&#xff1a;开发方法6.1 软件生命周期6.2 软件开发模型6.2.1 瀑布模型6.2.2 演化模型6.2.3 螺旋模型6.2.4 增量模型6.2.5 构件组装模型 6.3 统一过程6.4 敏捷方法6.4.1 极限编程6.4.2 特征驱动开发6.4.3 Scrum6.4.4 水晶方法6.4.5 其他敏捷方法 6.5 软…

《梦醒蝶飞:释放Excel函数与公式的力量》9.5 IRR函数

9.5 IRR函数 IRR函数是Excel中用于计算内部收益率&#xff08;Internal Rate of Return, IRR&#xff09;的函数。内部收益率是评估投资项目盈利性的重要指标&#xff0c;它表示使投资项目的净现值&#xff08;NPV&#xff09;为零的折现率。 9.5.1 函数简介 IRR函数通过一系…

微软开源GraphRAG的使用教程-使用自定义数据测试GraphRAG

微软在今年4月份的时候提出了GraphRAG的概念&#xff0c;然后在上周开源了GraphRAG,Github链接见https://github.com/microsoft/graphrag,截止当前&#xff0c;已有6900Star。 安装教程 官方推荐使用Python3.10-3.12版本&#xff0c;我使用Python3.10版本安装时&#xff0c;在…

Java:String 类

文章目录 一、概念二、创建字符串三、字符串长度四、连接字符串五、比较字符串 一、概念 字符串广泛应用 在 Java 编程中&#xff0c;在 Java 中字符串属于对象&#xff0c;Java 提供了 String 类来创建和操作字符串。 二、创建字符串 创建字符串最简单的方式如下: // 直接创…

利用Python进行数据分析PDF下载经典数据分享推荐

本书由Python pandas项目创始人Wes McKinney亲笔撰写&#xff0c;详细介绍利用Python进行操作、处理、清洗和规整数据等方面的具体细节和基本要点。第2版针对Python 3.6进行全面修订和更新&#xff0c;涵盖新版的pandas、NumPy、IPython和Jupyter&#xff0c;并增加大量实际案例…

什么是Common Flash Interface

目录 1. CFI概述 2. CFI的使用小结 3. CFI在车规MCU里有用吗 在看关于ifx的标准flash驱动配置时&#xff0c;无意中瞄到一个注灰的选项&#xff1a; Try to use CFI information to detect Flash Type 之前讲过CFI这个标准&#xff0c;但为何在IFX memtool工具里注灰&#x…

opencv实现人脸检测功能----20240704

opencv实现人脸检测 早在 2017 年 8 月,OpenCV 3.3 正式发布,带来了高度改进的“深度神经网络”(dnn)模块。 该模块支持多种深度学习框架,包括 Caffe、TensorFlow 和 Torch/PyTorch。OpenCV 的官方版本中包含了一个更准确、基于深度学习的人脸检测器, 链接:基于深度学习…

基于springboot+vue+uniapp的贵工程寝室快修小程序

开发语言&#xff1a;Java框架&#xff1a;springbootuniappJDK版本&#xff1a;JDK1.8服务器&#xff1a;tomcat7数据库&#xff1a;mysql 5.7&#xff08;一定要5.7版本&#xff09;数据库工具&#xff1a;Navicat11开发软件&#xff1a;eclipse/myeclipse/ideaMaven包&#…

人员定位系统的功能,你知道多少呢?

在此前的文章中&#xff0c;说到了人员定位系统用于化工厂定位这一用途来完善工厂管理&#xff0c;但同时&#xff0c;基于人员定位系统的强大功能&#xff0c;该系统的应用范围也要宽范的多&#xff0c;那么&#xff0c;本篇文章就来为大家介绍一下吧。 人员定位系统的功能简介…

maxwell启动报错:Could not find first log file name in binary log index file

出现该问题是因为&#xff1a;maxwell 读取的是 mysql 的 binlog 日志&#xff0c;而配置文件中的两个值与 binlog 的最新值没有保持一致导致 1. 切换到maxwell的库 show master status;记住图片中的 FIle 和 Position 2. 修改maxwell的配置 SELECT * from positions p ;将…

怎样优化 PostgreSQL 中对 XML 数据的存储和查询?

文章目录 一、数据类型选择二、索引优化三、查询优化四、分区策略五、存储参数调整六、示例代码与解释七、性能测试与监控八、数据清理与压缩九、注意事项 在 PostgreSQL 中处理 XML 数据时&#xff0c;为了实现高效的存储和查询&#xff0c;需要采取一系列的优化策略。以下将详…

国外服务器备案主要需要准备什么

在全球化日益加深的今天&#xff0c;许多企业和个人选择将服务器部署在国外&#xff0c;以享受更广泛的用户覆盖、更低廉的运营成本或更灵活的网络环境。然而&#xff0c;不同国家和地区对服务器备案的要求各不相同&#xff0c;但通常而言&#xff0c;进行国外服务器备案主要需…

轻松集成,高效变现:Flat Ads SDK助力开发者轻松跨越广告变现门槛

在当今的移动应用开发领域,广告变现是开发者们普遍关注的重要话题。如何在不影响用户体验的前提下,最大化地实现广告收益,成为了许多开发者面临的挑战。为此,Flat Ads SDK 应运而生,它以“轻松集成,合规守护,高效变现”为核心理念,帮助开发者轻松解决流量变现难题。 一、高效变…