五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

jeecgboot多表聯(lián)合查詢

2021-08-19 21:16 作者:辦公自動化學(xué)習(xí)  | 我要投稿

? ? ? ?

在數(shù)據(jù)大屏中需要多表聯(lián)合查詢的業(yè)務(wù)處理,而Jeecgboot提供的生成工具只能滿足最普遍的簡單代碼,mybatis-plus框架使用的QueryWrapper顯然無法滿足多表聯(lián)合查詢,需要重寫API接口。

1.新建返回對象的實體類

import lombok.Data; @Data public class Vendorcount { ? ? private Integer vendor; ? ? private Integer material; }


2.mapper層接口


public interface VendorcountMapper extends BaseMapper<Vendorcount> { ? ? List<Vendorcount> pageByVendor(); }


3.xml中寫入sql


<select id="pageByVendor" resultType="org.jeecg.modules.demo.vendorquery.entity.Vendorcount"> ? ? ? ? select count(DISTINCT material13.Vendor) as vendor,count(DISTINCT material13.Material) as material ? ? ? ? from material13 INNER JOIN stock on material13.Vendor=stock.create_by and material13.Plant=stock.plant ? ? ? ? and material13.Material=stock.partno </select>


4.service接口

public interface IVendorcountService extends IService<Vendorcount> { ? ? List<Vendorcount> pageByVendorService(); }


5.serviceImpl

@Service public class VendorcountServiceImpl extends ServiceImpl<VendorcountMapper, Vendorcount> implements IVendorcountService { ? ? @Autowired ? ? private VendorcountMapper vendorcountMapper; ? ? @Override ? ? public List<Vendorcount> pageByVendorService() { ? ? ? ? return vendorcountMapper.pageByVendor(); ? ? } }


6.control層

@Api(tags = "供應(yīng)商查詢") @RestController @RequestMapping("/Vendorcount/vendorcount") @Slf4j public class VendorcountController extends JeecgController<Vendorcount, IVendorcountService> { ? ? @Autowired ? ? private IVendorcountService vendorcountService; ? ? @AutoLog(value = "供應(yīng)商查詢-統(tǒng)計個數(shù)") ? ? @ApiOperation(value = "供應(yīng)商查詢-統(tǒng)計個數(shù)", notes = "供應(yīng)商查詢-統(tǒng)計個數(shù)") ? ? @GetMapping(value = "/list") ? ? public Result<?> queryVendor(HttpServletRequest req) { ? ? ? ? List<Vendorcount> pageList = vendorcountService.pageByVendorService(); ? ? ? ? return Result.ok(pageList); ? ? } }


7.Shiro配置


// 配置不會被攔截的鏈接 filterChainDefinitionMap.put("/Vendorcount/vendorcount/**", "anon"); //


8.調(diào)試API接口



9.前端定時調(diào)用接口刷新數(shù)據(jù)

getAction("/Vendorcount/vendorcount/list").then((res) => { ? ? if (res.success) { ? ? ? let a = res.result ? ? ? this.titleItem[0].number.number = [a[0]["material"]] ? ? ? this.titleItem[1].number.number = [a[0]["vendor"]] ? ? ? this.titleItem = { ? ? ? ? ...this.titleItem ? ? ? } ? ? ? this.show = false ? ? ? this.$nextTick(() => { ? ? ? ? this.show = true ? ? ? })

大屏展示


jeecgboot多表聯(lián)合查詢的評論 (共 條)

分享到微博請遵守國家法律
洪泽县| 建平县| 五家渠市| 丹东市| 宁海县| 台南县| 沂水县| 宁城县| 长海县| 依兰县| 汉阴县| 太白县| 普格县| 韶山市| 兰考县| 汤原县| 盐池县| 仪陇县| 新河县| 延安市| 涟源市| 新巴尔虎左旗| 四平市| 临汾市| 文山县| 原阳县| 镇平县| 朝阳区| 江门市| 岢岚县| 昆山市| 广宗县| 虞城县| 东乡族自治县| 大化| 嘉祥县| 怀远县| 辽宁省| 许昌县| 牟定县| 沁源县|