TStaffmgrMapper.xml 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772
  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="com.ruoyi.project.plant.mapper.TStaffmgrMapper">
  6. <resultMap type="TStaffmgr" id="TStaffmgrResult">
  7. <result property="id" column="id" />
  8. <result property="plantCode" column="plant_code" />
  9. <result property="staffid" column="staffid" />
  10. <result property="name" column="name" />
  11. <result property="sex" column="sex" />
  12. <result property="birthday" column="birthday" />
  13. <result property="unit" column="unit" />
  14. <result property="team" column="team" />
  15. <result property="actualpost" column="actualpost" />
  16. <result property="contact" column="contact" />
  17. <result property="delFlag" column="del_flag" />
  18. <result property="createrCode" column="creater_code" />
  19. <result property="createdate" column="createdate" />
  20. <result property="updaterCode" column="updater_code" />
  21. <result property="updatedate" column="updatedate" />
  22. <result property="deptId" column="dept_id" />
  23. <result property="remarks" column="remarks" />
  24. <result property="deptName" column="dept_name" />
  25. <result property="education" column="education" />
  26. <result property="enAbility" column="en_ability" />
  27. <result property="mail" column="mail" />
  28. <result property="skillScore" column="skill_score" />
  29. <result property="accidentNum" column="accident_num" />
  30. <result property="photo" column="photo" />
  31. <result property="pId" column="p_id" />
  32. <result property="specialDuty" column="special_duty" />
  33. <result property="leftDate" column="left_date" />
  34. <result property="isRetire" column="is_retire" />
  35. <result property="region" column="region" />
  36. <result property="userId" column="user_id" />
  37. </resultMap>
  38. <sql id="selectTStaffmgrVo">
  39. select d.id, d.plant_code,d.left_date, d.staffid, d.name, d.photo, d.sex, d.birthday, d.unit, d.team, d.actualpost, d.contact, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks, d.education, d.en_ability, d.accident_num, d.mail, d.skill_score, d.p_id , d.special_duty, d.region, s.dept_name from t_staffmgr d
  40. left join sys_dept s on s.dept_id = d.dept_id
  41. </sql>
  42. <!-- 查询导师下拉列表 -->
  43. <select id="selectMentorList" parameterType="TStaffmgr" resultMap="TStaffmgrResult">
  44. select d.id, s.DICT_LABEL,d.plant_code, d.staffid, d.name, d.photo, d.sex, d.birthday, d.unit,
  45. d.team, d.actualpost, d.contact, d.del_flag, d.creater_code, d.createdate, d.updater_code,
  46. d.updatedate, d.dept_id, d.remarks, d.education, d.en_ability, d.accident_num, d.mail,
  47. d.skill_score, d.p_id , d.special_duty,d.region, s.dept_name
  48. from t_staffmgr d
  49. left join sys_dept s on s.dept_id = d.dept_id
  50. Left join SYS_DICT_DATA s0 on d.UNIT = s0.DICT_VALUE and s0.DICT_TYPE ='STAFF_UNIT'
  51. LEFT JOIN SYS_DICT_DATA s on d.ACTUALPOST = s.DICT_VALUE and s.DICT_TYPE = 'ACTUALPOST'
  52. LEFT JOIN SYS_DICT_DATA s1 on d.team = s1.DICT_VALUE and s1.DICT_TYPE = 'TEAM_DIVIDE'
  53. where
  54. (s.DICT_LABEL like '%主管%'
  55. or s.DICT_LABEL like '%经理%'
  56. or s.DICT_LABEL like '%工程师%')
  57. and d.DEL_FLAG!=9
  58. </select>
  59. <select id="selectUserInfoByStaffmgr" parameterType="TStaffmgr" resultType="map">
  60. select b.USER_ID userId,b.NICK_NAME nickName from T_STAFFMGR a
  61. left join SYS_USER b on a.STAFFID=b.STAFFID
  62. <where>
  63. <if test="actualposts != null and actualposts != ''">
  64. and actualpost in
  65. <foreach collection="actualposts.split(',')" item="item" index="index"
  66. open="(" close=")" separator=",">
  67. #{item}
  68. </foreach>
  69. </if>
  70. and a.DEL_FLAG=0
  71. </where>
  72. ${params.dataScope}
  73. </select>
  74. <select id="selectTStaffmgrListByDeptAndTeam" parameterType="TStaffmgr" resultMap="TStaffmgrResult">
  75. select u.user_id, d.id, d.plant_code,d.left_date, d.staffid, d.name, d.photo, d.sex, d.birthday, d.unit, d.team, d.actualpost, d.contact, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks, d.education, d.en_ability, d.accident_num, d.mail, d.skill_score, d.p_id , d.special_duty, d.region, s.dept_name from t_staffmgr d
  76. left join sys_dept s on s.dept_id = d.dept_id
  77. inner join sys_user u on d.staffid = u.staffid and u.del_flag = 0
  78. <where>
  79. <if test="deptId != null and deptId != ''"> and d.unit = #{deptId} </if>
  80. <if test="unit != null and unit != ''"> and d.dept_id = #{unit} </if>
  81. <if test="team != null and team != ''"> and d.team = #{team} </if>
  82. and d.del_flag = 0
  83. </where>
  84. </select>
  85. <select id="selectSaiExecutors" resultMap="TStaffmgrResult">
  86. select u.user_id, d.id, d.plant_code,d.left_date, d.staffid, d.name, d.photo, d.sex, d.birthday, d.unit, d.team, d.actualpost, d.contact, d.del_flag,
  87. d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks, d.education, d.en_ability, d.accident_num, d.mail, d.skill_score,
  88. d.p_id , d.special_duty, d.region, s.dept_name from t_staffmgr d
  89. left join sys_dept s on s.dept_id = d.dept_id
  90. inner join sys_user u on d.staffid = u.staffid
  91. inner join SYS_USER_ROLE ur on u.USER_ID = ur.USER_ID
  92. inner join SYS_ROLE r on ur.ROLE_ID = r.ROLE_ID
  93. where (
  94. d.dept_id in (10040, 108)
  95. or (d.dept_id = 103 and d.team = 18)
  96. or (d.dept_id = 103 and r.ROLE_ID = 20016)
  97. )
  98. and d.del_flag = 0
  99. </select>
  100. <select id="selectSaiInspectors" resultMap="TStaffmgrResult">
  101. select u.user_id, d.id, d.plant_code,d.left_date, d.staffid, d.name, d.photo, d.sex, d.birthday, d.unit, d.team, d.actualpost, d.contact, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks, d.education, d.en_ability, d.accident_num, d.mail, d.skill_score, d.p_id , d.special_duty, d.region, s.dept_name from t_staffmgr d
  102. left join sys_dept s on s.dept_id = d.dept_id
  103. inner join sys_user u on d.staffid = u.staffid
  104. where d.unit = 10 and d.team = 18 and d.del_flag = 0
  105. </select>
  106. <select id="selectTStaffmgrList" parameterType="TStaffmgr" resultMap="TStaffmgrResult">
  107. <include refid="selectTStaffmgrVo"/>
  108. Left join SYS_DICT_DATA s0 on d.UNIT = s0.DICT_VALUE and s0.DICT_TYPE ='STAFF_UNIT'
  109. LEFT JOIN SYS_DICT_DATA s on d.ACTUALPOST = s.DICT_VALUE and s.DICT_TYPE = 'ACTUALPOST'
  110. LEFT JOIN SYS_DICT_DATA s1 on d.team = s1.DICT_VALUE and s1.DICT_TYPE = 'TEAM_DIVIDE'
  111. <where>
  112. <if test="name != null and name != ''"> and name like concat(concat('%', #{name}), '%')</if>
  113. <if test="sex != null and sex != ''"> and sex = #{sex}</if>
  114. <if test="unit != null and unit != ''"> and unit = #{unit}</if>
  115. <if test="specialDuty != null and specialDuty != ''"> and special_duty like concat(concat('%', #{specialDuty}), '%')</if>
  116. <if test="units != null and units != ''">
  117. and
  118. unit in
  119. <foreach collection="units.split(',')" item="item" index="index"
  120. open="(" close=")" separator=",">
  121. #{item}
  122. </foreach>
  123. </if>
  124. <if test="team != null and team != ''"> and team = #{team}</if>
  125. <if test="teams != null and teams != ''">
  126. and
  127. team in
  128. <foreach collection="teams.split(',')" item="item" index="index"
  129. open="(" close=")" separator=",">
  130. #{item}
  131. </foreach>
  132. </if>
  133. <if test="actualpost != null and actualpost != ''"> and actualpost = #{actualpost}</if>
  134. <if test="actualposts != null and actualposts != ''">
  135. and
  136. actualpost in
  137. <foreach collection="actualposts.split(',')" item="item" index="index"
  138. open="(" close=")" separator=",">
  139. #{item}
  140. </foreach>
  141. </if>
  142. <if test="education != null and education != ''"> and education = #{education}</if>
  143. <if test="educations != null and educations != ''">
  144. and
  145. education in
  146. <foreach collection="educations.split(',')" item="item" index="index"
  147. open="(" close=")" separator=",">
  148. #{item}
  149. </foreach>
  150. </if>
  151. <if test="enAbility != null and enAbility != ''"> and en_ability = #{enAbility}</if>
  152. <if test="enAbilitys != null and enAbilitys != ''">
  153. and
  154. en_ability in
  155. <foreach collection="enAbilitys.split(',')" item="item" index="index"
  156. open="(" close=")" separator=",">
  157. #{item}
  158. </foreach>
  159. </if>
  160. <if test="haveEmail != null and haveEmail != ''"> and mail IS NOT NULL</if>
  161. <if test="skillevaluation != null"> and team = 10
  162. or team = 12
  163. or team = 14
  164. or team = 16
  165. </if>
  166. and d.del_flag = 0
  167. </where>
  168. <!-- 数据范围过滤 -->
  169. ${params.dataScope}
  170. ORDER BY s0.DICT_SORT, s1.DICT_SORT ,s.DICT_SORT , d.staffid
  171. </select>
  172. <select id="selectTStaffmgrListByDeptId" parameterType="TStaffmgr" resultMap="TStaffmgrResult">
  173. <include refid="selectTStaffmgrVo"/>
  174. <where>
  175. <if test="actualpost != null and actualpost != ''"> and actualpost = #{actualpost}</if>
  176. <if test="actualposts != null and actualposts != ''">
  177. and
  178. actualpost in
  179. <foreach collection="actualposts.split(',')" item="item" index="index"
  180. open="(" close=")" separator=",">
  181. #{item}
  182. </foreach>
  183. </if>
  184. <if test="deptId != null and deptId != ''"> and d.dept_id = #{deptId} </if>
  185. and d.del_flag = 0
  186. </where>
  187. </select>
  188. <select id="selectAllTStaffmgrList" parameterType="TStaffmgr" resultMap="TStaffmgrResult">
  189. <include refid="selectTStaffmgrVo"/>
  190. Left join SYS_DICT_DATA s0 on d.UNIT = s0.DICT_VALUE and s0.DICT_TYPE ='STAFF_UNIT'
  191. LEFT JOIN SYS_DICT_DATA s on d.ACTUALPOST = s.DICT_VALUE and s.DICT_TYPE = 'ACTUALPOST'
  192. LEFT JOIN SYS_DICT_DATA s1 on d.team = s1.DICT_VALUE and s1.DICT_TYPE = 'TEAM_DIVIDE'
  193. <where>
  194. <if test="name != null and name != ''"> and name like concat(concat('%', #{name}), '%')</if>
  195. <if test="sex != null and sex != ''"> and sex = #{sex}</if>
  196. <if test="unit != null and unit != ''"> and unit = #{unit}</if>
  197. <if test="specialDuty != null and specialDuty != ''"> and special_duty like concat(concat('%', #{specialDuty}), '%')</if>
  198. <if test="units != null and units != ''">
  199. and
  200. unit in
  201. <foreach collection="units.split(',')" item="item" index="index"
  202. open="(" close=")" separator=",">
  203. #{item}
  204. </foreach>
  205. </if>
  206. <if test="team != null and team != ''"> and team = #{team}</if>
  207. <if test="teams != null and teams != ''">
  208. and
  209. team in
  210. <foreach collection="teams.split(',')" item="item" index="index"
  211. open="(" close=")" separator=",">
  212. #{item}
  213. </foreach>
  214. </if>
  215. <if test="actualpost != null and actualpost != ''"> and actualpost = #{actualpost}</if>
  216. <if test="actualposts != null and actualposts != ''">
  217. and
  218. actualpost in
  219. <foreach collection="actualposts.split(',')" item="item" index="index"
  220. open="(" close=")" separator=",">
  221. #{item}
  222. </foreach>
  223. </if>
  224. <if test="education != null and education != ''"> and education = #{education}</if>
  225. <if test="educations != null and educations != ''">
  226. and
  227. education in
  228. <foreach collection="educations.split(',')" item="item" index="index"
  229. open="(" close=")" separator=",">
  230. #{item}
  231. </foreach>
  232. </if>
  233. <if test="enAbility != null and enAbility != ''"> and en_ability = #{enAbility}</if>
  234. <if test="enAbilitys != null and enAbilitys != ''">
  235. and
  236. en_ability in
  237. <foreach collection="enAbilitys.split(',')" item="item" index="index"
  238. open="(" close=")" separator=",">
  239. #{item}
  240. </foreach>
  241. </if>
  242. <if test="haveEmail != null and haveEmail != ''"> and mail IS NOT NULL</if>
  243. <if test="deptId != null and deptId != ''"> and d.dept_id = #{deptId}</if>
  244. <if test="skillevaluation != null"> and team = 10
  245. or team = 12
  246. or team = 14
  247. or team = 16
  248. </if>
  249. and (d.del_flag = 0 or d.del_flag = 9)
  250. </where>
  251. <!-- 数据范围过滤 -->
  252. ${params.dataScope}
  253. ORDER BY s0.DICT_SORT, s1.DICT_SORT ,s.DICT_SORT
  254. </select>
  255. <select id="selectTStaffmgrListAll" parameterType="TStaffmgr" resultMap="TStaffmgrResult">
  256. <include refid="selectTStaffmgrVo"/>
  257. Left join SYS_DICT_DATA s0 on d.UNIT = s0.DICT_VALUE and s0.DICT_TYPE ='STAFF_UNIT'
  258. LEFT JOIN SYS_DICT_DATA s on d.ACTUALPOST = s.DICT_VALUE and s.DICT_TYPE = 'ACTUALPOST'
  259. LEFT JOIN SYS_DICT_DATA s1 on d.team = s1.DICT_VALUE and s1.DICT_TYPE = 'TEAM_DIVIDE'
  260. <where>
  261. and d.del_flag in (0 , 9)
  262. </where>
  263. ORDER BY s0.DICT_SORT, s1.DICT_SORT ,s.DICT_SORT
  264. </select>
  265. <select id="selectRecordList" parameterType="TStaffmgr" resultMap="TStaffmgrResult">
  266. <include refid="selectTStaffmgrVo"/>
  267. LEFT JOIN SYS_DICT_DATA s on d.ACTUALPOST = s.DICT_VALUE and s.DICT_TYPE = 'ACTUALPOST'
  268. <where>
  269. <if test="units != null and units != ''">
  270. and
  271. unit in
  272. <foreach collection="units.split(',')" item="item" index="index"
  273. open="(" close=")" separator=",">
  274. #{item}
  275. </foreach>
  276. </if>
  277. <if test="actualposts != null and actualposts != ''">
  278. and
  279. actualpost in
  280. <foreach collection="actualposts.split(',')" item="item" index="index"
  281. open="(" close=")" separator=",">
  282. #{item}
  283. </foreach>
  284. </if>
  285. and d.del_flag in (0 , 9)
  286. </where>
  287. <!-- 数据范围过滤 -->
  288. ${params.dataScope}
  289. ORDER BY s.DICT_SORT, d.id
  290. </select>
  291. <select id="selectList" parameterType="TStaffmgr" resultMap="TStaffmgrResult">
  292. <include refid="selectTStaffmgrVo"/>
  293. <where>
  294. and d.del_flag = 0
  295. </where>
  296. <!-- 数据范围过滤 -->
  297. ${params.dataScope}
  298. </select>
  299. <select id="selectTaskList" parameterType="TStaffmgr" resultMap="TStaffmgrResult">
  300. <include refid="selectTStaffmgrVo"/>
  301. <where>
  302. and d.del_flag = 0
  303. </where>
  304. </select>
  305. <select id="selectLeftTStaffmgrList" parameterType="TStaffmgr" resultMap="TStaffmgrResult">
  306. <include refid="selectTStaffmgrVo"/>
  307. <where>
  308. and d.del_flag = 9
  309. <if test="isRetire != null"> and is_retire = #{isRetire}</if>
  310. </where>
  311. <!-- 数据范围过滤 -->
  312. ${params.dataScope}
  313. order by d.left_date desc
  314. </select>
  315. <select id="selectTStaffmgrById" parameterType="Long" resultMap="TStaffmgrResult">
  316. <include refid="selectTStaffmgrVo"/>
  317. where id = #{id}
  318. </select>
  319. <select id="selectTStaffmgrByStaffId" parameterType="String" resultMap="TStaffmgrResult">
  320. <include refid="selectTStaffmgrVo"/>
  321. where d.staffid = #{staffid} and d.del_flag = 0
  322. </select>
  323. <insert id="insertTStaffmgr" parameterType="TStaffmgr" useGeneratedKeys="true" keyProperty="id">
  324. <selectKey keyProperty="id" resultType="long" order="BEFORE">
  325. SELECT seq_t_staffmgr.NEXTVAL as id FROM DUAL
  326. </selectKey>
  327. insert into t_staffmgr
  328. <trim prefix="(" suffix=")" suffixOverrides=",">
  329. <if test="id != null">id,</if>
  330. <if test="plantCode != null and plantCode != ''">plant_code,</if>
  331. <if test="staffid != null and staffid != ''">staffid,</if>
  332. <if test="name != null and name != ''">name,</if>
  333. <if test="sex != null and sex != ''">sex,</if>
  334. <if test="birthday != null">birthday,</if>
  335. <if test="unit != null">unit,</if>
  336. <if test="team != null">team,</if>
  337. <if test="actualpost != null">actualpost,</if>
  338. <if test="contact != null">contact,</if>
  339. <if test="education != null">education,</if>
  340. <if test="enAbility != null">en_ability,</if>
  341. <if test="mail != null">mail,</if>
  342. <if test="accidentNum != null">accident_num,</if>
  343. <if test="delFlag != null">del_flag,</if>
  344. <if test="createrCode != null">creater_code,</if>
  345. <if test="createdate != null">createdate,</if>
  346. <if test="updaterCode != null">updater_code,</if>
  347. <if test="updatedate != null">updatedate,</if>
  348. <if test="deptId != null">dept_id,</if>
  349. <if test="remarks != null">remarks,</if>
  350. <if test="skillScore != null">skill_score,</if>
  351. <if test="photo != null">photo,</if>
  352. <if test="pId != null">p_id,</if>
  353. <if test="specialDuty != null">special_duty,</if>
  354. <if test="region != null">region,</if>
  355. </trim>
  356. <trim prefix="values (" suffix=")" suffixOverrides=",">
  357. <if test="id != null">#{id},</if>
  358. <if test="plantCode != null and plantCode != ''">#{plantCode},</if>
  359. <if test="staffid != null and staffid != ''">#{staffid},</if>
  360. <if test="name != null and name != ''">#{name},</if>
  361. <if test="sex != null and sex != ''">#{sex},</if>
  362. <if test="birthday != null">#{birthday},</if>
  363. <if test="unit != null">#{unit},</if>
  364. <if test="team != null">#{team},</if>
  365. <if test="actualpost != null">#{actualpost},</if>
  366. <if test="contact != null">#{contact},</if>
  367. <if test="education != null">#{education},</if>
  368. <if test="enAbility != null">#{enAbility},</if>
  369. <if test="mail != null">#{mail},</if>
  370. <if test="accidentNum != null">#{accidentNum},</if>
  371. <if test="delFlag != null">#{delFlag},</if>
  372. <if test="createrCode != null">#{createrCode},</if>
  373. <if test="createdate != null">#{createdate},</if>
  374. <if test="updaterCode != null">#{updaterCode},</if>
  375. <if test="updatedate != null">#{updatedate},</if>
  376. <if test="deptId != null">#{deptId},</if>
  377. <if test="remarks != null">#{remarks},</if>
  378. <if test="skillScore != null">#{skillScore},</if>
  379. <if test="photo != null">#{photo},</if>
  380. <if test="pId != null">#{pId},</if>
  381. <if test="specialDuty != null">#{specialDuty},</if>
  382. <if test="region != null">#{region},</if>
  383. </trim>
  384. </insert>
  385. <update id="updateTStaffmgr" parameterType="TStaffmgr">
  386. update t_staffmgr
  387. <trim prefix="SET" suffixOverrides=",">
  388. <if test="plantCode != null and plantCode != ''">plant_code = #{plantCode},</if>
  389. <if test="staffid != null and staffid != ''">staffid = #{staffid},</if>
  390. <if test="name != null and name != ''">name = #{name},</if>
  391. <if test="sex != null and sex != ''">sex = #{sex},</if>
  392. <if test="birthday != null">birthday = #{birthday},</if>
  393. <if test="unit != null">unit = #{unit},</if>
  394. <if test="team != null">team = #{team},</if>
  395. <if test="actualpost != null">actualpost = #{actualpost},</if>
  396. <if test="contact != null">contact = #{contact},</if>
  397. <if test="education != null">education = #{education},</if>
  398. <if test="enAbility != null">en_ability = #{enAbility},</if>
  399. <if test="accidentNum != null">accident_num = #{accidentNum},</if>
  400. <if test="mail != null">mail = #{mail},</if>
  401. <if test="skillScore != null">skill_score = #{skillScore},</if>
  402. <if test="delFlag != null">del_flag = #{delFlag},</if>
  403. <if test="createrCode != null">creater_code = #{createrCode},</if>
  404. <if test="createdate != null">createdate = #{createdate},</if>
  405. <if test="updaterCode != null">updater_code = #{updaterCode},</if>
  406. <if test="region != null">region = #{region},</if>
  407. <if test="updatedate != null">updatedate = #{updatedate},</if>
  408. <if test="deptId != null">dept_id = #{deptId},</if>
  409. <if test="remarks != null">remarks = #{remarks},</if>
  410. <if test="photo != null">photo = #{photo},</if>
  411. <if test="pId != null">p_id = #{pId},</if>
  412. <if test="specialDuty != null">special_duty = #{specialDuty},</if>
  413. <if test="leftDate != null">left_date = #{leftDate},</if>
  414. </trim>
  415. where id = #{id}
  416. </update>
  417. <update id="deleteTStaffmgrById" parameterType="Long">
  418. update t_staffmgr set del_flag = 2 where id = #{id}
  419. </update>
  420. <update id="deleteLeftTStaffmgrByIds" parameterType="Long">
  421. update t_staffmgr set del_flag = 9 , LEFT_DATE = SYSDATE,is_retire = 0 where id = #{id}
  422. </update>
  423. <update id="deleteRetireTStaffmgrByIds" parameterType="Long">
  424. update t_staffmgr set del_flag = 9 , LEFT_DATE = SYSDATE ,is_retire = 1 where id = #{id}
  425. </update>
  426. <update id="reLeftTStaffmgrByIds" parameterType="Long">
  427. update t_staffmgr set del_flag = 0 , LEFT_DATE = null where id = #{id}
  428. </update>
  429. <update id="deleteTStaffmgrByIds" parameterType="String">
  430. update t_staffmgr set del_flag = 2 where id in
  431. <foreach item="id" collection="array" open="(" separator="," close=")">
  432. #{id}
  433. </foreach>
  434. </update>
  435. <select id="selectEduData" resultType="com.ruoyi.project.common.domain.DataEntity">
  436. SELECT count(1) as dataNum,d.EDUCATION as dataName FROM "T_STAFFMGR" d
  437. <where>
  438. <if test="name != null and name != ''"> and name like concat(concat('%', #{name}), '%')</if>
  439. <if test="sex != null and sex != ''"> and sex = #{sex}</if>
  440. <if test="unit != null and unit != ''"> and unit = #{unit}</if>
  441. <if test="specialDuty != null and specialDuty != ''"> and special_duty like concat(concat('%', #{specialDuty}), '%')</if>
  442. <if test="units != null and units != ''">
  443. and
  444. unit in
  445. <foreach collection="units.split(',')" item="item" index="index"
  446. open="(" close=")" separator=",">
  447. #{item}
  448. </foreach>
  449. </if>
  450. <if test="team != null and team != ''"> and team = #{team}</if>
  451. <if test="teams != null and teams != ''">
  452. and
  453. team in
  454. <foreach collection="teams.split(',')" item="item" index="index"
  455. open="(" close=")" separator=",">
  456. #{item}
  457. </foreach>
  458. </if>
  459. <if test="actualpost != null and actualpost != ''"> and actualpost = #{actualpost}</if>
  460. <if test="actualposts != null and actualposts != ''">
  461. and
  462. actualpost in
  463. <foreach collection="actualposts.split(',')" item="item" index="index"
  464. open="(" close=")" separator=",">
  465. #{item}
  466. </foreach>
  467. </if>
  468. <if test="education != null and education != ''"> and education = #{education}</if>
  469. <if test="educations != null and educations != ''">
  470. and
  471. education in
  472. <foreach collection="educations.split(',')" item="item" index="index"
  473. open="(" close=")" separator=",">
  474. #{item}
  475. </foreach>
  476. </if>
  477. <if test="enAbility != null and enAbility != ''"> and en_ability = #{enAbility}</if>
  478. <if test="enAbilitys != null and enAbilitys != ''">
  479. and
  480. en_ability in
  481. <foreach collection="enAbilitys.split(',')" item="item" index="index"
  482. open="(" close=")" separator=",">
  483. #{item}
  484. </foreach>
  485. </if>
  486. <if test="haveEmail != null and haveEmail != ''"> and mail IS NOT NULL</if>
  487. <if test="skillevaluation != null"> and team = 10
  488. or team = 12
  489. or team = 14
  490. or team = 16
  491. </if>
  492. and d.del_flag = 0
  493. </where>
  494. <!-- 数据范围过滤 -->
  495. ${params.dataScope}
  496. GROUP BY EDUCATION
  497. order by dataName
  498. </select>
  499. <select id="selectEngData" resultType="com.ruoyi.project.common.domain.DataEntity">
  500. SELECT count(1) as dataNum,d.en_ability as dataName FROM "T_STAFFMGR" d
  501. <where>
  502. <if test="name != null and name != ''"> and name like concat(concat('%', #{name}), '%')</if>
  503. <if test="sex != null and sex != ''"> and sex = #{sex}</if>
  504. <if test="unit != null and unit != ''"> and unit = #{unit}</if>
  505. <if test="specialDuty != null and specialDuty != ''"> and special_duty like concat(concat('%', #{specialDuty}), '%')</if>
  506. <if test="units != null and units != ''">
  507. and
  508. unit in
  509. <foreach collection="units.split(',')" item="item" index="index"
  510. open="(" close=")" separator=",">
  511. #{item}
  512. </foreach>
  513. </if>
  514. <if test="team != null and team != ''"> and team = #{team}</if>
  515. <if test="teams != null and teams != ''">
  516. and
  517. team in
  518. <foreach collection="teams.split(',')" item="item" index="index"
  519. open="(" close=")" separator=",">
  520. #{item}
  521. </foreach>
  522. </if>
  523. <if test="actualpost != null and actualpost != ''"> and actualpost = #{actualpost}</if>
  524. <if test="actualposts != null and actualposts != ''">
  525. and
  526. actualpost in
  527. <foreach collection="actualposts.split(',')" item="item" index="index"
  528. open="(" close=")" separator=",">
  529. #{item}
  530. </foreach>
  531. </if>
  532. <if test="education != null and education != ''"> and education = #{education}</if>
  533. <if test="educations != null and educations != ''">
  534. and
  535. education in
  536. <foreach collection="educations.split(',')" item="item" index="index"
  537. open="(" close=")" separator=",">
  538. #{item}
  539. </foreach>
  540. </if>
  541. <if test="enAbility != null and enAbility != ''"> and en_ability = #{enAbility}</if>
  542. <if test="enAbilitys != null and enAbilitys != ''">
  543. and
  544. en_ability in
  545. <foreach collection="enAbilitys.split(',')" item="item" index="index"
  546. open="(" close=")" separator=",">
  547. #{item}
  548. </foreach>
  549. </if>
  550. <if test="haveEmail != null and haveEmail != ''"> and mail IS NOT NULL</if>
  551. <if test="skillevaluation != null"> and team = 10
  552. or team = 12
  553. or team = 14
  554. or team = 16
  555. </if>
  556. and d.del_flag = 0
  557. </where>
  558. <!-- 数据范围过滤 -->
  559. ${params.dataScope}
  560. GROUP BY en_ability
  561. order by dataName
  562. </select>
  563. <select id="selectTeamData" resultType="com.ruoyi.project.common.domain.DataEntity">
  564. SELECT count(1) as dataNum,d.team as dataName FROM "T_STAFFMGR" d
  565. <where>
  566. <if test="name != null and name != ''"> and name like concat(concat('%', #{name}), '%')</if>
  567. <if test="sex != null and sex != ''"> and sex = #{sex}</if>
  568. <if test="unit != null and unit != ''"> and unit = #{unit}</if>
  569. <if test="specialDuty != null and specialDuty != ''"> and special_duty like concat(concat('%', #{specialDuty}), '%')</if>
  570. <if test="units != null and units != ''">
  571. and
  572. unit in
  573. <foreach collection="units.split(',')" item="item" index="index"
  574. open="(" close=")" separator=",">
  575. #{item}
  576. </foreach>
  577. </if>
  578. <if test="team != null and team != ''"> and team = #{team}</if>
  579. <if test="teams != null and teams != ''">
  580. and
  581. team in
  582. <foreach collection="teams.split(',')" item="item" index="index"
  583. open="(" close=")" separator=",">
  584. #{item}
  585. </foreach>
  586. </if>
  587. <if test="actualpost != null and actualpost != ''"> and actualpost = #{actualpost}</if>
  588. <if test="actualposts != null and actualposts != ''">
  589. and
  590. actualpost in
  591. <foreach collection="actualposts.split(',')" item="item" index="index"
  592. open="(" close=")" separator=",">
  593. #{item}
  594. </foreach>
  595. </if>
  596. <if test="education != null and education != ''"> and education = #{education}</if>
  597. <if test="educations != null and educations != ''">
  598. and
  599. education in
  600. <foreach collection="educations.split(',')" item="item" index="index"
  601. open="(" close=")" separator=",">
  602. #{item}
  603. </foreach>
  604. </if>
  605. <if test="enAbility != null and enAbility != ''"> and en_ability = #{enAbility}</if>
  606. <if test="enAbilitys != null and enAbilitys != ''">
  607. and
  608. en_ability in
  609. <foreach collection="enAbilitys.split(',')" item="item" index="index"
  610. open="(" close=")" separator=",">
  611. #{item}
  612. </foreach>
  613. </if>
  614. <if test="haveEmail != null and haveEmail != ''"> and mail IS NOT NULL</if>
  615. <if test="skillevaluation != null"> and team = 10
  616. or team = 12
  617. or team = 14
  618. or team = 16
  619. </if>
  620. and d.del_flag = 0
  621. </where>
  622. <!-- 数据范围过滤 -->
  623. ${params.dataScope}
  624. GROUP BY team
  625. order by dataName
  626. </select>
  627. <select id="selectAgeData" resultType="com.ruoyi.project.common.domain.DataEntity">
  628. SELECT
  629. CASE
  630. WHEN BIRTHDAY IS NULL THEN '未知'
  631. WHEN FLOOR((MONTHS_BETWEEN(SYSDATE, BIRTHDAY) / 12) / 10) * 10 <![CDATA[<]]> 20 THEN '20以下'
  632. WHEN FLOOR((MONTHS_BETWEEN(SYSDATE, BIRTHDAY) / 12) / 10) * 10 >= 60 THEN '60以上'
  633. ELSE TO_CHAR(FLOOR((MONTHS_BETWEEN(SYSDATE, BIRTHDAY) / 12) / 10) * 10) || '到' || TO_CHAR(FLOOR((MONTHS_BETWEEN(SYSDATE, BIRTHDAY) / 12) / 10) * 10 + 9)
  634. END AS dataName,
  635. COUNT(*) AS dataNum
  636. FROM
  637. T_STAFFMGR d
  638. <where>
  639. <if test="name != null and name != ''"> and name like concat(concat('%', #{name}), '%')</if>
  640. <if test="sex != null and sex != ''"> and sex = #{sex}</if>
  641. <if test="unit != null and unit != ''"> and unit = #{unit}</if>
  642. <if test="specialDuty != null and specialDuty != ''"> and special_duty like concat(concat('%', #{specialDuty}), '%')</if>
  643. <if test="units != null and units != ''">
  644. and
  645. unit in
  646. <foreach collection="units.split(',')" item="item" index="index"
  647. open="(" close=")" separator=",">
  648. #{item}
  649. </foreach>
  650. </if>
  651. <if test="team != null and team != ''"> and team = #{team}</if>
  652. <if test="teams != null and teams != ''">
  653. and
  654. team in
  655. <foreach collection="teams.split(',')" item="item" index="index"
  656. open="(" close=")" separator=",">
  657. #{item}
  658. </foreach>
  659. </if>
  660. <if test="actualpost != null and actualpost != ''"> and actualpost = #{actualpost}</if>
  661. <if test="actualposts != null and actualposts != ''">
  662. and
  663. actualpost in
  664. <foreach collection="actualposts.split(',')" item="item" index="index"
  665. open="(" close=")" separator=",">
  666. #{item}
  667. </foreach>
  668. </if>
  669. <if test="education != null and education != ''"> and education = #{education}</if>
  670. <if test="educations != null and educations != ''">
  671. and
  672. education in
  673. <foreach collection="educations.split(',')" item="item" index="index"
  674. open="(" close=")" separator=",">
  675. #{item}
  676. </foreach>
  677. </if>
  678. <if test="enAbility != null and enAbility != ''"> and en_ability = #{enAbility}</if>
  679. <if test="enAbilitys != null and enAbilitys != ''">
  680. and
  681. en_ability in
  682. <foreach collection="enAbilitys.split(',')" item="item" index="index"
  683. open="(" close=")" separator=",">
  684. #{item}
  685. </foreach>
  686. </if>
  687. <if test="haveEmail != null and haveEmail != ''"> and mail IS NOT NULL</if>
  688. <if test="skillevaluation != null"> and team = 10
  689. or team = 12
  690. or team = 14
  691. or team = 16
  692. </if>
  693. and d.del_flag = 0
  694. </where>
  695. <!-- 数据范围过滤 -->
  696. ${params.dataScope}
  697. GROUP BY
  698. CASE
  699. WHEN BIRTHDAY IS NULL THEN '未知'
  700. WHEN FLOOR((MONTHS_BETWEEN(SYSDATE, BIRTHDAY) / 12) / 10) * 10 <![CDATA[<]]> 20 THEN '20以下'
  701. WHEN FLOOR((MONTHS_BETWEEN(SYSDATE, BIRTHDAY) / 12) / 10) * 10 >= 60 THEN '60以上'
  702. ELSE TO_CHAR(FLOOR((MONTHS_BETWEEN(SYSDATE, BIRTHDAY) / 12) / 10) * 10) || '到' || TO_CHAR(FLOOR((MONTHS_BETWEEN(SYSDATE, BIRTHDAY) / 12) / 10) * 10 + 9)
  703. END
  704. ORDER BY
  705. dataName
  706. </select>
  707. <select id="selectTMentorStaffmgrByPost" resultMap="TStaffmgrResult">
  708. <include refid="selectTStaffmgrVo"/>
  709. LEFT JOIN SYS_DICT_DATA s on d.ACTUALPOST = s.DICT_VALUE and s.DICT_TYPE = 'ACTUALPOST'
  710. where
  711. d.dept_id = #{deptId}
  712. and d.del_flag = 0
  713. and (s.DICT_LABEL like '%主管%'
  714. or s.DICT_LABEL like '%经理%'
  715. or s.DICT_LABEL like '%工程师%'
  716. )
  717. </select>
  718. <select id="selectTStaffmgrByPost" resultMap="TStaffmgrResult">
  719. <include refid="selectTStaffmgrVo"/>
  720. LEFT JOIN SYS_DICT_DATA s on d.ACTUALPOST = s.DICT_VALUE and s.DICT_TYPE = 'ACTUALPOST'
  721. where
  722. d.dept_id = #{deptId}
  723. and d.del_flag = 0
  724. and (s.DICT_LABEL like '%主操%'
  725. or s.DICT_LABEL like '%班长%'
  726. or s.DICT_LABEL like '%工长%'
  727. )
  728. </select>
  729. </mapper>