| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480 |
- <?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="cn.com.goldenwater.dcproj.dao.TacEvaluationExternalExpertDao">
-
- <resultMap type="cn.com.goldenwater.dcproj.model.TacEvaluationExternalExpert" id="tacEvaluationExternalExpertResultMap">
- <result property="id" column="ID" />
- <result property="orgId" column="ORG_ID" />
- <result property="adCode" column="AD_CODE" />
- <result property="batchYear" column="BATCH_YEAR" />
- <result property="batchNum" column="BATCH_NUM" />
- <result property="groupId" column="GROUP_ID" />
- <result property="projId" column="PROJ_ID" />
- <result property="expertId" column="EXPERT_ID" />
- <result property="expertName" column="EXPERT_NAME" />
- <result property="expertProf" column="EXPERT_PROF" />
- <result property="businessLevel" column="BUSINESS_LEVEL" />
- <result property="qualityResults" column="QUALITY_RESULTS" />
- <result property="workStyle" column="WORK_STYLE" />
- <result property="oneVeto" column="ONE_VETO" />
- <result property="score" column="SCORE" />
- <result property="evalLevel" column="EVAL_LEVEL" />
- <result property="note" column="NOTE" />
- <result property="backUp" column="BACKUP" />
- <result property="persId" column="PERS_ID" />
- <result property="intm" column="INTM" />
- <result property="uptm" column="UPTM" />
- </resultMap>
- <!-- 数据库表字段列表 table_columns -->
- <sql id="table_columns">
- ID,
- ORG_ID,
- AD_CODE,
- GROUP_ID,
- PROJ_ID,
- EXPERT_ID,
- EXPERT_NAME,
- EXPERT_PROF,
- BUSINESS_LEVEL,
- QUALITY_RESULTS,
- WORK_STYLE,
- ONE_VETO,
- SCORE,
- EVAL_LEVEL,
- NOTE,
- PERS_ID,
- INTM,
- UPTM
- </sql>
- <!-- 实体类属性 列表 entity_properties -->
- <sql id="entity_properties">
- #{id},
- #{orgId},
- #{adCode},
- #{groupId},
- #{projId},
- #{expertId},
- #{expertName},
- #{expertProf},
- #{businessLevel},
- #{qualityResults},
- #{workStyle},
- #{oneVeto},
- #{score},
- #{evalLevel},
- #{note},
- #{persId},
- #{intm},
- #{uptm}
- </sql>
- <!-- 实体类属性 列表 entity_properties_item for循环使用 -->
- <sql id="entity_properties_item">
- #{item.id} as ID ,
- #{item.orgId} as ORG_ID ,
- #{item.adCode} as AD_CODE ,
- #{item.groupId} as GROUP_ID ,
- #{item.projId} as PROJ_ID ,
- #{item.expertId} as EXPERT_ID ,
- #{item.expertName} as EXPERT_NAME ,
- #{item.expertProf} as EXPERT_PROF ,
- #{item.businessLevel} as BUSINESS_LEVEL ,
- #{item.qualityResults} as QUALITY_RESULTS ,
- #{item.workStyle} as WORK_STYLE ,
- #{item.oneVeto} as ONE_VETO ,
- #{item.score} as SCORE ,
- #{item.evalLevel} as EVAL_LEVEL ,
- #{item.note} as NOTE ,
- #{item.persId} as PERS_ID ,
- #{item.intm} as INTM ,
- #{item.uptm} as UPTM
- </sql>
- <!-- 查询条件 -->
- <sql id="page_where">
- <trim prefix="where" prefixOverrides="and | or ">
- <if test='orgId != null and orgId != ""'> and ORG_ID = #{orgId}</if>
- <if test='adCode != null and adCode != ""'> and AD_CODE like '${adCode}%'</if>
- <if test='groupId != null and groupId != ""'> and GROUP_ID = #{groupId}</if>
- <if test='projId != null and projId != ""'> and PROJ_ID = #{projId}</if>
- <if test='expertId != null and expertId != ""'> and EXPERT_ID = #{expertId}</if>
- <if test='expertName != null and expertName != ""'> and EXPERT_NAME like '%${expertName}%'</if>
- <if test='expertProf != null and expertProf != ""'>
- and
- <foreach collection="expertProf.split(',')" index="index" item="item" separator="or" open="(" close=")">
- LOCATE(CONCAT(',',${item},',') , CONCAT(',',EXPERT_PROF,',') ) > 0
- </foreach>
- </if>
- <if test='businessLevel != null '> and BUSINESS_LEVEL = #{businessLevel}</if>
- <if test='qualityResults != null '> and QUALITY_RESULTS = #{qualityResults}</if>
- <if test='workStyle != null '> and WORK_STYLE = #{workStyle}</if>
- <if test='oneVeto != null and oneVeto != ""'> and ONE_VETO = #{oneVeto}</if>
- <if test='score != null '> and SCORE = #{score}</if>
- <if test='evalLevel != null and evalLevel != ""'> and EVAL_LEVEL = #{evalLevel}</if>
- <if test='note != null and note != ""'> and NOTE = #{note}</if>
- <if test='persId != null and persId != ""'> and PERS_ID = #{persId}</if>
- <if test='intm != null '> and DATE_FORMAT(INTM,'%Y-%m-%d') = DATE_FORMAT(#{intm},'%Y-%m-%d')</if>
- <if test='uptm != null '> and UPTM = #{uptm}</if>
- <if test='null != batchYear and "" != batchYear '>
- and GROUP_ID in ( select GROUP_ID from TAC_INSP_YEAR_BATCH_GROUP_PERS where YEAR = #{batchYear} and GROUP_ID is not null )
- </if>
- </trim>
- </sql>
- <!-- 根据Id查询 -->
- <select id="get" resultMap="tacEvaluationExternalExpertResultMap" parameterType="String">
- select
- <include refid="table_columns"/>,BACKUP
- from TAC_EVALUATION_EXTERNAL_EXPERT where ID = #{id}
- </select>
- <!-- 根据条件筛选查询 -->
- <select id="getBy" resultMap="tacEvaluationExternalExpertResultMap" parameterType="cn.com.goldenwater.dcproj.param.TacEvaluationExternalExpertParam">
- select
- <include refid="table_columns"/>
- from TAC_EVALUATION_EXTERNAL_EXPERT
- <include refid="page_where"/>
- </select>
- <!-- 查询所有 -->
- <select id="findAll" resultMap="tacEvaluationExternalExpertResultMap">
- select
- <include refid="table_columns"/>
- from TAC_EVALUATION_EXTERNAL_EXPERT
- </select>
- <!-- 根据条件筛选 查询所有 -->
- <select id="findList" resultMap="tacEvaluationExternalExpertResultMap" parameterType="cn.com.goldenwater.dcproj.param.TacEvaluationExternalExpertParam">
- select
- <include refid="table_columns"/>
- from TAC_EVALUATION_EXTERNAL_EXPERT
- <include refid="page_where"/>
- </select>
- <!-- 根据条件筛选 统计记录数 -->
- <select id="selectCount" resultType="int" parameterType="cn.com.goldenwater.dcproj.param.TacEvaluationExternalExpertParam">
- select count( ID ) from TAC_EVALUATION_EXTERNAL_EXPERT
- <include refid="page_where"/>
- </select>
- <!-- 添加 -->
- <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.TacEvaluationExternalExpert" >
- insert into TAC_EVALUATION_EXTERNAL_EXPERT(
- <include refid="table_columns"/>
- )
- values (
- <include refid="entity_properties"/>
- )
- </insert>
- <!-- 批量添加 -->
- <insert id="insertBatchFile" parameterType="java.util.List" useGeneratedKeys="false">
- insert into TAC_EVALUATION_EXTERNAL_EXPERT
- (<include refid="table_columns"/>)
- select t.* from (
- <foreach item="item" index="index" collection="list" separator="union all">
- select <include refid="entity_properties_item"/> from dual
- </foreach>
- ) t
- </insert>
- <!-- 主键删除 -->
- <delete id="delete" parameterType="java.lang.String">
- update TAC_EVALUATION_EXTERNAL_EXPERT set DATA_STAT='9' where ID = #{id}
- </delete>
- <!-- 条件删除 -->
- <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.TacEvaluationExternalExpert">
- update TAC_EVALUATION_EXTERNAL_EXPERT set DATA_STAT='9'
- <include refid="page_where"/>
- </delete>
- <!-- 逻辑删除 -->
- <update id="deleteInFlag" parameterType="java.lang.String">
- update TAC_EVALUATION_EXTERNAL_EXPERT set DATA_STAT = '9' where ID = #{id}
- </update>
- <!-- 主键更新 -->
- <update id="update" parameterType="cn.com.goldenwater.dcproj.model.TacEvaluationExternalExpert">
- update TAC_EVALUATION_EXTERNAL_EXPERT
- <trim prefix="SET" suffixOverrides=",">
- <if test='orgId != null'>ORG_ID = #{orgId},</if>
- <if test='adCode != null'>AD_CODE = #{adCode},</if>
- <if test='groupId != null'>GROUP_ID = #{groupId},</if>
- <if test='projId != null'>PROJ_ID = #{projId},</if>
- <if test='expertId != null'>EXPERT_ID = #{expertId},</if>
- <if test='expertName != null'>EXPERT_NAME = #{expertName},</if>
- <if test='expertProf != null'>EXPERT_PROF = #{expertProf},</if>
- <if test='businessLevel != null'>BUSINESS_LEVEL = #{businessLevel},</if>
- <if test='qualityResults != null'>QUALITY_RESULTS = #{qualityResults},</if>
- <if test='workStyle != null'>WORK_STYLE = #{workStyle},</if>
- <if test='oneVeto != null'>ONE_VETO = #{oneVeto},</if>
- <if test='score != null'>SCORE = #{score}, BACKUP = null,</if>
- <if test='evalLevel != null'>EVAL_LEVEL = #{evalLevel},</if>
- <if test='note != null'>NOTE = #{note},</if>
- <if test='uptm != null'>UPTM = #{uptm},</if>
- </trim>
- where ID = #{id}
- </update>
- <!-- 条件更新 -->
- <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.TacEvaluationExternalExpert">
- update TAC_EVALUATION_EXTERNAL_EXPERT
- <trim prefix="SET" suffixOverrides=",">
- <if test='orgId != null'>ORG_ID = #{orgId},</if>
- <if test='adCode != null'>AD_CODE = #{adCode},</if>
- <if test='groupId != null'>GROUP_ID = #{groupId},</if>
- <if test='projId != null'>PROJ_ID = #{projId},</if>
- <if test='expertId != null'>EXPERT_ID = #{expertId},</if>
- <if test='expertName != null'>EXPERT_NAME = #{expertName},</if>
- <if test='expertProf != null'>EXPERT_PROF = #{expertProf},</if>
- <if test='businessLevel != null'>BUSINESS_LEVEL = #{businessLevel},</if>
- <if test='qualityResults != null'>QUALITY_RESULTS = #{qualityResults},</if>
- <if test='workStyle != null'>WORK_STYLE = #{workStyle},</if>
- <if test='oneVeto != null'>ONE_VETO = #{oneVeto},</if>
- <if test='score != null'>SCORE = #{score}, BACKUP = null,</if>
- <if test='evalLevel != null'>EVAL_LEVEL = #{evalLevel},</if>
- <if test='note != null'>NOTE = #{note},</if>
- <if test='uptm != null'>UPTM = #{uptm},</if>
- </trim>
- <include refid="page_where"/>
- </update>
- <!-- 其他自定义SQL -->
- <!-- 查询小组里的人员列表 筛选出角色为 稽查专家、稽查助理、稽查组长、稽查特派员 -->
- <resultMap type="cn.com.goldenwater.dcproj.vo.TacEvaluationExternalExpertVo" id="tacEvaluationExternalExpertResultVoMap">
- <result property="id" column="ID" />
- <result property="groupId" column="GROUP_ID" />
- <result property="projId" column="PROJ_ID" />
- <result property="projName" column="PROJ_NM" />
- <result property="expertId" column="EXPERT_ID" />
- <result property="expertName" column="EXPERT_NAME" />
- <result property="mobilenumb" column="MOBILENUMB" />
- <result property="expertProf" column="EXPERT_PROF" />
- <result property="freq" column="FREQ" />
- <result property="businessLevel" column="BUSINESS_LEVEL" />
- <result property="qualityResults" column="QUALITY_RESULTS" />
- <result property="workStyle" column="WORK_STYLE" />
- <result property="oneVeto" column="ONE_VETO" />
- <result property="score" column="SCORE" />
- <result property="evalLevel" column="EVAL_LEVEL" />
- <result property="note" column="NOTE" />
- <result property="persId" column="PERS_ID" />
- <result property="grader" column="GRADER" />
- <result property="intm" column="INTM" />
- <result property="jctm" column="JCTM" />
- <result property="modifyFlag" column="MODIFYFLAG" />
- <result property="backUp" column="BACKUP" />
- </resultMap>
- <select id="selectEavlPersListByGroupId" parameterType="cn.com.goldenwater.dcproj.param.TacEvaluationExternalExpertParam" resultMap="tacEvaluationExternalExpertResultVoMap">
- select eee.ID as ID, r.GROUP_ID, r.PERS_ID as EXPERT_ID, r.PERS_NM as EXPERT_NAME , r.ROLE_TYPE as EXPERT_PROF,
- eee.BUSINESS_LEVEL , eee.QUALITY_RESULTS, eee.WORK_STYLE, eee.ONE_VETO, eee.SCORE , eee.EVAL_LEVEL , eee.NOTE
- from (
- select t.GROUP_ID, t.PERS_ID ,t.PERS_NM,
- GROUP_CONCAT(t.ROLE_TYPE order by t.ROLE_TYPE asc SEPARATOR ',') as ROLE_TYPE
- from ( select
- iybgp.GROUP_ID,
- wb.LOGIN_ID as PERS_ID,
- iybgp.ROLE_TYPE,
- wb.NAME as PERS_NM
- from TAC_INSP_YEAR_BATCH_GROUP_PERS iybgp
- ,TAC_WORKER_B wb
- where iybgp.DATA_STAT = '0'
- and wb.ID = iybgp.PERS_ID
- and iybgp.GROUP_ID = #{groupId}
- <!-- 稽查专家 -->
- and iybgp.ROLE_TYPE in ('11','12','13','14','15','16')
- <!-- 外聘稽查专家 isExternal 是否外聘 0否 1是 -->
- and wb.IS_EXTERNAL = '1'
- ) t
- group by t.GROUP_ID, t.PERS_ID ,t.PERS_NM
- ) r
- left join TAC_EVALUATION_EXTERNAL_EXPERT eee on eee.GROUP_ID = r.GROUP_ID and eee.EXPERT_ID = r.PERS_ID and eee.PERS_ID = #{persId}
- <if test='null != projId and "" != projId'>
- and eee.PROJ_ID = #{projId}
- </if>
- </select>
- <!-- 查询外聘专家的测评结果 -->
- <select id="findEvaluationResult" parameterType="cn.com.goldenwater.dcproj.param.TacEvaluationExternalExpertParam" resultMap="tacEvaluationExternalExpertResultVoMap">
- select t.* , wb.MOBILENUMB, wb.ROLE_TYPE as EXPERT_PROF
- from (select count(ID) as FREQ , round(avg(SCORE),2) as SCORE ,EXPERT_ID ,EXPERT_NAME
- from TAC_EVALUATION_EXTERNAL_EXPERT
- <trim prefix="where" prefixOverrides="and | or ">
- <if test='orgId != null and orgId != ""'> and ORG_ID = #{orgId}</if>
- <if test='adCode != null and adCode != ""'> and AD_CODE like '${adCode}%'</if>
- <if test='groupId != null and groupId != ""'> and GROUP_ID = #{groupId}</if>
- <if test='projId != null and projId != ""'> and PROJ_ID = #{projId}</if>
- <if test='expertId != null and expertId != ""'> and EXPERT_ID = #{expertId}</if>
- <if test='expertName != null and expertName != ""'> and EXPERT_NAME like '%${expertName}%'</if>
- <if test='businessLevel != null '> and BUSINESS_LEVEL = #{businessLevel}</if>
- <if test='qualityResults != null '> and QUALITY_RESULTS = #{qualityResults}</if>
- <if test='workStyle != null '> and WORK_STYLE = #{workStyle}</if>
- <if test='oneVeto != null and oneVeto != ""'> and ONE_VETO = #{oneVeto}</if>
- <if test='score != null '> and SCORE = #{score}</if>
- <if test='evalLevel != null and evalLevel != ""'> and EVAL_LEVEL = #{evalLevel}</if>
- <if test='note != null and note != ""'> and NOTE = #{note}</if>
- <if test='persId != null and persId != ""'> and PERS_ID = #{persId}</if>
- <if test='intm != null '> and DATE_FORMAT(INTM,'%Y-%m-%d') = DATE_FORMAT(#{intm},'%Y-%m-%d')</if>
- <if test='uptm != null '> and UPTM = #{uptm}</if>
- <if test='null != batchYear and "" != batchYear '>
- and GROUP_ID in ( select GROUP_ID from TAC_INSP_YEAR_BATCH_GROUP_PERS where YEAR = #{batchYear} and GROUP_ID is not null )
- </if>
- </trim>
- group by EXPERT_ID ,EXPERT_NAME )t
- left join tac_worker_b wb on wb.ID = t.EXPERT_ID
- <trim prefix="where" prefixOverrides="and | or ">
- 1=1
- <if test='null !=mobilenumb and ""!= mobilenumb '>
- and wb.MOBILENUMB like '%${mobilenumb}%'
- </if>
- <if test='expertProf != null and expertProf != ""'>
- and
- <foreach collection="expertProf.split(',')" index="index" item="item" separator="or" open="(" close=")">
- LOCATE(CONCAT(',',${item},',') , CONCAT(',',wb.ROLE_TYPE,',') ) > 0
- </foreach>
- </if>
- </trim>
- order by t.SCORE desc
- </select>
- <select id="findEvaluationResult2" parameterType="cn.com.goldenwater.dcproj.param.TacEvaluationExternalExpertParam" resultMap="tacEvaluationExternalExpertResultVoMap">
- select t.* from (
- select a.EXPERT_ID,b.NAME as EXPERT_NAME,b.MOBILENUMB,b.ROLE_TYPE as EXPERT_PROF,a.SCORE as SCORE,c.YEAR,
- (select count(ID) as FREQ from TAC_EVALUATION_EXTERNAL_EXPERT where PERS_ID is null and EXPERT_ID=a.EXPERT_ID) as FREQ
- from (
- select round(avg(SCORE),2) as SCORE, EXPERT_ID from TAC_EVALUATION_EXTERNAL_EXPERT where PERS_ID is null
- group by EXPERT_ID
- ) a left join TAC_WORKER_B b on a.EXPERT_ID=b.LOGIN_ID
- left join (
- select distinct a.EXPERT_ID,c.YEAR from TAC_EVALUATION_EXTERNAL_EXPERT a
- left join TAC_PAWP_RGSTR b on a.PROJ_ID=b.OBJ_ID
- left join TAC_INSP_YEAR_BATCH_GROUP_PERS c on b.GROUP_ID=c.GROUP_ID
- where a.PERS_ID is null
- ) c on a.EXPERT_ID=c.EXPERT_ID
- ) t
- where 1=1
- <if test='expertName != null and expertName != ""'> and t.EXPERT_NAME like '%${expertName}%'</if>
- <if test='null !=mobilenumb and ""!= mobilenumb '> and t.MOBILENUMB like '%${mobilenumb}%'</if>
- <if test='expertProf != null and expertProf != ""'>
- and
- <foreach collection="expertProf.split(',')" index="index" item="item" separator="or" open="(" close=")">
- LOCATE(CONCAT(',',${item},',') , CONCAT(',',t.EXPERT_PROF,',') ) > 0
- </foreach>
- </if>
- <if test='null != batchYear and "" != batchYear '> and t.YEAR = #{batchYear}</if>
- order by t.SCORE desc
- </select>
- <!-- 查询外聘专家的测评记录 -->
- <select id="findEvaluationResultDetails" parameterType="cn.com.goldenwater.dcproj.param.TacEvaluationExternalExpertParam" resultMap="tacEvaluationExternalExpertResultVoMap">
- select
- eee.ID,
- eee.ORG_ID,
- eee.AD_CODE,
- eee.GROUP_ID,
- eee.PROJ_ID,
- eee.EXPERT_ID,
- eee.EXPERT_NAME,
- eee.EXPERT_PROF,
- eee.BUSINESS_LEVEL,
- eee.QUALITY_RESULTS,
- eee.WORK_STYLE,
- eee.ONE_VETO,
- eee.SCORE,
- eee.EVAL_LEVEL,
- eee.NOTE,
- eee.PERS_ID,
- eee.INTM,
- eee.BACKUP,
- iybo.OJB_NM as PROJ_NM
- <if test='null == projId or "" == projId'>
- ,CONCAT(DATE_FORMAT(iybg.ST_TM,'%Y-%m-%d'),'至',DATE_FORMAT(iybg.EN_TM ,'%Y-%m-%d')) as JCTM
- ,(CASE WHEN eee.BACKUP is null THEN '0' ELSE '1' END) AS "MODIFYFLAG"
- </if>
- <if test='projId != null and projId != ""'>
- ,twb.NAME as GRADER
- </if>
- from TAC_EVALUATION_EXTERNAL_EXPERT eee
- left join TAC_INSP_YEAR_BATCH_OBJ iybo on iybo.ID = eee.PROJ_ID and iybo.DATA_STAT='0'
- <if test=' null == projId or "" == projId'>
- left join TAC_INSP_YEAR_BATCH_GROUP iybg on iybg.ID = eee.GROUP_ID
- </if>
- <if test='projId != null and projId != ""'>
- left join TAC_WORKER_B twb on twb.LOGIN_ID = eee.PERS_ID
- </if>
- <trim prefix="where" prefixOverrides="and | or ">
- <if test='orgId != null and orgId != ""'> and eee.ORG_ID = #{orgId}</if>
- <if test='adCode != null and adCode != ""'> and eee.AD_CODE like '${adCode}%'</if>
- <if test='groupId != null and groupId != ""'> and eee.GROUP_ID = #{groupId}</if>
- <if test='projId != null and projId != ""'> and eee.PROJ_ID = #{projId}</if>
- <if test='expertId != null and expertId != ""'> and eee.EXPERT_ID = #{expertId}</if>
- <if test='expertName != null and expertName != ""'> and eee.EXPERT_NAME like '%${expertName}%'</if>
- <if test='expertProf != null and expertProf != ""'>
- and
- <foreach collection="expertProf.split(',')" index="index" item="item" separator="or" open="(" close=")">
- LOCATE(CONCAT(',',#{item},','), CONCAT(',',eee.EXPERT_PROF,',')) > 0
- </foreach>
- </if>
- <if test='businessLevel != null '> and eee.BUSINESS_LEVEL = #{businessLevel}</if>
- <if test='qualityResults != null '> and eee.QUALITY_RESULTS = #{qualityResults}</if>
- <if test='workStyle != null '> and eee.WORK_STYLE = #{workStyle}</if>
- <if test='oneVeto != null and oneVeto != ""'> and eee.ONE_VETO = #{oneVeto}</if>
- <if test='score != null '> and eee.SCORE = #{score}</if>
- <if test='evalLevel != null and evalLevel != ""'> and eee.EVAL_LEVEL = #{evalLevel}</if>
- <if test='persId != null and persId != ""'> and eee.PERS_ID = #{persId}</if>
- <if test='intm != null '> and DATE_FORMAT(eee.INTM,'%Y-%m-%d') = DATE_FORMAT(#{intm},'%Y-%m-%d')</if>
- </trim>
- </select>
- <select id="findEvaluationResultDetails2" parameterType="java.lang.String" resultMap="tacEvaluationExternalExpertResultVoMap">
- select
- eee.ID,eee.PROJ_ID,eee.PERS_ID,eee.ONE_VETO,eee.EXPERT_ID,eee.EXPERT_NAME,eee.BUSINESS_LEVEL,eee.QUALITY_RESULTS,eee.WORK_STYLE,eee.SCORE,eee.EVAL_LEVEL,eee.NOTE,eee.BACKUP,
- ccc.NAME as PROJ_NM,
- CONCAT(DATE_FORMAT(iybg.ST_TM,'%Y-%m-%d'),'至',DATE_FORMAT(iybg.EN_TM ,'%Y-%m-%d') ) as JCTM,
- bbb.ROLE_TYPE as EXPERT_PROF
- <if test='projId != null and projId != ""'>
- ,twb.NAME as GRADER
- </if>
- from TAC_EVALUATION_EXTERNAL_EXPERT eee
- left join TAC_WORKER_B bbb on eee.EXPERT_ID=bbb.LOGIN_ID
- left join TAC_PAWP_RGSTR ccc on ccc.OBJ_ID=eee.PROJ_ID
- left join TAC_INSP_YEAR_BATCH_GROUP iybg on iybg.ID = ccc.GROUP_ID
- <if test='projId != null and projId != ""'>
- left join TAC_WORKER_B twb on twb.LOGIN_ID = eee.PERS_ID
- </if>
- where eee.EXPERT_ID=#{expertId}
- <if test=' projId!=null and projId!="" '>
- and eee.PROJ_ID = #{projId} and eee.PERS_ID is not null
- </if>
- <if test=' projId==null or projId=="" '>
- and eee.PERS_ID is null
- </if>
- </select>
- <!-- 修改 可恢复 -->
- <update id="updateScoreById" parameterType="cn.com.goldenwater.dcproj.model.TacEvaluationExternalExpert">
- update TAC_EVALUATION_EXTERNAL_EXPERT
- <trim prefix="SET" suffixOverrides=",">
- <if test='businessLevel != null'>BUSINESS_LEVEL = #{businessLevel},</if>
- <if test='qualityResults != null'>QUALITY_RESULTS = #{qualityResults},</if>
- <if test='workStyle != null'>WORK_STYLE = #{workStyle},</if>
- <if test='score != null'>SCORE = #{score},</if>
- <if test='evalLevel != null'>EVAL_LEVEL = #{evalLevel},</if>
- <if test='note != null'>NOTE = #{note},</if>
- BACKUP = CONCAT(BUSINESS_LEVEL,',',QUALITY_RESULTS,',',WORK_STYLE,',',SCORE,',',EVAL_LEVEL,',',|NOTE) ,
- UPTM = sysdate()
- </trim>
- where ID = #{id}
- </update>
- <!-- 恢复修改内容 并清空备份 -->
- <update id="revertScoreById" parameterType="cn.com.goldenwater.dcproj.model.TacEvaluationExternalExpert">
- update TAC_EVALUATION_EXTERNAL_EXPERT
- set BUSINESS_LEVEL = #{businessLevel},
- QUALITY_RESULTS = #{qualityResults},
- WORK_STYLE = #{workStyle},
- SCORE = #{score},
- EVAL_LEVEL = #{evalLevel},
- NOTE = #{note},
- BACKUP = null,
- UPTM = sysdate()
- where ID = #{id}
- </update>
- <select id="selectOneDetailByProjIdAndExpertId" parameterType="java.lang.String" resultType="cn.com.goldenwater.dcproj.model.TacEvaluationExternalExpert">
- select * from TAC_EVALUATION_EXTERNAL_EXPERT
- where PROJ_ID=#{projId} and EXPERT_ID=#{expertId} and PERS_ID is null
- </select>
- <select id="selectHjScoreByProjIdAndExpertId" parameterType="java.lang.String" resultType="cn.com.goldenwater.dcproj.model.TacEvaluationExternalExpert">
- select
- round(avg(BUSINESS_LEVEL),2)BUSINESS_LEVEL,
- round(avg(QUALITY_RESULTS),2)QUALITY_RESULTS,
- round(avg(WORK_STYLE),2)WORK_STYLE,
- round(avg(SCORE),2)SCORE
- from TAC_EVALUATION_EXTERNAL_EXPERT
- where PROJ_ID=#{projId} and EXPERT_ID=#{expertId} and PERS_ID is not null
- </select>
- </mapper>
|