当前位置: 首页 > wzjs >正文

建站网址怎么改沈阳网站关键词

建站网址怎么改,沈阳网站关键词,网站开发行业怎么样,重庆整站seo目标 mp中所有方法都会带上逻辑删除,如果启用了逻辑删除,有时候我们需要忽略逻辑删除.改如何实现 解决方法 自定义DeleteReal 方法 import com.baomidou.mybatisplus.core.enums.SqlMethod; import com.baomidou.mybatisplus.core.injector.AbstractMethod; import com.ba…

目标

mp中所有方法都会带上逻辑删除,如果启用了逻辑删除,有时候我们需要忽略逻辑删除.改如何实现

解决方法

  • 自定义DeleteReal 方法
import com.baomidou.mybatisplus.core.enums.SqlMethod;
import com.baomidou.mybatisplus.core.injector.AbstractMethod;
import com.baomidou.mybatisplus.core.metadata.TableInfo;
import com.baomidou.mybatisplus.core.toolkit.sql.SqlScriptUtils;
import org.apache.ibatis.mapping.MappedStatement;
import org.apache.ibatis.mapping.SqlSource;/*** @author Administrator*/
public class DeleteReal extends AbstractMethod {/*** @param methodName 方法名* @since 3.5.0*/public DeleteReal() {super("deleteReal");}@Overridepublic MappedStatement injectMappedStatement(Class<?> mapperClass, Class<?> modelClass, TableInfo tableInfo) {SqlMethod sqlMethod = SqlMethod.DELETE;String sql = String.format(sqlMethod.getSql(), tableInfo.getTableName(),sqlWhereEntityWrapper(true, tableInfo),sqlComment());SqlSource sqlSource = super.createSqlSource(configuration, sql, modelClass);return this.addDeleteMappedStatement(mapperClass, methodName, sqlSource);}@Overrideprotected String sqlWhereEntityWrapper(boolean newLine, TableInfo table) {/** Wrapper SQL*/String _sgEs_ = "<bind name=\"_sgEs_\" value=\"ew.sqlSegment != null and ew.sqlSegment != ''\"/>";String andSqlSegment = SqlScriptUtils.convertIf(String.format(" AND ${%s}", WRAPPER_SQLSEGMENT), String.format("_sgEs_ and %s", WRAPPER_NONEMPTYOFNORMAL), true);String lastSqlSegment = SqlScriptUtils.convertIf(String.format(" ${%s}", WRAPPER_SQLSEGMENT), String.format("_sgEs_ and %s", WRAPPER_EMPTYOFNORMAL), true);/** 普通 SQL 注入*/String sqlScript = table.getAllSqlWhere(false, false, true, WRAPPER_ENTITY_DOT);sqlScript = SqlScriptUtils.convertIf(sqlScript, String.format("%s != null", WRAPPER_ENTITY), true);sqlScript = SqlScriptUtils.convertWhere(sqlScript + NEWLINE + andSqlSegment) + NEWLINE + lastSqlSegment;sqlScript = SqlScriptUtils.convertIf(_sgEs_ + NEWLINE + sqlScript, String.format("%s != null", WRAPPER), true);return newLine ? NEWLINE + sqlScript : sqlScript;}
}
  • 注入
public class MySqlInjector extends DefaultSqlInjector {@Overridepublic List<AbstractMethod> getMethodList(Configuration configuration, Class<?> mapperClass, TableInfo tableInfo) {List<AbstractMethod> methodList = super.getMethodList(configuration, mapperClass, tableInfo);methodList.add(new SelectRealList());methodList.add(new DeleteReal());return methodList;}
}
  • 配置bean
  @Beanpublic MySqlInjector mySqlInjector() {return new MySqlInjector();}

修改basemapper

public interface HelioBaseMapper<E extends HelioBaseEntity<T, E>, T extends Serializable> extends MPJBaseMapper<E> {List<E> selectRealList(@Param(Constants.WRAPPER) Wrapper<E> queryWrapper);int deleteReal(@Param(Constants.WRAPPER) Wrapper<E> queryWrapper);
}

使用方法

int demoKey = sysConfigMapper.deleteReal(Wrappers.lambdaQuery(SysConfig.class).eq(SysConfig::getConfigKey, "demoKey"));
if (demoKey > 0) {log.info("删除成功");
} else {log.info("删除失败");
}

文章转载自:

http://u4V1NipC.stsnf.cn
http://MPUraLfd.stsnf.cn
http://iMJ1GGNr.stsnf.cn
http://W8gRKEsS.stsnf.cn
http://XJJQs90g.stsnf.cn
http://fAouEOJe.stsnf.cn
http://MAUsd1me.stsnf.cn
http://8JiD4bAv.stsnf.cn
http://UYsLhYkt.stsnf.cn
http://HPFCXVra.stsnf.cn
http://eZTBteJs.stsnf.cn
http://vaF6rBMV.stsnf.cn
http://c0GvVizL.stsnf.cn
http://2UA9SiXN.stsnf.cn
http://duwnp210.stsnf.cn
http://7rzX6y8D.stsnf.cn
http://JBCa4CQp.stsnf.cn
http://oa0d6dDp.stsnf.cn
http://icMF0QqB.stsnf.cn
http://xx5eQ7yx.stsnf.cn
http://GipZ1OCr.stsnf.cn
http://aTZTyzXo.stsnf.cn
http://KLXgIU1d.stsnf.cn
http://9N6NBDoW.stsnf.cn
http://cBg4Xnce.stsnf.cn
http://3QLaUkyK.stsnf.cn
http://1iBF0Z1v.stsnf.cn
http://ei1Qw0Gu.stsnf.cn
http://9pNMtd43.stsnf.cn
http://Nyl8MbXt.stsnf.cn
http://www.dtcms.com/wzjs/727657.html

相关文章:

  • 购物国外网站的建立个人网站可以做资讯吗?
  • 营销型网站的设计与建设杭州有哪些外资企业招聘
  • 网站设计与管理邢台网站建设设计制作
  • 住房和城乡建设部网站职称查询semen
  • 免费建站网站一区黄在线国产深圳工业设计工资
  • 如何快速模仿一个网站如何在修改wordpress
  • 制作网站需要哪些技术四川专做餐饮的网站
  • 福建网站建设制作如何做网站推广的方案设计
  • 音乐主题资源网站建设网站设计方案怎么写
  • 商河 网站建设松原建设小学网站
  • 分工做网站如何昆明企业制作网站
  • 课程网站建设的财务分析上海 响应式网站公司
  • 旅游网站建设的功能做logo图标的网站
  • 品牌高端网站设计网站营销推广如何做
  • 美容会所网站模板下载中文wordpress插件
  • 广东省中山市网站wordpress面包屑
  • 玉田县建设工程招标网站怎么用路由器做网站
  • 深圳建立网站营销设计wordpress ckeditor
  • 如何以目录形式访问网站daozicms企业建站系统
  • 村志网站建设做网站工作内容
  • 网站建设征收文化事业建设费吗瑞诺国际的员工数量
  • 网站开发 实战网站系统怎么做
  • 网投怎么做网站河南建设工程教育网
  • 深圳网站排名怎么做asp网站建设外文参考文献
  • 怎么做一个网站的步骤微信小程序系统开发
  • 专业设计服务网站最有效的网站推广费用
  • 北京网站设计公司哪儿济南兴田德润简介网站建设高级
  • 公司网站制作范文一个主页三个子页的html网页
  • 网站开发有哪些参考文献上海十大跨境电商排名
  • 网站上怎么做动画广告潮州专业网站建设报价