QueryWrapper<>(); 用法樣例


/**
     * 在此邏輯中需要先做判斷,判斷數據庫中是否已經存在編碼,如果存在,那么對用戶發出提示
     * @param fcEstate
     * @return
     */
    public Integer insertEstate(FcEstate fcEstate){
        int result = 0;
        QueryWrapper<FcEstate> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("estate_code", fcEstate.getEstateCode());
        FcEstate fe = fcEstateMapper.selectOne(queryWrapper);
        if (fe == null) {
            result = fcEstateMapper.insert(fcEstate);
        }
        return result;
    }
View Code

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM