Files
zentao/src/main/resources/mapper/ZtBugMapper.xml
2025-03-26 18:21:47 +08:00

358 lines
13 KiB
XML

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.sa.zentao.mapper.ZtBugMapper">
<resultMap id="BaseResultMap" type="com.sa.zentao.entity.ZtBug">
<result column="id" property="id" />
<result column="project" property="project" />
<result column="product" property="product" />
<result column="injection" property="injection" />
<result column="identify" property="identify" />
<result column="branch" property="branch" />
<result column="module" property="module" />
<result column="execution" property="execution" />
<result column="plan" property="plan" />
<result column="story" property="story" />
<result column="storyVersion" property="storyversion" />
<result column="task" property="task" />
<result column="toTask" property="totask" />
<result column="toStory" property="tostory" />
<result column="title" property="title" />
<result column="keywords" property="keywords" />
<result column="severity" property="severity" />
<result column="pri" property="pri" />
<result column="type" property="type" />
<result column="os" property="os" />
<result column="browser" property="browser" />
<result column="hardware" property="hardware" />
<result column="found" property="found" />
<result column="steps" property="steps" />
<result column="status" property="status" />
<result column="subStatus" property="substatus" />
<result column="color" property="color" />
<result column="confirmed" property="confirmed" />
<result column="activatedCount" property="activatedcount" />
<result column="activatedDate" property="activateddate" />
<result column="feedbackBy" property="feedbackby" />
<result column="notifyEmail" property="notifyemail" />
<result column="mailto" property="mailto" />
<result column="openedBy" property="openedby" />
<result column="openedDate" property="openeddate" />
<result column="openedBuild" property="openedbuild" />
<result column="assignedTo" property="assignedto" />
<result column="assignedDate" property="assigneddate" />
<result column="deadline" property="deadline" />
<result column="resolvedBy" property="resolvedby" />
<result column="resolution" property="resolution" />
<result column="resolvedBuild" property="resolvedbuild" />
<result column="resolvedDate" property="resolveddate" />
<result column="closedBy" property="closedby" />
<result column="closedDate" property="closeddate" />
<result column="duplicateBug" property="duplicatebug" />
<result column="linkBug" property="linkbug" />
<result column="case" property="caseId" />
<result column="caseVersion" property="caseversion" />
<result column="feedback" property="feedback" />
<result column="result" property="result" />
<result column="repo" property="repo" />
<result column="mr" property="mr" />
<result column="entry" property="entry" />
<result column="lines" property="lines" />
<result column="v1" property="v1" />
<result column="v2" property="v2" />
<result column="repoType" property="repotype" />
<result column="issueKey" property="issuekey" />
<result column="testtask" property="testtask" />
<result column="lastEditedBy" property="lasteditedby" />
<result column="lastEditedDate" property="lastediteddate" />
<result column="deleted" property="deleted" />
</resultMap>
<select id="bugPageList" resultType="com.sa.zentao.dao.ZtBugDTO">
SELECT * from zt_bug
WHERE 1=1
<if test="qo.project != null and qo.project != 0">
and project =#{qo.project}
</if>
<if test="qo.id != null and qo.id != 0">
and id = #{qo.id}
</if>
<if test="qo.name != null and qo.name != ''">
and title like concat('%', #{qo.name}, '%')
</if>
<if test="qo.severity != null and qo.severity != ''">
and severity = #{qo.severity}
</if>
<if test="qo.pri != null and qo.pri != ''">
and pri = #{qo.pri}
</if>
<if test="qo.type != null and qo.type != ''">
and `type` = #{qo.type}
</if>
<if test="qo.assignedTo != null and qo.assignedTo != ''">
and assignedTo = #{qo.assignedTo}
</if>
<if test="qo.startDate !=null">
and openedDate <![CDATA[>=]]> #{qo.startDate}
</if>
<if test="qo.endDate !=null">
and openedDate <![CDATA[<=]]> #{qo.endDate}
</if>
<if test="qo.openedby != null and qo.openedby != ''">
and openedby = #{qo.openedby}
</if>
<if test="qo.openStartDate !=null">
and openedDate <![CDATA[>=]]> #{qo.openStartDate}
</if>
<if test="qo.openEndDate !=null">
and openedDate <![CDATA[<=]]> #{qo.openEndDate}
</if>
<if test="qo.execution != null and qo.execution != '' ">
and execution =#{qo.execution}
</if>
<if test="qo.productIds != null and qo.productIds.size() > 0">
and product in
<foreach collection="qo.productIds" item="id" index="index"
open="(" close=")" separator=",">
#{id}
</foreach>
</if>
<if test="qo.objIds != null and qo.objIds.size() > 0">
and id in
<foreach collection="qo.objIds" item="id" index="index"
open="(" close=")" separator=",">
#{id}
</foreach>
</if>
<if test="qo.searchVal == 'ALL' ">
</if>
<if test="qo.searchVal == 'WGB' ">
-- 未关闭
and status !='closed'
</if>
<if test="qo.searchVal == 'YWCJ' ">
-- 由我创建
and openedBy =#{qo.userName}
</if>
<if test="qo.searchVal == 'ZPGW' ">
-- 指派给我
and assignedTo =#{qo.userName}
</if>
<if test="qo.searchVal == 'YWJJ' ">
-- 由我解决
and resolvedBy =#{qo.userName}
and status= 'resolved'
</if>
<if test="qo.searchVal == 'YWZP' ">
-- 由我指派
and openedBy =#{qo.userName}
</if>
<if test="qo.searchVal == 'WJJ' ">
-- //未解决
and status= 'active'
</if>
<if test="qo.searchVal == 'WQR' ">
-- //未确认
and confirmed= 0
</if>
<if test="qo.searchVal == 'WZP' ">
-- //未指派
and assignedTo is null
</if>
<if test="qo.searchVal == 'JWCL' ">
-- //久未处理
</if>
<if test="qo.searchVal == 'DGB' ">
-- //待关闭
</if>
<if test="qo.searchVal == 'BYQ' ">
-- //被延期
</if>
<if test="qo.searchVal == 'GQ' ">
-- //过期BUG
</if>
<if test="qo.searchVal == 'XQBD' ">
-- //研发需求变动
</if>
<choose>
<when test="qo.orderName != '' and qo.orderName != null ">
<choose>
<when test="qo.orderSort != '' and qo.orderSort != null ">
order by ${qo.orderName} ${qo.orderSort}
</when>
<otherwise>
order by id desc
</otherwise>
</choose>
</when>
<otherwise>
order by id desc
</otherwise>
</choose>
</select>
<select id="myBugPageList" resultType="com.sa.zentao.dao.ZtBugDTO">
SELECT s.*,pt.name productName from zt_bug s left join zt_product pt on s.product = pt.id
WHERE 1=1
<if test="qo.id != null and qo.id != 0">
and s.id = #{qo.id}
</if>
<if test="qo.name != null and qo.name != ''">
and s.title like concat('%', #{qo.name}, '%')
</if>
<if test="qo.severity != null and qo.severity != ''">
and s.severity = #{qo.severity}
</if>
<if test="qo.pri != null and qo.pri != ''">
and pri = #{qo.pri}
</if>
<if test="qo.type != null and qo.type != ''">
and s.`type` = #{qo.type}
</if>
<if test="qo.assignedTo != null and qo.assignedTo != ''">
and s.assignedTo = #{qo.assignedTo}
</if>
<if test="qo.openedby != null and qo.openedby != ''">
and s.openedby = #{qo.openedby}
</if>
<if test="qo.openStartDate !=null">
and s.openedDate <![CDATA[>=]]> #{qo.openStartDate}
</if>
<if test="qo.openEndDate !=null">
and s.openedDate <![CDATA[<=]]> #{qo.openEndDate}
</if>
<if test="qo.startDate !=null">
and s.deadline <![CDATA[>=]]> #{qo.startDate}
</if>
<if test="qo.endDate !=null">
and s.deadline <![CDATA[<=]]> #{qo.endDate}
</if>
<if test="qo.productName != null and qo.productName != '' ">
and pt.name like concat('%', #{qo.productName}, '%')
</if>
<if test="qo.objIds != null and qo.objIds.size() > 0">
and s.id in
<foreach collection="qo.objIds" item="id" index="index"
open="(" close=")" separator=",">
#{id}
</foreach>
</if>
<if test="qo.projectIds != null and qo.projectIds.size() > 0">
and s.project in
<foreach collection="qo.projectIds" item="id" index="index"
open="(" close=")" separator=",">
#{id}
</foreach>
</if>
<if test="qo.searchVal == 'ALL' ">
</if>
<if test="qo.searchVal == 'WGB' ">
-- 未关闭
and s.status !='closed'
</if>
<if test="qo.searchVal == 'YWCJ' ">
-- 由我创建
and s.openedBy =#{qo.userName}
</if>
<if test="qo.searchVal == 'ZPGW' ">
-- 指派给我
and s.assignedTo =#{qo.userName}
</if>
<if test="qo.searchVal == 'YWJJ' ">
-- 由我解决
and resolvedBy =#{qo.userName}
and s.status= 'resolved'
</if>
<if test="qo.searchVal == 'YWZP' ">
-- 由我指派
and s.openedBy =#{qo.userName}
</if>
<if test="qo.searchVal == 'WJJ' ">
-- //未解决
and s.status= 'active'
</if>
<if test="qo.searchVal == 'WQR' ">
-- //未确认
and s.confirmed= 0
</if>
<if test="qo.searchVal == 'WZP' ">
-- //未指派
and s.assignedTo is null
</if>
<if test="qo.searchVal == 'JWCL' ">
-- //久未处理
</if>
<if test="qo.searchVal == 'DGB' ">
-- //待关闭
</if>
<if test="qo.searchVal == 'BYQ' ">
-- //被延期
</if>
<if test="qo.searchVal == 'GQ' ">
-- //过期BUG
</if>
<if test="qo.searchVal == 'XQBD' ">
-- //研发需求变动
</if>
order by id desc
</select>
</mapper>