一、基本信息

1、登陆机器    ssh lina02@mjump.missfresh.net -p2222

二、问题

1、分页问题:job_id为空时能查询出来(笛卡尔乘积),需要加上AND res.job_id IS NOT NULL AND task.job_id IS NOT NULL AND res.job_id !='' AND task.job_id !=''

    <resultMap id="dtoMap" type="com.mryx.matrix.codeanalyzer.dto.CodeScanTaskDto">
<id column="id" property="id" jdbcType="INTEGER"/>
<association property="codeScanResult" javaType="com.mryx.matrix.codeanalyzer.domain.CodeScanResult">
<id column="id" property="id" jdbcType="INTEGER"/>
<result column="blocker" property="blocker" jdbcType="INTEGER"/>
<result column="critical" property="critical" jdbcType="INTEGER"/>
<result column="major" property="major" jdbcType="INTEGER"/>
<result column="minor" property="minor" jdbcType="INTEGER"/>
<result column="info" property="info" jdbcType="INTEGER"/>
<result column="status" property="status" jdbcType="INTEGER"/>
<result column="blockerResultUrl" property="blockerResultUrl" jdbcType="VARCHAR"/>
<result column="criticalResultUrl" property="criticalResultUrl" jdbcType="VARCHAR"/>
<result column="majorResultUrl" property="majorResultUrl" jdbcType="VARCHAR"/>
</association>
<association property="projectCodeScanTask" javaType="com.mryx.matrix.codeanalyzer.domain.ProjectCodeScanTask">
<id column="id" property="id" jdbcType="INTEGER"/>
<result column="task_name" property="taskName" jdbcType="VARCHAR"/>
<result column="app_code" property="appCode" jdbcType="VARCHAR"/>
<result column="mode_of_scan" property="modeOfScan" jdbcType="SMALLINT"/>
<result column="app_branch" property="appBranch" jdbcType="VARCHAR"/>
<result column="user_name" property="userName" jdbcType="VARCHAR"/>
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
</association>
</resultMap> <sql id="conditions">
<if test="id != null ">and id = #{id,jdbcType=INTEGER}</if>
<if test="taskName != null and taskName != '' ">and task_name like '%${taskName}%'</if>
<if test="appCode != null and appCode != '' ">and app_code like '%${appCode}%'</if>
<if test="modeOfScan != null ">and mode_of_scan = #{modeOfScan,jdbcType=INTEGER}</if>
<if test="appBranch != null and appBranch != '' ">and app_branch = #{appBranch,jdbcType=VARCHAR}</if>
<if test="baseVersion != null and baseVersion != '' ">and base_version = #{baseVersion,jdbcType=INTEGER}</if>
<if test="compareVersion != null and compareVersion != '' ">and compare_version =
#{compareVersion,jdbcType=VARCHAR}
</if>
<if test="timeTrigger != null and timeTrigger != '' ">and time_trigger = #{timeTrigger,jdbcType=TIMESTAMP}</if>
<if test="userName != null and userName != '' ">and user_name = #{userName,jdbcType=VARCHAR}</if>
<if test="createTime != null and createTime != '' ">and create_time = #{createTime,jdbcType=TIMESTAMP}</if>
<if test="updateTime != null and updateTime != '' ">and update_time = #{updateTime,jdbcType=TIMESTAMP}</if>
</sql> <select id="getCodeScanTask" resultMap="dtoMap"
parameterType="com.mryx.matrix.codeanalyzer.domain.ProjectCodeScanTask">
SELECT task.id,task.task_name,task.app_code,task.mode_of_scan,task.app_branch,task.user_name,task.update_time,
res.blocker,res.critical,res.major,res.minor,res.info,res.status,res.blocker_result_url,res.critical_result_url,res.major_result_url
FROM project_codescan_task AS task INNER JOIN code_scan_result AS res ON task.job_id=res.job_id
WHERE 1=1 AND res.job_id IS NOT NULL AND task.job_id IS NOT NULL AND res.job_id !='' AND task.job_id !=''
<include refid="conditions"/>
ORDER BY task.id DESC
limit #{startOfPage},#{pageSize}
</select> <!-- 分页查询总数 -->
<select id="pageTotal" resultType="java.lang.Integer"
parameterType="com.mryx.matrix.codeanalyzer.domain.ProjectCodeScanTask">
SELECT count(*)
FROM project_codescan_task AS task INNER JOIN code_scan_result AS res ON task.job_id=res.job_id
WHERE 1=1 AND res.job_id IS NOT NULL AND task.job_id IS NOT NULL AND res.job_id !='' AND task.job_id !=''
<include refid="conditions"/>
</select>

2、insert数据库问题: 字段属性有NOT NULL属性,mapper文件中的sql语句没有为该字段写值,导致插入不了数据库,字段需要有DEFAULT属性

3、实体类中的属性是驼峰命名的时候,mapper中的sql语句需要使用resultMap

    <resultMap id="sonarMap" type="com.mryx.matrix.codeanalyzer.domain.CodeScanResult">
<id column="id" property="id" jdbcType="INTEGER"/>
<result column="task_name" property="taskName" jdbcType="VARCHAR"/>
<result column="app_code" property="appCode" jdbcType="VARCHAR"/>
<result column="type_of_scan" property="typeOfScan" jdbcType="SMALLINT"/>
<result column="mode_of_scan" property="modeOfScan" jdbcType="SMALLINT"/>
<result column="code_branch" property="codeBranch" jdbcType="VARCHAR"/>
<result column="user_name" property="userName" jdbcType="VARCHAR"/>
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
<result column="blocker" property="blocker" jdbcType="INTEGER"/>
<result column="critical" property="critical" jdbcType="INTEGER"/>
<result column="major" property="major" jdbcType="INTEGER"/>
<result column="minor" property="minor" jdbcType="INTEGER"/>
<result column="info" property="info" jdbcType="INTEGER"/>
<result column="status" property="status" jdbcType="INTEGER"/>
<result column="blocker_result_url" property="blockerResultUrl" jdbcType="VARCHAR"/>
<result column="critical_result_url" property="criticalResultUrl" jdbcType="VARCHAR"/>
<result column="major_result_url" property="majorResultUrl" jdbcType="VARCHAR"/>
</resultMap> <!-- 分页查询 -->
<select id="getCodeScanTask" resultMap="sonarMap"
resultType="com.mryx.matrix.codeanalyzer.domain.CodeScanResult">
SELECT
id,task_name,app_code,type_of_scan,mode_of_scan,code_branch,user_name,update_time,
blocker,critical,major,minor,info,status,blocker_result_url,critical_result_url,major_result_url
FROM code_scan_result WHERE manual_or_automatic != 0
<include refid="conditions"/>
ORDER BY id DESC
limit #{startOfPage},#{pageSize}
</select>

  发邮件:https://www.cnblogs.com/sea520/p/4565273.html

missfresh问题记录的更多相关文章

  1. 记一次debug记录:Uncaught SyntaxError: Unexpected token ILLEGAL

    在使用FIS3搭建项目的时候,遇到了一些问题,这里记录下. 这里是发布搭建代码: // 代码发布时 fis.media('qa') .match('*.{js,css,png}', { useHash ...

  2. nginx配置反向代理或跳转出现400问题处理记录

    午休完上班后,同事说测试站点访问接口出现400 Bad Request  Request Header Or Cookie Too Large提示,心想还好是测试服务器出现问题,影响不大,不过也赶紧上 ...

  3. Kali对wifi的破解记录

    好记性不如烂笔头,记录一下. 我是在淘宝买的拓实N87,Kali可以识别,还行. 操作系统:Kali 开始吧. 查看一下网卡的接口.命令如下 airmon-ng 可以看出接口名称是wlan0mon. ...

  4. 2015 西雅图微软总部MVP峰会记录

    2015 西雅图微软总部MVP峰会记录 今年决定参加微软MVP全球峰会,在出发之前本人就已经写这篇博客,希望将本次会议原汁原味奉献给大家 因为这次是本人第一次写会议记录,写得不好的地方希望各位园友见谅 ...

  5. 分享一个SQLSERVER脚本(计算数据库中各个表的数据量和每行记录所占用空间)

    分享一个SQLSERVER脚本(计算数据库中各个表的数据量和每行记录所占用空间) 很多时候我们都需要计算数据库中各个表的数据量和每行记录所占用空间 这里共享一个脚本 CREATE TABLE #tab ...

  6. 我是如何在SQLServer中处理每天四亿三千万记录的

    首先声明,我只是个程序员,不是专业的DBA,以下这篇文章是从一个问题的解决过程去写的,而不是一开始就给大家一个正确的结果,如果文中有不对的地方,请各位数据库大牛给予指正,以便我能够更好的处理此次业务. ...

  7. 前端学HTTP之日志记录

    前面的话 几乎所有的服务器和代理都会记录下它们所处理的HTTP事务摘要.这么做出于一系列的原因:跟踪使用情况.安全性.计费.错误检测等等.本文将谥介绍日志记录 记录内容 大多数情况下,日志的记录出于两 ...

  8. ASP.NET Core应用中如何记录和查看日志

    日志记录不仅对于我们开发的应用,还是对于ASP.NET Core框架功能都是一项非常重要的功能特性.我们知道ASP.NET Core使用的是一个极具扩展性的日志系统,该系统由Logger.Logger ...

  9. python+uwsgi导致redis无法长链接引起性能下降问题记录

    今天在部署python代码到预生产环境时,web站老是出现redis链接未初始化,无法连接到服务的提示,比对了一下开发环境与测试环境代码,完全一致,然后就是查看各种日志,排查了半天也没有查明是什么原因 ...

随机推荐

  1. 团队作业第5周——测试与发布(Alpha版本)

    1.发现的bug a.同时按下和蛇前进方向相反的键和垂直方向的任意一个键贪吃蛇会死亡(比如贪吃蛇向右行走,同时按左上或左下都会game over) b.刷新的苹果会在蛇身上出现 暂时还没能力修复,以后 ...

  2. CodeForces Div1: 995 D. Game(数学期望)

    Allen and Bessie are playing a simple number game. They both know a function f:{0,1}n→Rf:{0,1}n→R, i ...

  3. 「NOIP2016」「P1850」 换教室(期望dp

    题目描述 对于刚上大学的牛牛来说,他面临的第一个问题是如何根据实际情况申请合适的课程. 在可以选择的课程中,有 2n2n 节课程安排在 nn 个时间段上.在第 ii(1 \leq i \leq n1≤ ...

  4. ACM学习历程——POJ3468 A Simple Problem with Integers(线段树)

    Description You have N integers, A1, A2, ... , AN. You need to deal with two kinds of operations. On ...

  5. 洛谷 P4512 [模板] 多项式除法

    题目:https://www.luogu.org/problemnew/show/P4512 看博客:https://www.cnblogs.com/owenyu/p/6724611.html htt ...

  6. 抽屉header

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  7. SpringMVC之一:SpringMVC原理

    Spring MVC工作流程图   图一   图二  关键组件: DispatcherServlet:前端控制器,与大多数基于Java的Web框架一样, Spring MVC所有的请求都会通过一个前端 ...

  8. Behave + Selenium(Python) 二

    介绍feature, py文件和之间关系: example01.feature文件包括5行: Feature行: 介绍这个feature用来干什么的: Scenario行:介绍这个scenario用来 ...

  9. <正则吃饺子> :关于oracle 中 with的简单使用

    oracle中 with的简单使用介绍,具体可以参见其他的博文介绍,在这里只是简单的介绍: with 构建了一个临时表,类似于存储过程中的游标,我是这么理解的. 一.数据准备: select * fr ...

  10. MultiBinding的StringFormat参数问题

    在wpf的绑定中,我们会用到多值绑定,如下: <MultiBinding Mode="OneWay" StringFormat="{3}({0}/{1}):{2}& ...