245 lines
9.9 KiB
XML
245 lines
9.9 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.ZtTaskMapper">
|
|
<resultMap id="BaseResultMap" type="com.sa.zentao.entity.ZtTask">
|
|
<result column="id" property="id"/>
|
|
<result column="project" property="project"/>
|
|
<result column="parent" property="parent"/>
|
|
<result column="execution" property="execution"/>
|
|
<result column="module" property="module"/>
|
|
<result column="design" property="design"/>
|
|
<result column="story" property="story"/>
|
|
<result column="storyVersion" property="storyversion"/>
|
|
<result column="designVersion" property="designversion"/>
|
|
<result column="fromBug" property="frombug"/>
|
|
<result column="feedback" property="feedback"/>
|
|
<result column="fromIssue" property="fromissue"/>
|
|
<result column="name" property="name"/>
|
|
<result column="type" property="type"/>
|
|
<result column="mode" property="mode"/>
|
|
<result column="pri" property="pri"/>
|
|
<result column="estimate" property="estimate"/>
|
|
<result column="consumed" property="consumed"/>
|
|
<result column="left" property="left"/>
|
|
<result column="deadline" property="deadline"/>
|
|
<result column="status" property="status"/>
|
|
<result column="subStatus" property="substatus"/>
|
|
<result column="color" property="color"/>
|
|
<result column="mailto" property="mailto"/>
|
|
<result column="desc" property="desc"/>
|
|
<result column="version" property="version"/>
|
|
<result column="openedBy" property="openedby"/>
|
|
<result column="openedDate" property="openeddate"/>
|
|
<result column="assignedTo" property="assignedto"/>
|
|
<result column="assignedDate" property="assigneddate"/>
|
|
<result column="estStarted" property="eststarted"/>
|
|
<result column="realStarted" property="realstarted"/>
|
|
<result column="finishedBy" property="finishedby"/>
|
|
<result column="finishedDate" property="finisheddate"/>
|
|
<result column="finishedList" property="finishedlist"/>
|
|
<result column="canceledBy" property="canceledby"/>
|
|
<result column="canceledDate" property="canceleddate"/>
|
|
<result column="closedBy" property="closedby"/>
|
|
<result column="closedDate" property="closeddate"/>
|
|
<result column="planDuration" property="planduration"/>
|
|
<result column="realDuration" property="realduration"/>
|
|
<result column="closedReason" property="closedreason"/>
|
|
<result column="lastEditedBy" property="lasteditedby"/>
|
|
<result column="lastEditedDate" property="lastediteddate"/>
|
|
<result column="activatedDate" property="activateddate"/>
|
|
<result column="order" property="order"/>
|
|
<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="deleted" property="deleted"/>
|
|
<result column="vision" property="vision"/>
|
|
</resultMap>
|
|
<select id="taskPageList" resultType="com.sa.zentao.dao.ZtTaskDTO">
|
|
|
|
select s.*,pt.name productName from zt_task s left join zt_project project on s.project = project.id
|
|
left join zt_product pt on s.product = pt.id
|
|
where 1= 1
|
|
|
|
<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.projectList != null and qo.projectList.size() > 0">
|
|
and s.project in
|
|
<foreach collection="qo.projectList" item="id" index="index"
|
|
open="(" close=")" separator=",">
|
|
#{id}
|
|
</foreach>
|
|
|
|
</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.searchVal == 'ALL' ">
|
|
|
|
</if>
|
|
<if test="qo.searchVal == 'WGB' ">
|
|
and s.status != 'closed'
|
|
</if>
|
|
|
|
<if test="qo.searchVal == 'DPS' ">
|
|
and s.status = 'reviewing'
|
|
</if>
|
|
|
|
<if test="qo.searchVal == 'ZPGW' ">
|
|
and s.assignedTo= #{qo.userName}
|
|
</if>
|
|
<if test="qo.searchVal == 'YWCY' ">
|
|
and s.mailto like concat('%', #{qo.userName}, '%')
|
|
</if>
|
|
|
|
<if test="qo.searchVal == 'YWCJ' ">
|
|
and s.openedBy like concat('%', #{qo.userName}, '%')
|
|
</if>
|
|
|
|
<if test="qo.searchVal == 'YWZP' ">
|
|
and s.lastEditedBy = #{qo.userName}
|
|
</if>
|
|
|
|
<if test="qo.searchVal == 'RJXQBG' ">
|
|
and s.status != 'active'
|
|
</if>
|
|
|
|
<if test="qo.execution != '' and qo.execution != null ">
|
|
and s.execution =#{qo.execution}
|
|
</if>
|
|
|
|
|
|
<if test="qo.projectIds != null and qo.projectIds.size() > 0">
|
|
and s.execution in
|
|
<foreach collection="qo.projectIds" item="id" index="index"
|
|
open="(" close=")" separator=",">
|
|
#{id}
|
|
</foreach>
|
|
|
|
</if>
|
|
|
|
|
|
<if test="qo.searchCode != null and qo.searchCode != '' ">
|
|
|
|
-- //任务名称
|
|
<if test="qo.searchCode=='rwmc' and qo.searchValue != null and qo.searchValue != '' ">
|
|
and s.name like concat('%', #{qo.searchValue}, '%')
|
|
</if>
|
|
-- 项目id
|
|
<if test="qo.searchCode=='bh' 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.status =#{qo.searchValue}
|
|
</if>
|
|
|
|
-- 指派给
|
|
<if test="qo.searchCode=='zpg' and qo.searchValue != null and qo.searchValue != '' ">
|
|
and s.assignedTo =#{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 test="qo.searchCode=='ysqx' and qo.searchValue != null and qo.searchValue != '' ">
|
|
and s.canceledBy = #{qo.searchValue}
|
|
</if>
|
|
<if test="qo.searchCode=='zhxg' and qo.searchValue != null and qo.searchValue != '' ">
|
|
and s.lastEditedBy = #{qo.searchValue}
|
|
</if>
|
|
|
|
<if test="qo.searchCode=='cjrq' and qo.searchValue != null and qo.searchValue != '' ">
|
|
and s.openedDate ${qo.searchValue}
|
|
</if>
|
|
|
|
<if test="qo.searchCode=='jzrq' and qo.searchValue != null and qo.searchValue != '' ">
|
|
and s.deadline ${qo.searchValue}
|
|
</if>
|
|
<if test="qo.searchCode=='yjks' and qo.searchValue != null and qo.searchValue != '' ">
|
|
and s.estStarted ${qo.searchValue}
|
|
</if>
|
|
<if test="qo.searchCode=='sjks' and qo.searchValue != null and qo.searchValue != '' ">
|
|
and s.realstarted ${qo.searchValue}
|
|
</if>
|
|
<if test="qo.searchCode=='sjwc' and qo.searchValue != null and qo.searchValue != '' ">
|
|
and s.lastEditedBy ${qo.searchValue}
|
|
</if>
|
|
<!-- <if test="qo.searchCode=='sjwc' and qo.searchValue != null and qo.searchValue != '' ">-->
|
|
<!-- and s.end_date <![CDATA[>=]]> #{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>
|
|
|
|
<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}
|
|
<choose>
|
|
<when test="qo.orderName == 'deadline' ">
|
|
,id ${qo.orderSort}
|
|
</when>
|
|
</choose>
|
|
|
|
|
|
</when>
|
|
<otherwise>
|
|
order by s.id desc
|
|
</otherwise>
|
|
</choose>
|
|
</when>
|
|
<otherwise>
|
|
order by s.id desc
|
|
</otherwise>
|
|
</choose>
|
|
|
|
|
|
</select>
|
|
<select id="taskListPrd" resultType="com.sa.zentao.dao.ZtTaskDTO">
|
|
|
|
select * from zt_task where execution = #{id}
|
|
|
|
</select>
|
|
<select id="itApprovalByUserName" resultType="com.sa.zentao.dao.ItApproval">
|
|
SELECT * from os_system.it_approval a WHERE 1=1
|
|
and a.name = #{name}
|
|
and
|
|
(
|
|
(date(apply_time_start) BETWEEN date( #{startDate}) and date(#{endDate}))
|
|
or(
|
|
date(apply_time_end) BETWEEN date(#{startDate}) and date(#{endDate}))
|
|
)
|
|
|
|
|
|
|
|
</select>
|
|
|
|
</mapper>
|