TacEvaluationGroupLeaderDao.xml 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="cn.com.goldenwater.dcproj.dao.TacEvaluationGroupLeaderDao">
  6. <resultMap type="cn.com.goldenwater.dcproj.model.TacEvaluationGroupLeader" id="tacEvaluationGroupLeaderResultMap">
  7. <result property="id" column="ID" />
  8. <result property="orgId" column="ORG_ID" />
  9. <result property="adCode" column="AD_CODE" />
  10. <result property="batchYear" column="BATCH_YEAR" />
  11. <result property="batchNum" column="BATCH_NUM" />
  12. <result property="groupId" column="GROUP_ID" />
  13. <result property="projId" column="PROJ_ID" />
  14. <result property="groupLeaderId" column="GROUP_LEADER_ID" />
  15. <result property="groupLeaderName" column="GROUP_LEADER_NAME" />
  16. <result property="orgLeader" column="ORG_LEADER" />
  17. <result property="businessLevel" column="BUSINESS_LEVEL" />
  18. <result property="cphsManage" column="CPHS_MANAGE" />
  19. <result property="workStyle" column="WORK_STYLE" />
  20. <result property="oneVeto" column="ONE_VETO" />
  21. <result property="score" column="SCORE" />
  22. <result property="evalLevel" column="EVAL_LEVEL" />
  23. <result property="note" column="NOTE" />
  24. <result property="backUp" column="BACKUP" />
  25. <result property="persId" column="PERS_ID" />
  26. <result property="intm" column="INTM" />
  27. <result property="uptm" column="UPTM" />
  28. </resultMap>
  29. <!-- 数据库表字段列表 table_columns -->
  30. <sql id="table_columns">
  31. ID,
  32. ORG_ID,
  33. AD_CODE,
  34. GROUP_ID,
  35. PROJ_ID,
  36. GROUP_LEADER_ID,
  37. GROUP_LEADER_NAME,
  38. ORG_LEADER,
  39. BUSINESS_LEVEL,
  40. CPHS_MANAGE,
  41. WORK_STYLE,
  42. ONE_VETO,
  43. SCORE,
  44. EVAL_LEVEL,
  45. NOTE,
  46. PERS_ID,
  47. INTM,
  48. UPTM
  49. </sql>
  50. <!-- 实体类属性 列表 entity_properties -->
  51. <sql id="entity_properties">
  52. #{id},
  53. #{orgId},
  54. #{adCode},
  55. #{groupId},
  56. #{projId},
  57. #{groupLeaderId},
  58. #{groupLeaderName},
  59. #{orgLeader},
  60. #{businessLevel},
  61. #{cphsManage},
  62. #{workStyle},
  63. #{oneVeto},
  64. #{score},
  65. #{evalLevel},
  66. #{note},
  67. #{persId},
  68. #{intm},
  69. #{uptm}
  70. </sql>
  71. <!-- 实体类属性 列表 entity_properties_item for循环使用 -->
  72. <sql id="entity_properties_item">
  73. #{item.id} as ID ,
  74. #{item.orgId} as ORG_ID ,
  75. #{item.adCode} as AD_CODE ,
  76. #{item.groupId} as GROUP_ID ,
  77. #{item.projId} as PROJ_ID ,
  78. #{item.groupLeaderId} as GROUP_LEADER_ID ,
  79. #{item.groupLeaderName} as GROUP_LEADER_NAME ,
  80. #{item.orgLeader} as ORG_LEADER ,
  81. #{item.businessLevel} as BUSINESS_LEVEL ,
  82. #{item.cphsManage} as CPHS_MANAGE ,
  83. #{item.workStyle} as WORK_STYLE ,
  84. #{item.oneVeto} as ONE_VETO ,
  85. #{item.score} as SCORE ,
  86. #{item.evalLevel} as EVAL_LEVEL ,
  87. #{item.note} as NOTE ,
  88. #{item.persId} as PERS_ID ,
  89. #{item.intm} as INTM ,
  90. #{item.uptm} as UPTM
  91. </sql>
  92. <!-- 查询条件 -->
  93. <sql id="page_where">
  94. <trim prefix="where" prefixOverrides="and | or ">
  95. <if test='orgId != null and orgId != ""'> and ORG_ID = #{orgId}</if>
  96. <if test='adCode != null and adCode != ""'> and AD_CODE like '${adCode}%'</if>
  97. <if test='groupId != null and groupId != ""'> and GROUP_ID = #{groupId}</if>
  98. <if test='projId != null and projId != ""'> and PROJ_ID = #{projId}</if>
  99. <if test='groupLeaderId != null and groupLeaderId != ""'> and GROUP_LEADER_ID = #{groupLeaderId}</if>
  100. <if test='groupLeaderName != null and groupLeaderName != ""'> and GROUP_LEADER_NAME like '%${groupLeaderName}%'</if>
  101. <if test='orgLeader != null '> and ORG_LEADER = #{orgLeader}</if>
  102. <if test='businessLevel != null '> and BUSINESS_LEVEL = #{businessLevel}</if>
  103. <if test='cphsManage != null '> and CPHS_MANAGE = #{cphsManage}</if>
  104. <if test='workStyle != null '> and WORK_STYLE = #{workStyle}</if>
  105. <if test='oneVeto != null and oneVeto != ""'> and ONE_VETO = #{oneVeto}</if>
  106. <if test='score != null '> and SCORE = #{score}</if>
  107. <if test='evalLevel != null and evalLevel != ""'> and EVAL_LEVEL = #{evalLevel}</if>
  108. <if test='note != null and note != ""'> and NOTE = #{note}</if>
  109. <if test='persId != null and persId != ""'> and PERS_ID = #{persId}</if>
  110. <if test='intm != null '> and DATE_FORMAT(INTM,'%Y-%m-%d') = DATE_FORMAT(#{intm},'%Y-%m-%d')</if>
  111. <if test='uptm != null '> and UPTM = #{uptm}</if>
  112. <if test='null != batchYear and "" != batchYear '>
  113. and GROUP_ID in ( select GROUP_ID from TAC_INSP_YEAR_BATCH_GROUP_PERS where YEAR = #{batchYear} and GROUP_ID is not null )
  114. </if>
  115. </trim>
  116. </sql>
  117. <!-- 根据Id查询 -->
  118. <select id="get" resultMap="tacEvaluationGroupLeaderResultMap" parameterType="String">
  119. select
  120. <include refid="table_columns"/>,BACKUP
  121. from TAC_EVALUATION_GROUP_LEADER where ID = #{id}
  122. </select>
  123. <!-- 根据条件筛选查询 -->
  124. <select id="getBy" resultMap="tacEvaluationGroupLeaderResultMap" parameterType="cn.com.goldenwater.dcproj.param.TacEvaluationGroupLeaderParam">
  125. select
  126. <include refid="table_columns"/>
  127. from TAC_EVALUATION_GROUP_LEADER
  128. <include refid="page_where"/>
  129. </select>
  130. <!-- 查询所有 -->
  131. <select id="findAll" resultMap="tacEvaluationGroupLeaderResultMap">
  132. select
  133. <include refid="table_columns"/>
  134. from TAC_EVALUATION_GROUP_LEADER
  135. </select>
  136. <!-- 根据条件筛选 查询所有 -->
  137. <select id="findList" resultMap="tacEvaluationGroupLeaderResultMap" parameterType="cn.com.goldenwater.dcproj.param.TacEvaluationGroupLeaderParam">
  138. select
  139. <include refid="table_columns"/>
  140. from TAC_EVALUATION_GROUP_LEADER
  141. <include refid="page_where"/>
  142. </select>
  143. <!-- 根据条件筛选 统计记录数 -->
  144. <select id="selectCount" resultType="int" parameterType="cn.com.goldenwater.dcproj.param.TacEvaluationGroupLeaderParam">
  145. select count( ID ) from TAC_EVALUATION_GROUP_LEADER
  146. <include refid="page_where"/>
  147. </select>
  148. <!-- 添加 -->
  149. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.TacEvaluationGroupLeader" >
  150. insert into TAC_EVALUATION_GROUP_LEADER(
  151. <include refid="table_columns"/>
  152. )
  153. values (
  154. <include refid="entity_properties"/>
  155. )
  156. </insert>
  157. <!-- 批量添加 -->
  158. <insert id="insertBatchFile" parameterType="java.util.List" useGeneratedKeys="false">
  159. insert into TAC_EVALUATION_GROUP_LEADER
  160. (<include refid="table_columns"/>)
  161. select t.* from (
  162. <foreach item="item" index="index" collection="list" separator="union all">
  163. select <include refid="entity_properties_item"/> from dual
  164. </foreach>
  165. ) t
  166. </insert>
  167. <!-- 主键删除 -->
  168. <delete id="delete" parameterType="java.lang.String">
  169. update TAC_EVALUATION_GROUP_LEADER set DATA_STAT='9' where ID = #{id}
  170. </delete>
  171. <!-- 条件删除 -->
  172. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.TacEvaluationGroupLeader">
  173. update TAC_EVALUATION_GROUP_LEADER set DATA_STAT='9'
  174. <include refid="page_where"/>
  175. </delete>
  176. <!-- 逻辑删除 -->
  177. <update id="deleteInFlag" parameterType="java.lang.String">
  178. update TAC_EVALUATION_GROUP_LEADER set DATA_STAT = '9' where ID = #{id}
  179. </update>
  180. <!-- 主键更新 -->
  181. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.TacEvaluationGroupLeader">
  182. update TAC_EVALUATION_GROUP_LEADER
  183. <trim prefix="SET" suffixOverrides=",">
  184. <if test='orgId != null'>ORG_ID = #{orgId},</if>
  185. <if test='adCode != null'>AD_CODE = #{adCode},</if>
  186. <if test='groupId != null'>GROUP_ID = #{groupId},</if>
  187. <if test='projId != null'>PROJ_ID = #{projId},</if>
  188. <if test='groupLeaderId != null'>GROUP_LEADER_ID = #{groupLeaderId},</if>
  189. <if test='groupLeaderName != null'>GROUP_LEADER_NAME = #{groupLeaderName},</if>
  190. <if test='orgLeader != null'>ORG_LEADER = #{orgLeader},</if>
  191. <if test='businessLevel != null'>BUSINESS_LEVEL = #{businessLevel},</if>
  192. <if test='cphsManage != null'>CPHS_MANAGE = #{cphsManage},</if>
  193. <if test='workStyle != null'>WORK_STYLE = #{workStyle},</if>
  194. <if test='oneVeto != null'>ONE_VETO = #{oneVeto},</if>
  195. <if test='score != null'>SCORE = #{score}, BACKUP = null,</if>
  196. <if test='evalLevel != null'>EVAL_LEVEL = #{evalLevel},</if>
  197. <if test='note != null'>NOTE = #{note},</if>
  198. <if test='uptm != null'>UPTM = #{uptm},</if>
  199. </trim>
  200. where ID = #{id}
  201. </update>
  202. <!-- 条件更新 -->
  203. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.TacEvaluationGroupLeader">
  204. update TAC_EVALUATION_GROUP_LEADER
  205. <trim prefix="SET" suffixOverrides=",">
  206. <if test='orgId != null'>ORG_ID = #{orgId},</if>
  207. <if test='adCode != null'>AD_CODE = #{adCode},</if>
  208. <if test='groupId != null'>GROUP_ID = #{groupId},</if>
  209. <if test='projId != null'>PROJ_ID = #{projId},</if>
  210. <if test='groupLeaderId != null'>GROUP_LEADER_ID = #{groupLeaderId},</if>
  211. <if test='groupLeaderName != null'>GROUP_LEADER_NAME = #{groupLeaderName},</if>
  212. <if test='orgLeader != null'>ORG_LEADER = #{orgLeader}, </if>
  213. <if test='businessLevel != null'>BUSINESS_LEVEL = #{businessLevel},</if>
  214. <if test='cphsManage != null'>CPHS_MANAGE = #{cphsManage},</if>
  215. <if test='workStyle != null'>WORK_STYLE = #{workStyle},</if>
  216. <if test='oneVeto != null'>ONE_VETO = #{oneVeto},</if>
  217. <if test='score != null'>SCORE = #{score},BACKUP = null,</if>
  218. <if test='evalLevel != null'>EVAL_LEVEL = #{evalLevel},</if>
  219. <if test='note != null'>NOTE = #{note},</if>
  220. <if test='uptm != null'>UPTM = #{uptm},</if>
  221. </trim>
  222. <include refid="page_where"/>
  223. </update>
  224. <!-- 其他自定义SQL -->
  225. <resultMap type="cn.com.goldenwater.dcproj.vo.TacEvaluationGroupLeaderVo" id="tacEvaluationGroupLeaderResultVoMap">
  226. <result property="id" column="ID" />
  227. <result property="groupId" column="GROUP_ID" />
  228. <result property="projId" column="PROJ_ID" />
  229. <result property="projName" column="PROJ_NM" />
  230. <result property="groupLeaderId" column="GROUP_LEADER_ID" />
  231. <result property="groupLeaderName" column="GROUP_LEADER_NAME" />
  232. <result property="mobilenumb" column="MOBILENUMB" />
  233. <result property="freq" column="FREQ" />
  234. <result property="orgLeader" column="ORG_LEADER" />
  235. <result property="businessLevel" column="BUSINESS_LEVEL" />
  236. <result property="cphsManage" column="CPHS_MANAGE" />
  237. <result property="workStyle" column="WORK_STYLE" />
  238. <result property="oneVeto" column="ONE_VETO" />
  239. <result property="score" column="SCORE" />
  240. <result property="evalLevel" column="EVAL_LEVEL" />
  241. <result property="note" column="NOTE" />
  242. <result property="backUp" column="BACKUP" />
  243. <result property="persId" column="PERS_ID" />
  244. <result property="grader" column="GRADER" />
  245. <result property="intm" column="INTM" />
  246. <result property="jctm" column="JCTM" />
  247. <result property="modifyFlag" column="MODIFYFLAG" />
  248. </resultMap>
  249. <!-- 查询小组里的人员列表 筛选出角色为 稽查专家、稽查助理、稽查组长、稽查特派员 -->
  250. <select id="selectEavlPersListByGroupId" parameterType="cn.com.goldenwater.dcproj.param.TacEvaluationGroupLeaderParam" resultMap="tacEvaluationGroupLeaderResultVoMap">
  251. select eee.ID as ID, r.GROUP_ID, r.PERS_ID as GROUP_LEADER_ID, r.PERS_NM as GROUP_LEADER_NAME,
  252. eee.ORG_LEADER, eee.BUSINESS_LEVEL, eee.CPHS_MANAGE, eee.WORK_STYLE, eee.ONE_VETO, eee.SCORE , eee.EVAL_LEVEL , eee.NOTE
  253. from (
  254. select
  255. iybgp.GROUP_ID,
  256. wb.LOGIN_ID as PERS_ID,
  257. wb.NAME as PERS_NM
  258. from TAC_INSP_YEAR_BATCH_GROUP_PERS iybgp
  259. ,TAC_WORKER_B wb
  260. where iybgp.DATA_STAT = '0'
  261. and wb.ID = iybgp.PERS_ID
  262. and iybgp.GROUP_ID = #{groupId}
  263. <!-- 专家组长 -->
  264. and iybgp.ROLE_TYPE = '20'
  265. ) r
  266. left join TAC_EVALUATION_GROUP_LEADER eee on eee.GROUP_ID = r.GROUP_ID and eee.GROUP_LEADER_ID = r.PERS_ID and eee.PERS_ID = #{persId}
  267. <if test='null != projId and "" != projId'>
  268. and eee.PROJ_ID = #{projId}
  269. </if>
  270. </select>
  271. <!-- 查询外聘专家的测评结果 -->
  272. <select id="findEvaluationResult" parameterType="cn.com.goldenwater.dcproj.param.TacEvaluationGroupLeaderParam" resultMap="tacEvaluationGroupLeaderResultVoMap">
  273. select t.* , wb.MOBILENUMB
  274. from (select count(ID) as FREQ , round(avg(SCORE),2) as SCORE ,GROUP_LEADER_ID ,GROUP_LEADER_NAME
  275. from TAC_EVALUATION_GROUP_LEADER
  276. <include refid="page_where"/>
  277. group by GROUP_LEADER_ID ,GROUP_LEADER_NAME)t
  278. left join tac_worker_b wb on wb.ID = t.GROUP_LEADER_ID
  279. <trim prefix="where" prefixOverrides="and | or ">
  280. <if test='null !=mobilenumb and ""!= mobilenumb '>
  281. and wb.MOBILENUMB like '%${mobilenumb}%'
  282. </if>
  283. </trim>
  284. order by t.SCORE desc
  285. </select>
  286. <select id="findEvaluationResult2" parameterType="cn.com.goldenwater.dcproj.param.TacEvaluationGroupLeaderParam" resultMap="tacEvaluationGroupLeaderResultVoMap">
  287. select t.* from (
  288. select a.GROUP_LEADER_ID,b.NAME as GROUP_LEADER_NAME,b.MOBILENUMB,a.SCORE as SCORE,c.YEAR,
  289. (select count(ID) as FREQ from TAC_EVALUATION_GROUP_LEADER where PERS_ID is null and GROUP_LEADER_ID=a.GROUP_LEADER_ID) as FREQ
  290. from (
  291. select round(avg(SCORE),2) as SCORE, GROUP_LEADER_ID from TAC_EVALUATION_GROUP_LEADER where PERS_ID is null
  292. group by GROUP_LEADER_ID
  293. ) a left join TAC_WORKER_B b on a.GROUP_LEADER_ID=b.LOGIN_ID
  294. left join (
  295. select distinct a.GROUP_LEADER_ID,c.YEAR from TAC_EVALUATION_GROUP_LEADER a
  296. left join TAC_PAWP_RGSTR b on a.PROJ_ID=b.OBJ_ID
  297. left join TAC_INSP_YEAR_BATCH_GROUP_PERS c on b.GROUP_ID=c.GROUP_ID
  298. where a.PERS_ID is null
  299. ) c on a.GROUP_LEADER_ID=c.GROUP_LEADER_ID
  300. ) t
  301. where 1=1
  302. <if test='groupLeaderName != null and groupLeaderName != ""'> and t.GROUP_LEADER_NAME like '%${groupLeaderName}%'</if>
  303. <if test='null !=mobilenumb and ""!= mobilenumb '> and t.MOBILENUMB like '%${mobilenumb}%'</if>
  304. <if test='null != batchYear and "" != batchYear '> and t.YEAR = #{batchYear}</if>
  305. order by t.SCORE desc
  306. </select>
  307. <!-- 查询外聘专家的测评记录 -->
  308. <select id="findEvaluationResultDetails" parameterType="cn.com.goldenwater.dcproj.param.TacEvaluationGroupLeaderParam" resultMap="tacEvaluationGroupLeaderResultVoMap">
  309. select
  310. egl.ID,
  311. egl.ORG_ID,
  312. egl.AD_CODE,
  313. egl.GROUP_ID,
  314. egl.PROJ_ID,
  315. egl.GROUP_LEADER_ID,
  316. egl.GROUP_LEADER_NAME,
  317. egl.ORG_LEADER,
  318. egl.BUSINESS_LEVEL,
  319. egl.CPHS_MANAGE,
  320. egl.WORK_STYLE,
  321. egl.ONE_VETO,
  322. egl.SCORE,
  323. egl.EVAL_LEVEL,
  324. egl.NOTE,
  325. egl.PERS_ID,
  326. egl.INTM,
  327. egl.BACKUP,
  328. iybo.OJB_NM as PROJ_NM
  329. <if test='null == projId or "" == projId'>
  330. ,CONCAT(DATE_FORMAT(iybg.ST_TM,'%Y-%m-%d'),'至',DATE_FORMAT(iybg.EN_TM ,'%Y-%m-%d') )as JCTM
  331. ,(CASE WHEN egl.BACKUP is null THEN '0' ELSE '1' END) AS "MODIFYFLAG"
  332. </if>
  333. <if test='projId != null and projId != ""'>
  334. ,twb.NAME as GRADER
  335. </if>
  336. from TAC_EVALUATION_GROUP_LEADER egl
  337. left join tac_insp_year_batch_obj iybo on iybo.ID = egl.PROJ_ID and iybo.DATA_STAT='0'
  338. <if test=' null == projId or "" == projId'>
  339. left join TAC_INSP_YEAR_BATCH_GROUP iybg on iybg.ID = egl.GROUP_ID
  340. </if>
  341. <if test='projId != null and projId != ""'>
  342. left join TAC_WORKER_B twb on twb.LOGIN_ID = egl.PERS_ID
  343. </if>
  344. <trim prefix="where" prefixOverrides="and | or ">
  345. <if test='orgId != null and orgId != ""'> and egl.ORG_ID = #{orgId}</if>
  346. <if test='adCode != null and adCode != ""'> and egl.AD_CODE like '${adCode}%'</if>
  347. <if test='groupId != null and groupId != ""'> and egl.GROUP_ID = #{groupId}</if>
  348. <if test='projId != null and projId != ""'> and egl.PROJ_ID = #{projId}</if>
  349. <if test='groupLeaderId != null and groupLeaderId != ""'> and egl.GROUP_LEADER_ID = #{groupLeaderId}</if>
  350. <if test='groupLeaderName != null and groupLeaderName != ""'> and egl.GROUP_LEADER_NAME like '%${groupLeaderName}%'</if>
  351. <if test='orgLeader != null '> and egl.ORG_LEADER = #{orgLeader}</if>
  352. <if test='businessLevel != null '> and egl.BUSINESS_LEVEL = #{businessLevel}</if>
  353. <if test='cphsManage != null '> and egl.CPHS_MANAGE = #{cphsManage}</if>
  354. <if test='workStyle != null '> and egl.WORK_STYLE = #{workStyle}</if>
  355. <if test='oneVeto != null and oneVeto != ""'> and egl.ONE_VETO = #{oneVeto}</if>
  356. <if test='score != null '> and egl.SCORE = #{score}</if>
  357. <if test='evalLevel != null and evalLevel != ""'> and egl.EVAL_LEVEL = #{evalLevel}</if>
  358. <if test='persId != null and persId != ""'> and egl.PERS_ID = #{persId}</if>
  359. <if test='intm != null '> and DATE_FORMAT(egl.INTM,'%Y-%m-%d') = DATE_FORMAT(#{intm},'%Y-%m-%d')</if>
  360. </trim>
  361. </select>
  362. <select id="findEvaluationResultDetails2" parameterType="java.lang.String" resultMap="tacEvaluationGroupLeaderResultVoMap">
  363. select
  364. egl.ID,egl.PROJ_ID,egl.PERS_ID,egl.ONE_VETO,egl.GROUP_LEADER_ID,egl.GROUP_LEADER_NAME,egl.ORG_LEADER,egl.BUSINESS_LEVEL,egl.CPHS_MANAGE,egl.WORK_STYLE,egl.SCORE,egl.EVAL_LEVEL,egl.NOTE,egl.BACKUP,
  365. ccc.NAME as PROJ_NM,
  366. CONCAT( DATE_FORMAT(iybg.ST_TM,'%Y-%m-%d'),'至',DATE_FORMAT(iybg.EN_TM ,'%Y-%m-%d') ) as JCTM
  367. <if test='projId != null and projId != ""'>
  368. ,twb.NAME as GRADER
  369. </if>
  370. from TAC_EVALUATION_GROUP_LEADER egl
  371. left join TAC_PAWP_RGSTR ccc on ccc.OBJ_ID=egl.PROJ_ID
  372. left join TAC_INSP_YEAR_BATCH_GROUP iybg on iybg.ID = ccc.GROUP_ID
  373. <if test='projId != null and projId != ""'>
  374. left join TAC_WORKER_B twb on twb.LOGIN_ID = egl.PERS_ID
  375. </if>
  376. where egl.GROUP_LEADER_ID=#{groupLeaderId}
  377. <if test=' projId!=null and projId!="" '>
  378. and egl.PROJ_ID = #{projId} and egl.PERS_ID is not null
  379. </if>
  380. <if test=' projId==null or projId=="" '>
  381. and egl.PERS_ID is null
  382. </if>
  383. </select>
  384. <!-- 修改 可恢复 -->
  385. <update id="updateScoreById" parameterType="cn.com.goldenwater.dcproj.model.TacEvaluationGroupLeader">
  386. update TAC_EVALUATION_GROUP_LEADER
  387. <trim prefix="SET" suffixOverrides=",">
  388. <if test='orgLeader != null'>ORG_LEADER = #{orgLeader},</if>
  389. <if test='businessLevel != null'>BUSINESS_LEVEL = #{businessLevel},</if>
  390. <if test='cphsManage != null'>CPHS_MANAGE = #{cphsManage},</if>
  391. <if test='workStyle != null'>WORK_STYLE = #{workStyle},</if>
  392. <if test='score != null'>SCORE = #{score},</if>
  393. <if test='evalLevel != null'>EVAL_LEVEL = #{evalLevel},</if>
  394. <if test='note != null'>NOTE = #{note},</if>
  395. BACKUP = CONCAT(ORG_LEADER,',',BUSINESS_LEVE,',',CPHS_MANAGE,',',WORK_STYLE,',',SCORE,',',EVAL_LEVEL,',',NOTE ),
  396. UPTM = sysdate()
  397. </trim>
  398. where ID = #{id}
  399. </update>
  400. <!-- 恢复修改内容 并清空备份 -->
  401. <update id="revertScoreById" parameterType="cn.com.goldenwater.dcproj.model.TacEvaluationGroupLeader">
  402. update TAC_EVALUATION_GROUP_LEADER
  403. set ORG_LEADER = #{orgLeader},
  404. BUSINESS_LEVEL = #{businessLevel},
  405. CPHS_MANAGE = #{cphsManage},
  406. WORK_STYLE = #{workStyle},
  407. SCORE = #{score},
  408. EVAL_LEVEL = #{evalLevel},
  409. NOTE = #{note},
  410. BACKUP = null,
  411. UPTM = sysdate()
  412. where ID = #{id}
  413. </update>
  414. <select id="selectOneDetailByProjIdAndGroupLeaderId" parameterType="java.lang.String" resultType="cn.com.goldenwater.dcproj.model.TacEvaluationGroupLeader">
  415. select * from TAC_EVALUATION_GROUP_LEADER
  416. where PROJ_ID=#{projId} and GROUP_LEADER_ID=#{groupLeaderId} and PERS_ID is null
  417. </select>
  418. <select id="selectHjScoreByProjIdAndGroupLeaderId" parameterType="java.lang.String" resultType="cn.com.goldenwater.dcproj.model.TacEvaluationGroupLeader">
  419. select
  420. round(avg(ORG_LEADER),2)ORG_LEADER,
  421. round(avg(BUSINESS_LEVEL),2)BUSINESS_LEVEL,
  422. round(avg(CPHS_MANAGE),2)CPHS_MANAGE,
  423. round(avg(WORK_STYLE),2)WORK_STYLE,
  424. round(avg(SCORE),2)SCORE
  425. from TAC_EVALUATION_GROUP_LEADER
  426. where PROJ_ID=#{projId} and GROUP_LEADER_ID=#{groupLeaderId} and PERS_ID is not null
  427. </select>
  428. </mapper>