616 lines
21 KiB
XML
616 lines
21 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.ZtStoryMapper">
|
|
<resultMap id="BaseResultMap" type="com.sa.zentao.entity.ZtStory">
|
|
<result column="id" property="id" />
|
|
<result column="vision" property="vision" />
|
|
<result column="parent" property="parent" />
|
|
<result column="product" property="product" />
|
|
<result column="branch" property="branch" />
|
|
<result column="module" property="module" />
|
|
<result column="plan" property="plan" />
|
|
<result column="source" property="source" />
|
|
<result column="sourceNote" property="sourcenote" />
|
|
<result column="fromBug" property="frombug" />
|
|
<result column="feedback" property="feedback" />
|
|
<result column="title" property="title" />
|
|
<result column="keywords" property="keywords" />
|
|
<result column="type" property="type" />
|
|
<result column="category" property="category" />
|
|
<result column="pri" property="pri" />
|
|
<result column="estimate" property="estimate" />
|
|
<result column="status" property="status" />
|
|
<result column="subStatus" property="substatus" />
|
|
<result column="color" property="color" />
|
|
<result column="stage" property="stage" />
|
|
<result column="stagedBy" property="stagedby" />
|
|
<result column="mailto" property="mailto" />
|
|
<result column="lib" property="lib" />
|
|
<result column="fromStory" property="fromstory" />
|
|
<result column="fromVersion" property="fromversion" />
|
|
<result column="openedBy" property="openedby" />
|
|
<result column="openedDate" property="openeddate" />
|
|
<result column="assignedTo" property="assignedto" />
|
|
<result column="assignedDate" property="assigneddate" />
|
|
<result column="approvedDate" property="approveddate" />
|
|
<result column="lastEditedBy" property="lasteditedby" />
|
|
<result column="lastEditedDate" property="lastediteddate" />
|
|
<result column="changedBy" property="changedby" />
|
|
<result column="changedDate" property="changeddate" />
|
|
<result column="reviewedBy" property="reviewedby" />
|
|
<result column="reviewedDate" property="revieweddate" />
|
|
<result column="releasedDate" property="releaseddate" />
|
|
<result column="closedBy" property="closedby" />
|
|
<result column="closedDate" property="closeddate" />
|
|
<result column="closedReason" property="closedreason" />
|
|
<result column="activatedDate" property="activateddate" />
|
|
<result column="toBug" property="tobug" />
|
|
<result column="childStories" property="childstories" />
|
|
<result column="linkStories" property="linkstories" />
|
|
<result column="linkRequirements" property="linkrequirements" />
|
|
<result column="twins" property="twins" />
|
|
<result column="duplicateStory" property="duplicatestory" />
|
|
<result column="version" property="version" />
|
|
<result column="storyChanged" property="storychanged" />
|
|
<result column="feedbackBy" property="feedbackby" />
|
|
<result column="notifyEmail" property="notifyemail" />
|
|
<result column="BSA" property="bsa" />
|
|
<result column="duration" property="duration" />
|
|
<result column="demand" property="demand" />
|
|
<result column="submitedBy" property="submitedby" />
|
|
<result column="roadmap" property="roadmap" />
|
|
<result column="URChanged" property="urchanged" />
|
|
<result column="deleted" property="deleted" />
|
|
</resultMap>
|
|
<select id="pageList" resultType="com.sa.zentao.dao.ZtStoryDTO">
|
|
|
|
select s.*,sp.spec ,sp.verify,sp.files from zt_story s
|
|
left join zt_storyreview v on s.id = v.story and s.version = v.version
|
|
left join zt_storyspec sp on s.id = sp.story
|
|
where 1=1
|
|
and product = #{qo.productId}
|
|
|
|
<if test="qo.searchVal == 'ALL' ">
|
|
|
|
</if>
|
|
<if test="qo.searchVal == 'WGB' ">
|
|
and s.status != 'closed'
|
|
|
|
</if>
|
|
<if test="qo.searchVal != null and qo.searchVal == 'ZGW' ">
|
|
and s.assignedTo= #{qo.userName}
|
|
</if>
|
|
<if test="qo.searchVal != null and qo.searchVal == 'WCJ' ">
|
|
and s.openedBy= #{qo.userName}
|
|
</if>
|
|
|
|
<if test="qo.searchVal != null and qo.searchVal == 'YWPS' ">
|
|
and v.reviewer = #{qo.userName}
|
|
and s.status ='reviewing'
|
|
and v.result = ''
|
|
</if>
|
|
|
|
<if test="qo.searchVal != null and qo.searchVal == 'JH' ">
|
|
and s.status = 'active'
|
|
</if>
|
|
<if test="qo.searchVal != null and qo.searchVal == 'YGB' ">
|
|
and s.status = 'closed'
|
|
</if>
|
|
|
|
<if test="qo.searchVal != null and qo.searchVal == 'DGB' ">
|
|
and s.stage = 'verified' and s.ys_flag =1
|
|
</if>
|
|
<if test="qo.searchVal != null and qo.searchVal == 'BGZ' ">
|
|
and s.status = '11'
|
|
</if>
|
|
|
|
<if test="qo.searchVal != null and qo.searchVal == 'WZP' ">
|
|
and s.status = '11'
|
|
</if>
|
|
|
|
<if test="qo.searchVal != null and qo.searchVal == 'WPS' ">
|
|
and s.reviewedBy like concat('%', #{qo.userName}, '%')
|
|
</if>
|
|
|
|
|
|
<if test="qo.searchVal != null and qo.searchVal == 'PSZ' ">
|
|
and s.status = 'reviewing'
|
|
</if>
|
|
|
|
<if test="qo.searchVal != null and qo.searchVal == 'DYS' ">
|
|
and ( s.stage = 'released'
|
|
and s.ys_flag =0)
|
|
or (s.stage = 'verified' and s.ys_flag =2)
|
|
</if>
|
|
|
|
<if test="qo.id != null ">
|
|
and s.id = #{qo.id}
|
|
</if>
|
|
<if test="qo.title != null and qo.title != '' ">
|
|
and s.title = #{qo.title}
|
|
</if>
|
|
<if test="qo.module != null and qo.module != '' ">
|
|
and s.module = #{qo.module}
|
|
</if>
|
|
|
|
<if test="qo.searchVal != null and qo.searchVal == 'YWGB' ">
|
|
and s.status ='closed'
|
|
and closedBy =#{qo.userName}
|
|
</if>
|
|
|
|
|
|
|
|
|
|
|
|
group by s.id
|
|
|
|
|
|
<choose>
|
|
<when test="qo.orderName != '' and qo.orderName != null ">
|
|
<choose>
|
|
<when test="qo.orderSort != '' and qo.orderSort != null ">
|
|
order by s.${qo.orderName} ${qo.orderSort}
|
|
</when>
|
|
<otherwise>
|
|
order by s.id desc
|
|
</otherwise>
|
|
</choose>
|
|
</when>
|
|
<otherwise>
|
|
order by s.id desc
|
|
</otherwise>
|
|
</choose>
|
|
|
|
|
|
|
|
|
|
-- order by id desc
|
|
|
|
|
|
</select>
|
|
<select id="projectStoryPageList" resultType="com.sa.zentao.dao.ZtStoryDTO">
|
|
|
|
|
|
|
|
|
|
|
|
select s.*,sp.spec ,sp.verify,sp.files,pt.name productName from (zt_story s,zt_projectstory ps ) left join zt_storyspec sp on s.id = sp.story
|
|
|
|
left join zt_storyreview v on s.id = v.story and s.version = v.version
|
|
left join zt_projectstory pstory on s.id = pstory.story and pstory.execution =0
|
|
left join zt_project pj on pstory.project = pj.id
|
|
left join zt_product pt on s.product = pt.id
|
|
WHERE s.id = ps.story
|
|
|
|
|
|
<if test="qo.startDate !=null">
|
|
and s.openedDate <![CDATA[>=]]> #{qo.startDate}
|
|
</if>
|
|
<if test="qo.endDate !=null">
|
|
and s.openedDate <![CDATA[<=]]> #{qo.endDate}
|
|
</if>
|
|
|
|
|
|
|
|
<if test="qo.productName != null and qo.productName != '' ">
|
|
and pt.name like concat('%', #{qo.productName}, '%')
|
|
</if>
|
|
|
|
<if test="qo.project != null ">
|
|
and ps.project =#{qo.project}
|
|
</if>
|
|
<if test="qo.execution != null ">
|
|
and ps.project =#{qo.execution}
|
|
</if>
|
|
<if test="qo.module != null ">
|
|
and s.module =#{qo.module}
|
|
</if>
|
|
<if test="qo.searchVal != null and qo.searchVal == 'ALL' ">
|
|
|
|
</if>
|
|
<if test="qo.searchVal != null and qo.searchVal == 'WGB' ">
|
|
and s.status !='closed'
|
|
</if>
|
|
<if test="qo.searchVal != null and qo.searchVal == 'ZGW' ">
|
|
and s.assignedTo = #{qo.userName}
|
|
</if>
|
|
|
|
<if test="qo.kfz == 1 ">
|
|
<if test="qo.userName != null and qo.userName != '' ">
|
|
|
|
and s.assignedTo = #{qo.userName}
|
|
or s.openedBy = #{qo.userName}
|
|
</if>
|
|
|
|
</if>
|
|
|
|
<if test="qo.searchVal != null and qo.searchVal == 'WCJ' ">
|
|
and s.openedBy = #{qo.userName}
|
|
</if>
|
|
<if test="qo.searchVal != null and qo.searchVal == 'YWPS' ">
|
|
and v.reviewer = #{qo.userName}
|
|
and s.status ='reviewing'
|
|
and v.result = ''
|
|
</if>
|
|
|
|
|
|
|
|
<if test="qo.searchVal == 'JH' ">
|
|
and s.status = 'active'
|
|
</if>
|
|
<if test="qo.searchVal == 'YGB' ">
|
|
and s.status = 'closed'
|
|
</if>
|
|
|
|
<if test="qo.searchVal == 'DGB' ">
|
|
and s.stage = 'verified' and s.ys_flag =1
|
|
</if>
|
|
<if test="qo.searchVal == 'BGZ' ">
|
|
and s.status = '11'
|
|
</if>
|
|
|
|
<if test="qo.searchVal == 'WZP' ">
|
|
and s.status = '11'
|
|
</if>
|
|
|
|
<if test="qo.searchVal == 'WPS' ">
|
|
and s.reviewedBy like concat('%', #{qo.userName}, '%')
|
|
</if>
|
|
|
|
|
|
<if test="qo.searchVal == 'PSZ' ">
|
|
and s.status = 'reviewing'
|
|
</if>
|
|
|
|
<if test="qo.searchVal == 'DYS' ">
|
|
|
|
and ( s.stage = 'released'
|
|
and s.ys_flag =0)
|
|
or (s.stage = 'verified' and s.ys_flag =2)
|
|
</if>
|
|
<if test="qo.searchVal != null and qo.searchVal == 'YWGB' ">
|
|
and s.status ='closed'
|
|
and closedBy =#{qo.userName}
|
|
</if>
|
|
|
|
|
|
<if test="qo.searchCode != null and qo.searchCode != '' ">
|
|
|
|
-- //项目名称
|
|
<if test="qo.searchCode=='xmmc' and qo.searchValue != null and qo.searchValue != '' ">
|
|
and pj.name like concat('%', #{qo.searchValue}, '%')
|
|
</if>
|
|
-- 项目id
|
|
<if test="qo.searchCode=='xmid' and qo.searchValue != null and qo.searchValue != '' ">
|
|
and pj.id =#{qo.searchValue}
|
|
</if>
|
|
|
|
-- //需求名称
|
|
<if test="qo.searchCode=='xqmc' and qo.searchValue != null and qo.searchValue != '' ">
|
|
and s.title like concat('%', #{qo.searchValue}, '%')
|
|
</if>
|
|
-- 需求id
|
|
<if test="qo.searchCode=='xqid' and qo.searchValue != null and qo.searchValue != '' ">
|
|
and s.id =#{qo.searchValue}
|
|
</if>
|
|
|
|
-- 状态
|
|
<if test="qo.searchCode=='zt' and qo.searchValue != null and qo.searchValue != '' ">
|
|
and s.stage =#{qo.searchValue}
|
|
</if>
|
|
-- 项目描述
|
|
<if test="qo.searchCode=='xmms' and qo.searchValue != null and qo.searchValue != '' ">
|
|
and sp.`spec` =#{qo.searchValue}
|
|
</if>
|
|
-- 负责人
|
|
|
|
<if test="qo.searchCode=='fzr' and qo.searchValue != null and qo.searchValue != '' ">
|
|
and s.assignedTo =#{qo.searchValue}
|
|
</if>
|
|
|
|
<if test="qo.searchCode=='jhwc' and qo.searchValue != null and qo.searchValue != '' ">
|
|
and s.plan_end_date ${qo.searchValue}
|
|
</if>
|
|
|
|
<if test="qo.searchCode=='sjks' and qo.searchValue != null and qo.searchValue != '' ">
|
|
and s.start_date ${qo.searchValue}
|
|
</if>
|
|
<if test="qo.searchCode=='sjwc' and qo.searchValue != null and qo.searchValue != '' ">
|
|
and s.end_date ${qo.searchValue}
|
|
</if>
|
|
<if test="qo.searchCode=='yscj' and qo.searchValue != null and qo.searchValue != '' ">
|
|
and s.openedBy = #{qo.searchValue}
|
|
</if>
|
|
<if test="qo.searchCode=='ysgb' and qo.searchValue != null and qo.searchValue != '' ">
|
|
and s.closedBy = #{qo.searchValue}
|
|
</if>
|
|
</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>
|
|
|
|
|
|
group by s.id
|
|
|
|
<choose>
|
|
<when test="qo.orderName != '' and qo.orderName != null ">
|
|
<choose>
|
|
<when test="qo.orderSort != '' and qo.orderSort != null ">
|
|
order by s.${qo.orderName} ${qo.orderSort}
|
|
</when>
|
|
<otherwise>
|
|
order by s.id desc
|
|
</otherwise>
|
|
</choose>
|
|
</when>
|
|
<otherwise>
|
|
order by s.id desc
|
|
</otherwise>
|
|
</choose>
|
|
|
|
</select>
|
|
|
|
<select id="getPrdById" resultType="com.sa.zentao.entity.ZtStory">
|
|
SELECT * from zt_story WHERE id = #{id}
|
|
|
|
</select>
|
|
<select id="allStoryPageList" resultType="com.sa.zentao.dao.ZtStoryDTO">
|
|
|
|
|
|
select s.*,sp.spec ,sp.verify,sp.files from zt_story s left join zt_storyspec sp on s.id = sp.story
|
|
left join zt_storyreview v on s.id = v.story and s.version = v.version
|
|
WHERE 1=1
|
|
|
|
<if test="qo.project != null ">
|
|
and ps.project =#{qo.project}
|
|
</if>
|
|
<if test="qo.execution != null ">
|
|
and ps.execution =#{qo.execution}
|
|
</if>
|
|
<if test="qo.module != null ">
|
|
and s.module =#{qo.module}
|
|
</if>
|
|
<if test="qo.searchVal != null and qo.searchVal == 'ALL' ">
|
|
|
|
</if>
|
|
<if test="qo.searchVal != null and qo.searchVal == 'WGB' ">
|
|
and s.status !='closed'
|
|
</if>
|
|
<if test="qo.searchVal != null and qo.searchVal == 'ZGW' ">
|
|
and s.assignedTo = #{qo.userName}
|
|
</if>
|
|
|
|
<if test="qo.searchVal != null and qo.searchVal == 'INDEX' ">
|
|
<if test="qo.userName != null and qo.userName != '' ">
|
|
|
|
and s.assignedTo = #{qo.userName}
|
|
or s.openedBy = #{qo.userName}
|
|
</if>
|
|
|
|
</if>
|
|
|
|
<if test="qo.searchVal != null and qo.searchVal == 'WCJ' ">
|
|
and s.openedBy = #{qo.userName}
|
|
</if>
|
|
<if test="qo.searchVal != null and qo.searchVal == 'YWPS' ">
|
|
and v.reviewer = #{qo.userName}
|
|
and s.status ='reviewing'
|
|
and v.result = ''
|
|
</if>
|
|
|
|
|
|
<if test="qo.searchVal == 'JH' ">
|
|
and s.status = 'active'
|
|
</if>
|
|
<if test="qo.searchVal == 'YGB' ">
|
|
and s.status = 'closed'
|
|
</if>
|
|
|
|
<if test="qo.searchVal == 'DGB' ">
|
|
and s.stage = 'verified'
|
|
and s.ys_flag =1
|
|
</if>
|
|
<if test="qo.searchVal == 'BGZ' ">
|
|
and s.status = '11'
|
|
</if>
|
|
|
|
<if test="qo.searchVal == 'WZP' ">
|
|
and s.status = '11'
|
|
</if>
|
|
|
|
<if test="qo.searchVal == 'WPS' ">
|
|
and s.reviewedBy like concat('%', #{qo.userName}, '%')
|
|
</if>
|
|
|
|
|
|
<if test="qo.searchVal == 'PSZ' ">
|
|
and s.status = 'reviewing'
|
|
</if>
|
|
|
|
<if test="qo.searchVal == 'DYS' ">
|
|
and ( s.stage = 'released'
|
|
and s.ys_flag =0)
|
|
or (s.stage = 'verified' and s.ys_flag =2)
|
|
</if>
|
|
<if test="qo.searchVal != null and qo.searchVal == 'YWGB' ">
|
|
and s.status ='closed'
|
|
and closedBy =#{qo.userName}
|
|
</if>
|
|
|
|
group by s.id
|
|
|
|
<choose>
|
|
<when test="qo.orderName != '' and qo.orderName != null ">
|
|
<choose>
|
|
<when test="qo.orderSort != '' and qo.orderSort != null ">
|
|
order by s.${qo.orderName} ${qo.orderSort}
|
|
</when>
|
|
<otherwise>
|
|
order by s.id desc
|
|
</otherwise>
|
|
</choose>
|
|
</when>
|
|
<otherwise>
|
|
order by s.id desc
|
|
</otherwise>
|
|
</choose>
|
|
|
|
</select>
|
|
<select id="myStoryPageList" resultType="com.sa.zentao.dao.ZtStoryDTO">
|
|
select s.*,sp.spec ,sp.verify,sp.files ,pt.name productName from zt_story s left join zt_storyspec sp on s.id = sp.story
|
|
left join zt_product pt on s.product = pt.id
|
|
left join zt_storyreview v on s.id = v.story and s.version = v.version
|
|
WHERE 1=1
|
|
|
|
<if test="qo.productIds != null and qo.productIds.size() > 0">
|
|
and s.product in
|
|
<foreach collection="qo.productIds" item="id" index="index"
|
|
open="(" close=")" separator=",">
|
|
#{id}
|
|
</foreach>
|
|
</if>
|
|
|
|
|
|
<if test="qo.startDate !=null">
|
|
and s.openedDate <![CDATA[>=]]> #{qo.startDate}
|
|
</if>
|
|
<if test="qo.endDate !=null">
|
|
and s.openedDate <![CDATA[<=]]> #{qo.endDate}
|
|
</if>
|
|
|
|
|
|
|
|
<if test="qo.productName != null and qo.productName != '' ">
|
|
and pt.name like concat('%', #{qo.productName}, '%')
|
|
</if>
|
|
|
|
<if test="qo.project != null ">
|
|
and ps.project =#{qo.project}
|
|
</if>
|
|
<if test="qo.execution != null ">
|
|
and ps.execution =#{qo.execution}
|
|
</if>
|
|
<if test="qo.module != null ">
|
|
and s.module =#{qo.module}
|
|
</if>
|
|
<if test="qo.searchVal != null and qo.searchVal == 'ALL' ">
|
|
|
|
</if>
|
|
<if test="qo.searchVal != null and qo.searchVal == 'WGB' ">
|
|
and s.status !='closed'
|
|
|
|
</if>
|
|
<if test="qo.searchVal != null and qo.searchVal == 'ZGW' ">
|
|
and s.assignedTo = #{qo.userName}
|
|
</if>
|
|
|
|
<if test="qo.searchVal != null and qo.searchVal == 'INDEX' ">
|
|
<if test="qo.userName != null and qo.userName != '' ">
|
|
|
|
and s.assignedTo = #{qo.userName}
|
|
or s.openedBy = #{qo.userName}
|
|
</if>
|
|
|
|
</if>
|
|
|
|
<if test="qo.searchVal != null and qo.searchVal == 'WCJ' ">
|
|
and s.openedBy = #{qo.userName}
|
|
</if>
|
|
<if test="qo.searchVal != null and qo.searchVal == 'YWPS' ">
|
|
and v.reviewer = #{qo.userName}
|
|
and s.status ='reviewing'
|
|
and v.result = ''
|
|
</if>
|
|
|
|
<if test="qo.searchVal == 'JH' ">
|
|
and s.status = 'active'
|
|
</if>
|
|
<if test="qo.searchVal == 'YGB' ">
|
|
and s.status = 'closed'
|
|
</if>
|
|
|
|
<if test="qo.searchVal == 'DGB' ">
|
|
and s.stage = 'verified' and s.ys_flag =1
|
|
</if>
|
|
|
|
<if test="qo.searchVal == 'BGZ' ">
|
|
and s.status = '11'
|
|
</if>
|
|
|
|
<if test="qo.searchVal == 'WZP' ">
|
|
and s.status = '11'
|
|
</if>
|
|
|
|
<if test="qo.searchVal == 'WPS' ">
|
|
and s.reviewedBy like concat('%', #{qo.userName}, '%')
|
|
</if>
|
|
|
|
|
|
<if test="qo.searchVal == 'PSZ' ">
|
|
and s.status = 'reviewing'
|
|
</if>
|
|
|
|
<if test="qo.searchVal == 'DYS' ">
|
|
and ( s.stage = 'released'
|
|
and s.ys_flag =0)
|
|
or (s.stage = 'verified' and s.ys_flag =2)
|
|
</if>
|
|
|
|
<if test="qo.searchVal != null and qo.searchVal == 'YWGB' ">
|
|
and s.status ='closed'
|
|
and closedBy =#{qo.userName}
|
|
</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>
|
|
|
|
group by s.id
|
|
|
|
<choose>
|
|
<when test="qo.orderName != '' and qo.orderName != null ">
|
|
<choose>
|
|
<when test="qo.orderSort != '' and qo.orderSort != null ">
|
|
order by s.${qo.orderName} ${qo.orderSort}
|
|
</when>
|
|
<otherwise>
|
|
order by s.id desc
|
|
</otherwise>
|
|
</choose>
|
|
</when>
|
|
<otherwise>
|
|
order by s.id desc
|
|
</otherwise>
|
|
</choose>
|
|
|
|
</select>
|
|
<select id="storyPageListByIds" resultType="com.sa.zentao.dao.ZtStoryDTO">
|
|
select s.*,sp.spec ,sp.verify,sp.files from zt_story s left join zt_storyspec sp on s.id = sp.story
|
|
left join zt_storyreview v on s.id = v.story and s.version = v.version
|
|
WHERE 1=1
|
|
<if test="ids != null and ids.size() > 0">
|
|
and s.id in
|
|
<foreach collection="ids" item="id" index="index"
|
|
open="(" close=")" separator=",">
|
|
#{id}
|
|
</foreach>
|
|
|
|
</if>
|
|
order by s.id desc
|
|
|
|
</select>
|
|
</mapper>
|