From 34981c30a78e8bbd7791131059a9210f9928b62c Mon Sep 17 00:00:00 2001
From: 刘光辉 <347230014@qq.com>
Date: 星期四, 17 九月 2026 09:24:09 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master' into master
---
jnpf-lims/jnpf-lims-biz/src/main/java/jnpf/mapper/TableExampleMapper.java | 144 ++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 144 insertions(+), 0 deletions(-)
diff --git a/jnpf-lims/jnpf-lims-biz/src/main/java/jnpf/mapper/TableExampleMapper.java b/jnpf-lims/jnpf-lims-biz/src/main/java/jnpf/mapper/TableExampleMapper.java
new file mode 100644
index 0000000..22f7b79
--- /dev/null
+++ b/jnpf-lims/jnpf-lims-biz/src/main/java/jnpf/mapper/TableExampleMapper.java
@@ -0,0 +1,144 @@
+package jnpf.mapper;
+
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import jnpf.base.mapper.SuperMapper;
+import jnpf.entity.TableExampleEntity;
+import jnpf.model.tableexample.PaginationTableExample;
+import jnpf.util.RandomUtil;
+import jnpf.util.UserProvider;
+import org.apache.commons.lang3.StringUtils;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 琛ㄦ牸绀轰緥鏁版嵁
+ *
+ * @author JNPF寮�鍙戝钩鍙扮粍
+ * @version V3.1.0
+ * @copyright 寮曡繄淇℃伅鎶�鏈湁闄愬叕鍙�
+ * @date 2019骞�9鏈�26鏃� 涓婂崍9:18
+ */
+public interface TableExampleMapper extends SuperMapper<TableExampleEntity> {
+
+ default List<TableExampleEntity> getList() {
+ QueryWrapper<TableExampleEntity> queryWrapper = new QueryWrapper<>();
+ queryWrapper.lambda().orderByAsc(TableExampleEntity::getProjectType).orderByAsc(TableExampleEntity::getSortCode);
+ return this.selectList(queryWrapper);
+ }
+
+ default List<TableExampleEntity> getList(String keyword) {
+ QueryWrapper<TableExampleEntity> queryWrapper = new QueryWrapper<>();
+ //鍏抽敭瀛楁煡璇�
+ if (!StringUtils.isEmpty(keyword)) {
+ queryWrapper.lambda().and(t -> t.like(TableExampleEntity::getCustomerName, keyword)
+ .or().like(TableExampleEntity::getProjectName, keyword));
+ }
+ queryWrapper.lambda().orderByAsc(TableExampleEntity::getProjectType).orderByAsc(TableExampleEntity::getSortCode);
+ return this.selectList(queryWrapper);
+ }
+
+ default List<TableExampleEntity> getList(String typeId, PaginationTableExample paginationTableExample) {
+ QueryWrapper<TableExampleEntity> queryWrapper = new QueryWrapper<>();
+ queryWrapper.lambda().eq(TableExampleEntity::getProjectType, typeId);
+ //鍏抽敭瀛楋紙椤圭洰缂栫爜銆侀」鐩悕绉般�佸鎴峰悕绉帮級
+ String keyWord = paginationTableExample.getKeyword() != null ? paginationTableExample.getKeyword() : null;
+ if (!StringUtils.isEmpty(keyWord)) {
+ queryWrapper.lambda().and(
+ t -> t.like(TableExampleEntity::getProjectCode, keyWord)
+ .or().like(TableExampleEntity::getProjectName, keyWord)
+ .or().like(TableExampleEntity::getCustomerName, keyWord)
+ );
+ }
+ //鏍囩鏌ヨ
+ String sign = paginationTableExample.getFSign() != null ? paginationTableExample.getFSign() : null;
+ if (!StringUtils.isEmpty(sign)) {
+ String[] arraySign = sign.split(",");
+ for (int i = 0; i < arraySign.length; i++) {
+ String item = arraySign[i];
+ if (i == 0) {
+ queryWrapper.lambda().like(TableExampleEntity::getProjectCode, item);
+ } else {
+ queryWrapper.lambda().or(t -> t.like(TableExampleEntity::getProjectCode, item));
+ }
+ }
+ }
+ //鎺掑簭
+ if (StringUtils.isEmpty(paginationTableExample.getSidx())) {
+ queryWrapper.lambda().orderByDesc(TableExampleEntity::getRegisterDate);
+ } else {
+ queryWrapper = "asc".equalsIgnoreCase(paginationTableExample.getSort()) ? queryWrapper.orderByAsc(paginationTableExample.getSidx()) : queryWrapper.orderByDesc(paginationTableExample.getSidx());
+ }
+ return this.selectList(queryWrapper);
+ }
+
+ default List<TableExampleEntity> getList(PaginationTableExample paginationTableExample) {
+ QueryWrapper<TableExampleEntity> queryWrapper = new QueryWrapper<>();
+ //鍏抽敭瀛楋紙椤圭洰缂栫爜銆侀」鐩悕绉般�佸鎴峰悕绉帮級
+ String keyWord = paginationTableExample.getKeyword() != null ? paginationTableExample.getKeyword() : null;
+ if (!StringUtils.isEmpty(keyWord)) {
+ queryWrapper.lambda().and(
+ t -> t.like(TableExampleEntity::getProjectCode, keyWord)
+ .or().like(TableExampleEntity::getProjectName, keyWord)
+ .or().like(TableExampleEntity::getCustomerName, keyWord)
+ );
+ }
+ //鏍囩鏌ヨ
+ String sign = paginationTableExample.getFSign() != null ? paginationTableExample.getFSign() : null;
+ if (!StringUtils.isEmpty(sign)) {
+ String[] arraySign = sign.split(",");
+ for (int i = 0; i < arraySign.length; i++) {
+ String item = arraySign[i];
+ if (i == 0) {
+ queryWrapper.lambda().like(TableExampleEntity::getProjectCode, item);
+ } else {
+ queryWrapper.lambda().or(t -> t.like(TableExampleEntity::getProjectCode, item));
+ }
+ }
+ }
+ //鎺掑簭
+ if (StringUtils.isEmpty(paginationTableExample.getSidx())) {
+ queryWrapper.lambda().orderByDesc(TableExampleEntity::getRegisterDate);
+ } else {
+ queryWrapper = "asc".equalsIgnoreCase(paginationTableExample.getSort()) ? queryWrapper.orderByAsc(paginationTableExample.getSidx()) : queryWrapper.orderByDesc(paginationTableExample.getSidx());
+ }
+ Page<TableExampleEntity> page = new Page<>(paginationTableExample.getCurrentPage(), paginationTableExample.getPageSize());
+ IPage<TableExampleEntity> exampleEntityIPage = this.selectPage(page, queryWrapper);
+ return paginationTableExample.setData(exampleEntityIPage.getRecords(), page.getTotal());
+ }
+
+ default TableExampleEntity getInfo(String id) {
+ QueryWrapper<TableExampleEntity> queryWrapper = new QueryWrapper<>();
+ queryWrapper.lambda().eq(TableExampleEntity::getId, id);
+ return this.selectOne(queryWrapper);
+ }
+
+ default void delete(TableExampleEntity entity) {
+ this.deleteById(entity.getId());
+ }
+
+ default void create(TableExampleEntity entity) {
+ entity.setId(RandomUtil.uuId());
+ entity.setSortCode(RandomUtil.parses());
+ entity.setRegisterDate(new Date());
+ entity.setRegistrant(UserProvider.getUser().getUserId());
+ this.insert(entity);
+ }
+
+ default boolean update(String id, TableExampleEntity entity) {
+ entity.setId(id);
+ entity.setLastModifyTime(new Date());
+ entity.setLastModifyUserId(UserProvider.getUser().getUserId());
+ return this.updateById(entity) > 0;
+ }
+
+ default boolean rowEditing(TableExampleEntity entity) {
+ entity.setLastModifyTime(new Date());
+ entity.setLastModifyUserId(UserProvider.getUser().getUserId());
+ return this.updateById(entity) > 0;
+ }
+
+}
--
Gitblit v1.8.0