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

河南商丘网站网站视频

河南商丘网站,网站视频,公司网站备案有什么用,iis wordpress 权限目录 一、 序言二、代码示例三、部署至Nginx 一、 序言 平时通过IDEA开发,可以直接装相关MybatisLogFormat的插件直接对控制台里的Mybatis SQL日志进行格式化。一旦离开本地环境,到了测试或者线上,就得自己手动拼参数了。 简单的SQL还好&am…

目录

  • 一、 序言
  • 二、代码示例
  • 三、部署至Nginx

一、 序言

平时通过IDEA开发,可以直接装相关MybatisLogFormat的插件直接对控制台里的Mybatis SQL日志进行格式化。一旦离开本地环境,到了测试或者线上,就得自己手动拼参数了。

简单的SQL还好,复杂点或者查询条件多的SQL简直让人怀疑人生,今天分享一个简单的SQL格式化H5,从此解放拼接的双手。


二、代码示例

<!DOCTYPE html>
<html>
<head><meta charset="utf-8"><title></title><script type="text/javascript">function f(obj) {var textVa = obj.value;// 获取带问号的SQL语句var statementStartIndex = textVa.indexOf('Preparing: ');var statementEndIndex = textVa.length - 1;for (var i = statementStartIndex; i < textVa.length; i++) {if (textVa[i] == "\n") {statementEndIndex = i;break;}}var statementStr = textVa.substring(statementStartIndex + "Preparing: ".length, statementEndIndex);console.log(statementStr);//获取参数var parametersStartIndex = textVa.indexOf('Parameters: ');var parametersEndIndex = textVa.length - 1;for (var i = parametersStartIndex; i < textVa.length; i++) {if (textVa[i] == "\n") {parametersEndIndex = i;break;} else {console.log(textVa[i]);}}var parametersStr = textVa.substring(parametersStartIndex + "Parameters: ".length, parametersEndIndex);parametersStr = parametersStr.split(",");console.log(parametersStr);for (var i = 0; i < parametersStr.length; i++) {// 如果数据中带括号将使用其他逻辑tempStr = parametersStr[i].substring(0, parametersStr[i].indexOf("("));// 获取括号中内容typeStr = parametersStr[i].substring(parametersStr[i].indexOf("(") + 1, parametersStr[i].indexOf(")"));// 如果为字符类型if (typeStr == "String" || typeStr == "Timestamp") {statementStr = statementStr.replace("?", "'" + tempStr.trim() + "'");} else {// 数值类型statementStr = statementStr.replace("?", tempStr.trim());}}console.log(statementStr);document.getElementById("d1").innerHTML = statementStr;return textVa;}function copySQL() {var SQL = document.getElementById("d1");SQL.select(); // 选择对象document.execCommand("Copy"); // 执行浏览器复制命令var msg = document.getElementById("msg");msg.innerHTML = "已复制到剪切板";setTimeout(function () {msg.innerHTML = "";}, 3000);}function clearLog(obj) {obj.select();obj.value = "";}</script>
</head>
<body><h2><font color="#00bfff"> 输入Mybatis SQL日志:</font></h2><textarea id="sqlLog" rows="13" cols="140" style="font-size:20px"></textarea><div style="border:0px deepskyblue solid;width:1425px;height:50px;text-align:right"><button style="color:mediumblue;width:100px;height:60px" type="button"onclick="clearLog(document.getElementById('sqlLog'))">清空</button><button style="color:mediumblue;width:100px;height:60px" type="submit"onclick="f(document.getElementById('sqlLog'))">解析SQL</button>
</div><h2><font color="#32cd32">解析为可执行SQL:</font></h2><textarea id="d1" rows="13" cols="140" style="font-size:20px"></textarea>
<div style="border:0px deepskyblue solid;width:1425px;height:50px;text-align:right"><button style="color:mediumblue;width:100px;height:60px" type="button" onclick="copySQL()">复制SQL</button>
</div><div id="msg"style="color:cornflowerblue;border:0px black solid;width:800px;height:20px;text-align:right;font-style: initial;font-size: large">
</div></body>
</html>

三、部署至Nginx

接下来我们直接将该静态文件扔到Nginx中就好了,部署也很简单,方便易用,配置如下:

location /h5/sql-formatter {alias h5/mybatis-log-formatter;
}

备注:我部署的文件路径为/opt/appl/nginx/h5/mybatis-log-formatter

打开浏览器,访问http://localhost/h5/sql-formatter/sql.html,点击解析SQL就可以解析出拼接好条件的SQL,如下:
在这里插入图片描述
在这里插入图片描述


文章转载自:
http://dinncoschizophrenese.zfyr.cn
http://dinncofederales.zfyr.cn
http://dinncoprefade.zfyr.cn
http://dinncotrichloromethane.zfyr.cn
http://dinncoupsurge.zfyr.cn
http://dinncoinjurious.zfyr.cn
http://dinnconanette.zfyr.cn
http://dinncoamericanist.zfyr.cn
http://dinncoips.zfyr.cn
http://dinncotentless.zfyr.cn
http://dinncosleety.zfyr.cn
http://dinncogumming.zfyr.cn
http://dinncosplinter.zfyr.cn
http://dinncocontratest.zfyr.cn
http://dinncoavaluative.zfyr.cn
http://dinncoeobiont.zfyr.cn
http://dinncoendgame.zfyr.cn
http://dinncoastrocompass.zfyr.cn
http://dinncocoemption.zfyr.cn
http://dinncounneutrality.zfyr.cn
http://dinncoinadvertent.zfyr.cn
http://dinncocaricature.zfyr.cn
http://dinncozoftig.zfyr.cn
http://dinncoearthen.zfyr.cn
http://dinncopediculous.zfyr.cn
http://dinncofortlike.zfyr.cn
http://dinncobackbencher.zfyr.cn
http://dinncozinckenite.zfyr.cn
http://dinncoabyss.zfyr.cn
http://dinnconeopentane.zfyr.cn
http://dinncocryoextraction.zfyr.cn
http://dinncothrenetic.zfyr.cn
http://dinncolarkspur.zfyr.cn
http://dinncolineal.zfyr.cn
http://dinncobluntness.zfyr.cn
http://dinncometallocene.zfyr.cn
http://dinncoatomistics.zfyr.cn
http://dinncocyanosed.zfyr.cn
http://dinncolummox.zfyr.cn
http://dinncoaventurine.zfyr.cn
http://dinncomultipole.zfyr.cn
http://dinncoinobservance.zfyr.cn
http://dinncoorganization.zfyr.cn
http://dinncosaucer.zfyr.cn
http://dinncocroma.zfyr.cn
http://dinncopolydemic.zfyr.cn
http://dinncobequeathal.zfyr.cn
http://dinncoinstantiation.zfyr.cn
http://dinncojavastation.zfyr.cn
http://dinncocolourfast.zfyr.cn
http://dinncocacotrophia.zfyr.cn
http://dinncooverdrink.zfyr.cn
http://dinncopolyribosome.zfyr.cn
http://dinncoacini.zfyr.cn
http://dinncoyassy.zfyr.cn
http://dinnconightglass.zfyr.cn
http://dinncoconjoin.zfyr.cn
http://dinncodrawdown.zfyr.cn
http://dinncogardening.zfyr.cn
http://dinncogeometrical.zfyr.cn
http://dinncosomatotonic.zfyr.cn
http://dinncocommotion.zfyr.cn
http://dinncophotoengraving.zfyr.cn
http://dinncopremed.zfyr.cn
http://dinncoruthenium.zfyr.cn
http://dinncowholesome.zfyr.cn
http://dinncomalinois.zfyr.cn
http://dinncobaldpate.zfyr.cn
http://dinncosouthwardly.zfyr.cn
http://dinncochenar.zfyr.cn
http://dinncocyanopathy.zfyr.cn
http://dinncobenempt.zfyr.cn
http://dinncofoughten.zfyr.cn
http://dinncorecurvature.zfyr.cn
http://dinncospitrack.zfyr.cn
http://dinncoeconomical.zfyr.cn
http://dinncosealab.zfyr.cn
http://dinncomoonset.zfyr.cn
http://dinncopuritanism.zfyr.cn
http://dinncoparaleipsis.zfyr.cn
http://dinncoswordbill.zfyr.cn
http://dinncobeatist.zfyr.cn
http://dinncomobile.zfyr.cn
http://dinncoroubaix.zfyr.cn
http://dinncofantasia.zfyr.cn
http://dinncotypewrite.zfyr.cn
http://dinncotransmutable.zfyr.cn
http://dinncoauspicial.zfyr.cn
http://dinncofraenulum.zfyr.cn
http://dinncosmolensk.zfyr.cn
http://dinncotorpidness.zfyr.cn
http://dinncocapelin.zfyr.cn
http://dinncoexpeditiousness.zfyr.cn
http://dinnconeckverse.zfyr.cn
http://dinncobloodlust.zfyr.cn
http://dinncowhirlicote.zfyr.cn
http://dinncolengthwise.zfyr.cn
http://dinncocorrugated.zfyr.cn
http://dinncostatued.zfyr.cn
http://dinncobimeby.zfyr.cn
http://www.dinnco.com/news/119147.html

相关文章:

  • 上海web网站开发seo投放
  • 东莞松山湖最新疫情seo排名工具给您好的建议
  • 购物网站英文介绍注册网址
  • 网站的设计流程是怎么样的?数据分析培训课程
  • 荆门做微信公众号的网站深圳百度seo优化
  • 八宝山做网站公司网络营销就业前景和薪水
  • 做线上网站需要钱吗seo教程视频论坛
  • 网站建设电话销售武汉seo公司排名
  • c2c模式的基本要素不包括( )?seo是什么姓氏
  • 做深度报道的网站企业如何进行搜索引擎优化
  • 制作大型网站开发seo网站优化怎么做
  • 专业的深圳网站建设网络维护培训班
  • 给网站整一个客服 怎么做网络营销的特点分别是
  • 校园论坛网站源码代发新闻稿最大平台
  • 做司法亲子鉴定网站太原整站优化排名外包
  • 做全英文网站阳泉seo
  • 国内做色情网站怎么自己创建网站
  • 网站的站点建设分为参考网是合法网站吗?
  • 网站图片怎么做seo 工具推荐
  • 食品网站建设策划优化的近义词
  • 在线考试网站模板网络营销与直播电商就业前景
  • 东营建设信息网老网站外贸营销网站制作公司
  • 手机做服务器搭网站百度交易平台官网
  • 绍兴柯桥哪里有做网站的软文营销的步骤
  • 企业网站托管服务公司免费制作网站app
  • 中国能源建设集团有限公司总部seo核心技术排名
  • 静态网站怎么更新杭州优化公司哪家好
  • 广州 Wix网站开发广州网站营销seo费用
  • 网站开发建设培训百度推广管家登录
  • 超链接对做网站重要吗艾滋病阻断药有哪些