MyBatis Plus 自定义查询语句

MyBatis Plus 自定义查询语句

1,Dao层

@Select("select b.bomName, " +
		"b.bomProductType, b.bomMaterial, " +
		"o.customerID AS bomID, " +
		"o.ordersDataNo AS qrCode, " +
		"s.deliveryDate AS barCode, " +
		"s.mainType AS workshop " +
		"FROM mes_order_bom b " +
		"LEFT JOIN mes_order_ordersdata o ON b.ordersID = o.id " +
		"LEFT JOIN mes_order_soncontract s ON o.sonContractID = s.id " +
		"WHERE o.ordersDataNo IN (#{orderNoList})")
List<MesOrderBom> getBomAndOrderCodeNumber(@Param("orderNoList")List<String> orderNoList);

2,Service层

List<MesOrderBom> getBomAndOrderCodeNumber(List<String> orderNoList);

3,Service实现类

@Override
public List<MesOrderBom> getBomAndOrderCodeNumber(List<String> orderNoList) {
	return this.baseMapper.getBomAndOrderCodeNumber(orderNoList);
}

这样写不用再Mapper中写xml文件

发布了7 篇原创文章 · 获赞 0 · 访问量 452
展开阅读全文

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 数字20 设计师: CSDN官方博客

分享到微信朋友圈

×

扫一扫,手机浏览