JAVA优秀员工搞不定的事DBA搞定了

2023年 10月 10日 57.3k 0

  @Test
    public  void getPageByCondition()
    {
        TotalAmount TotalAmountPo = new TotalAmount();
        TotalAmountPo.setAmount(0);
        TotalAmountPo.setTotal(0);

        Page PagePo = new Page();
        PagePo.setPageNum(1);
        PagePo.PageRows=10;

        PersonalCondition PersonalConditionPo= new PersonalCondition();
        PersonalConditionPo.setSurname("曾");
        // DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        String strCreate = "2023-05-18 15:32:05";
        String strUpdate = "2023-09-27 15:13:56";
        SimpleDateFormat format = new SimpleDateFormat("yyy-MM-dd HH:mm:ss");

        Date createdDate = null;
        Date updateDate  = null;

        try
        {
            createdDate = format.parse(strCreate);
            System.out.println(createdDate);

            updateDate  = format.parse(strUpdate);
            System.out.println(updateDate);
        } catch (ParseException e)
        {
            e.printStackTrace();
        }
        // 计算日期差值(以天为单位)
        long diffInMillies = Math.abs(updateDate.getTime() - createdDate.getTime());
        long diffInDays = diffInMillies / (24 * 60 * 60 * 1000);

        System.out.println("日期差值(以天为单位):" + diffInDays);

        PersonalConditionPo.setCreate_time(createdDate);
        PersonalConditionPo.setUpdate_time(updateDate);
        // PersonalConditionPo.setAge(125);
        //PersonalConditionPo.setIncome_year(43135);

        PersonalVO PersonalVo;
        PersonalVo= this.PersonalServiceImpl.GetPageByCondition(PagePo,PersonalConditionPo,TotalAmountPo);

        System.out.print(PersonalVo.TotalAmountVo.Total);
        System.out.print(PersonalVo.TotalAmountVo.Amount);

        Personal Personal;
        for (int i=0; i

        {
            Personal = PersonalVo.PersonalListVo.get(i);
            System.out.print(Personal.getDBID());
            System.out.print(Personal.getIdentityNumber());
            System.out.print(Personal.getSurname());
            System.out.print(Personal.getName());
            System.out.print(Personal.getMobile());
            System.out.print(Personal.getSex());
            System.out.print(Personal.getBirthday());
            System.out.print(Personal.getAge());
            System.out.print(Personal.getTopEducation());
            System.out.print(Personal.getIncomeYear());
            System.out.print(Personal.getCreateTime());
        }
    }

相关文章

Oracle如何使用授予和撤销权限的语法和示例
Awesome Project: 探索 MatrixOrigin 云原生分布式数据库
下载丨66页PDF,云和恩墨技术通讯(2024年7月刊)
社区版oceanbase安装
Oracle 导出CSV工具-sqluldr2
ETL数据集成丨快速将MySQL数据迁移至Doris数据库

发布评论