BdglPeopleMapper.xml 58 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078
  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.supervision.peopleManage.mapper.BdglPeopleMapper">
  6. <resultMap type="BdglPeople" id="BdglPeopleResult">
  7. <result property="id" column="id" />
  8. <result property="name" column="name" />
  9. <result property="sex" column="sex" />
  10. <result property="age" column="age" />
  11. <result property="birthDate" column="birth_date" />
  12. <result property="command" column="command" />
  13. <result property="duty" column="duty" />
  14. <result property="postId" column="post_id" />
  15. <result property="gradeId" column="grade_id" />
  16. <result property="postDate" column="post_date" />
  17. <result property="job" column="job" />
  18. <result property="skillId" column="skill_id" />
  19. <result property="skillDate" column="skill_date" />
  20. <result property="levelId" column="level_id" />
  21. <result property="levelDate" column="level_date" />
  22. <result property="military" column="military" />
  23. <result property="idcard" column="idcard" />
  24. <result property="enlistDate" column="enlist_date" />
  25. <result property="enlistaddress" column="enlistaddress" />
  26. <result property="rankId" column="rank_id" />
  27. <result property="rankDate" column="rank_date" />
  28. <result property="nationId" column="nation_id" />
  29. <result property="origin" column="origin" />
  30. <result property="classId" column="class_id" />
  31. <result property="educationId" column="education_id" />
  32. <result property="degreeId" column="degree_id" />
  33. <result property="graduationDate" column="graduation_date" />
  34. <result property="school" column="school" />
  35. <result property="partyId" column="party_id" />
  36. <result property="partyDate" column="party_date" />
  37. <result property="training" column="training" />
  38. <result property="readmeFile" column="readme_file" />
  39. <result property="readmeFileName" column="readme_file_name" />
  40. <result property="prize" column="prize" />
  41. <result property="marryList" column="marry_list" />
  42. <result property="childrenList" column="children_list" />
  43. <result property="unitId" column="unit_id" />
  44. <result property="avatar" column="avatar" />
  45. <result property="address" column="address" />
  46. <result property="phone" column="phone" />
  47. <result property="status" column="status" />
  48. <result property="createtimes" column="createtimes" />
  49. <result property="updatetimes" column="updatetimes" />
  50. <result property="reign" column="reign" />
  51. <result property="jobTime" column="job_time" />
  52. <result property="healthy" column="healthy" />
  53. <result property="bloodType" column="blood_type" />
  54. <result property="postTime" column="post_time" />
  55. <result property="major" column="major" />
  56. <result property="admissionTime" column="admission_time" />
  57. <result property="mobilePhoneModel" column="mobile_phone_model" />
  58. <result property="guaranteeCardNo" column="guarantee_card_no" />
  59. <result property="payrollCardNo" column="payroll_card_no" />
  60. <result property="authorizedStrength" column="authorized_strength" />
  61. <result property="aboral" column="aboral" />
  62. <result property="live" column="live" />
  63. <result property="deptId" column="dept_id" />
  64. <result property="userId" column="user_id" />
  65. <result property="nowMilitaryRank" column="now_military_rank" />
  66. <result property="treatmentLevel" column="treatment_level" />
  67. <result property="rankUpgradeTime" column="Rank_upgrade_time" />
  68. <result property="deptName" column="dept_name" />
  69. <result property="phoneStandby" column="phone_standby" />
  70. <result property="isBianzhi" column="is_bianzhi" />
  71. <result property="statusrk" column="statusrk" />
  72. </resultMap>
  73. <sql id="selectBdglPeopleVo">
  74. select id, name, sex, age, birth_date, command, duty, post_id, grade_id, post_date, job, skill_id, skill_date, level_id, level_date, military, idcard, enlist_date, enlistaddress, rank_id, rank_date, nation_id, origin, class_id, education_id, degree_id, graduation_date, school, party_id, party_date, training, readme_file, readme_file_name, prize, marry_list, children_list, unit_id, avatar, address, phone, status, createtimes, updatetimes, reign, job_time, healthy, blood_type, post_time, major, admission_time, mobile_phone_model, guarantee_card_no, payroll_card_no, authorized_strength, aboral, live, dept_id, user_id, now_military_rank, treatment_level, Rank_upgrade_time,dept_name,phone_standby,is_bianzhi,statusrk from bdgl_people
  75. </sql>
  76. <select id="selectBdglPeopleList" parameterType="BdglPeople" resultMap="BdglPeopleResult">
  77. <include refid="selectBdglPeopleVo"/>
  78. <where>
  79. and status=0
  80. <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
  81. <if test="sex != null and sex != ''"> and sex = #{sex}</if>
  82. <if test="age != null "> and age = #{age}</if>
  83. <if test="birthDate != null "> and birth_date = #{birthDate}</if>
  84. <if test="command != null and command != ''"> and command = #{command}</if>
  85. <if test="duty != null and duty != ''"> and duty = #{duty}</if>
  86. <if test="postId != null "> and post_id = #{postId}</if>
  87. <if test="gradeId != null "> and grade_id = #{gradeId}</if>
  88. <if test="postDate != null "> and post_date = #{postDate}</if>
  89. <if test="job != null and job != ''"> and job = #{job}</if>
  90. <if test="skillId != null "> and skill_id = #{skillId}</if>
  91. <if test="skillDate != null "> and skill_date = #{skillDate}</if>
  92. <if test="levelId != null "> and level_id = #{levelId}</if>
  93. <if test="levelDate != null "> and level_date = #{levelDate}</if>
  94. <if test="military != null and military != ''"> and military = #{military}</if>
  95. <if test="idcard != null and idcard != ''"> and idcard = #{idcard}</if>
  96. <if test="enlistDate != null "> and enlist_date = #{enlistDate}</if>
  97. <if test="enlistaddress != null and enlistaddress != ''"> and enlistaddress = #{enlistaddress}</if>
  98. <if test="rankId != null "> and rank_id = #{rankId}</if>
  99. <if test="rankDate != null "> and rank_date = #{rankDate}</if>
  100. <if test="nationId != null "> and nation_id = #{nationId}</if>
  101. <if test="origin != null and origin != ''"> and origin = #{origin}</if>
  102. <if test="classId != null "> and class_id = #{classId}</if>
  103. <if test="educationId != null "> and education_id = #{educationId}</if>
  104. <if test="degreeId != null "> and degree_id = #{degreeId}</if>
  105. <if test="graduationDate != null "> and graduation_date = #{graduationDate}</if>
  106. <if test="school != null and school != ''"> and school = #{school}</if>
  107. <if test="partyId != null "> and party_id = #{partyId}</if>
  108. <if test="partyDate != null "> and party_date = #{partyDate}</if>
  109. <if test="training != null and training != ''"> and training = #{training}</if>
  110. <if test="readmeFile != null and readmeFile != ''"> and readme_file = #{readmeFile}</if>
  111. <if test="readmeFileName != null and readmeFileName != ''"> and readme_file_name like concat('%', #{readmeFileName}, '%')</if>
  112. <if test="prize != null and prize != ''"> and prize = #{prize}</if>
  113. <if test="marryList != null and marryList != ''"> and marry_list = #{marryList}</if>
  114. <if test="childrenList != null and childrenList != ''"> and children_list = #{childrenList}</if>
  115. <if test="unitId != null and unitId != ''"> and unit_id = #{unitId}</if>
  116. <if test="avatar != null and avatar != ''"> and avatar = #{avatar}</if>
  117. <if test="address != null and address != ''"> and address = #{address}</if>
  118. <if test="phone != null and phone != ''"> and phone = #{phone}</if>
  119. <if test="status != null "> and status = #{status}</if>
  120. <if test="createtimes != null "> and createtimes = #{createtimes}</if>
  121. <if test="updatetimes != null "> and updatetimes = #{updatetimes}</if>
  122. <if test="reign != null "> and reign = #{reign}</if>
  123. <if test="jobTime != null "> and job_time = #{jobTime}</if>
  124. <if test="healthy != null and healthy != ''"> and healthy = #{healthy}</if>
  125. <if test="bloodType != null and bloodType != ''"> and blood_type = #{bloodType}</if>
  126. <if test="postTime != null "> and post_time = #{postTime}</if>
  127. <if test="major != null and major != ''"> and major = #{major}</if>
  128. <if test="admissionTime != null "> and admission_time = #{admissionTime}</if>
  129. <if test="mobilePhoneModel != null and mobilePhoneModel != ''"> and mobile_phone_model = #{mobilePhoneModel}</if>
  130. <if test="guaranteeCardNo != null and guaranteeCardNo != ''"> and guarantee_card_no = #{guaranteeCardNo}</if>
  131. <if test="payrollCardNo != null and payrollCardNo != ''"> and payroll_card_no = #{payrollCardNo}</if>
  132. <if test="authorizedStrength != null and authorizedStrength != ''"> and authorized_strength = #{authorizedStrength}</if>
  133. <if test="aboral != null and aboral != ''"> and aboral = #{aboral}</if>
  134. <if test="live != null and live != ''"> and live = #{live}</if>
  135. <if test="deptId != null "> and dept_id = #{deptId}</if>
  136. <if test="userId != null "> and user_id = #{userId}</if>
  137. <if test="nowMilitaryRank != null and nowMilitaryRank != ''"> and now_military_rank = #{nowMilitaryRank}</if>
  138. <if test="treatmentLevel != null and treatmentLevel != ''"> and treatment_level = #{treatmentLevel}</if>
  139. <if test="rankUpgradeTime != null "> and Rank_upgrade_time = #{rankUpgradeTime}</if>
  140. <if test="deptName != null "> and dept_name = #{deptName}</if>
  141. <if test="phoneStandby != null "> and phone_standby = #{phoneStandby}</if>
  142. <if test="isBianzhi != null and isBianzhi != ''"> and is_bianzhi = #{isBianzhi}</if>
  143. <if test="statusrk != null and statusrk != ''"> and statusrk = #{statusrk}</if>
  144. </where>
  145. </select>
  146. <select id="selectBdglPeopleById" parameterType="Long" resultMap="BdglPeopleResult">
  147. select id, name, sex, age, birth_date, command, duty, post_id, grade_id, post_date, job, skill_id, skill_date, level_id, level_date, military, idcard, enlist_date, enlistaddress, rank_id, rank_date, nation_id, origin, class_id, education_id, degree_id, graduation_date, school, party_id, party_date, training, readme_file, readme_file_name, prize, marry_list, children_list, unit_id, avatar, address, phone, status, createtimes, updatetimes, reign, job_time, healthy, blood_type, post_time, major, admission_time, mobile_phone_model, guarantee_card_no, payroll_card_no, authorized_strength, aboral, live, dept_id, user_id, now_military_rank, treatment_level, Rank_upgrade_time,dept_name,phone_standby,is_bianzhi,statusrk from bdgl_people
  148. where id = #{id}
  149. </select>
  150. <select id="selectPowerPeoleList" parameterType="BdglPeople" resultMap="BdglPeopleResult">
  151. select distinct p.id, p.name, p.dept_name,p.sex, p.age, p.birth_date, p.command, p.duty, p.post_id, p.grade_id, p.post_date, p.job, p.skill_id, p.skill_date, p.level_id, p.level_date, p.military, p.idcard, p.enlist_date, p.enlistaddress, p.rank_id, p.rank_date, p.nation_id, p.origin, p.class_id, p.education_id, p.degree_id, p.graduation_date, p.school, p.party_id, p.party_date, p.training, p.readme_file, p.readme_file_name, p.prize, p.marry_list, p.children_list, p.unit_id, p.avatar, p.address, p.phone, p.status, p.createtimes, p.updatetimes, p.reign, p.job_time, p.healthy, p.blood_type, p.post_time, p.major, p.admission_time, p.mobile_phone_model, p.guarantee_card_no, p.payroll_card_no, p.authorized_strength, p.aboral, p.live, d.dept_id ,p.now_military_rank,
  152. p.treatment_level, p.phone_standby,p.Rank_upgrade_time,p.is_bianzhi,reign,p.statusrk
  153. from bdgl_people p
  154. left join sys_dept d on p.dept_id = d.dept_id
  155. <if test="deptId != null and deptId != 0">
  156. where p.dept_id = #{deptId}
  157. </if>
  158. <!-- 数据范围过滤 -->
  159. ${params.dataScope}
  160. </select>
  161. <select id="selectPowerPeoleLists" parameterType="BdglPeople" resultMap="BdglPeopleResult">
  162. select p.id, p.name, p.sex, p.age, p.birth_date, p.command, p.duty, p.post_id, p.grade_id, p.post_date, p.job, p.skill_id, p.skill_date, p.level_id, p.level_date, p.military, idcard, p.enlist_date, p.enlistaddress,p.rank_id, p.rank_date, p.nation_id, origin, p.class_id, p.education_id, p.degree_id,
  163. p.graduation_date, p.school, p.party_id, p.party_date, p.training, p.readme_file, p.readme_file_name, p.prize,
  164. p.marry_list, p.children_list, p.unit_id, p.avatar, p.address, p.phone, p.status, p.createtimes, p.updatetimes,
  165. p.reign, p.job_time, p.healthy, p.blood_type, p.post_time, p.major,p.admission_time, p.mobile_phone_model,
  166. p. guarantee_card_no, p.payroll_card_no, p.authorized_strength, p.aboral, p.live, p.dept_id, p.user_id,
  167. p.now_military_rank, p.treatment_level, p.Rank_upgrade_time,p.dept_name,p.phone_standby,p.is_bianzhi,p.statusrk
  168. from bdgl_people p
  169. left join sys_dept d on p.dept_id = d.dept_id
  170. <where>
  171. and p.status=0
  172. <if test="name != null and name != ''"> and p.name like concat('%', #{name}, '%')</if>
  173. <if test="sex != null and sex != ''"> and p.sex = #{sex}</if>
  174. <if test="age != null "> and p.age = #{age}</if>
  175. <if test="birthDate != null "> and p.birth_date = #{birthDate}</if>
  176. <if test="command != null and command != ''"> and p.command = #{command}</if>
  177. <if test="duty != null and duty != ''"> and p.duty = #{duty}</if>
  178. <if test="postId != null "> and p.post_id = #{postId}</if>
  179. <if test="gradeId != null "> and p.grade_id = #{gradeId}</if>
  180. <if test="postDate != null "> and p.post_date = #{postDate}</if>
  181. <if test="job != null and job != ''"> and p.job = #{job}</if>
  182. <if test="skillId != null "> and p.skill_id = #{skillId}</if>
  183. <if test="skillDate != null "> and p.skill_date = #{skillDate}</if>
  184. <if test="levelId != null "> and p.level_id = #{levelId}</if>
  185. <if test="levelDate != null "> and p.level_date = #{levelDate}</if>
  186. <if test="military != null and military != ''"> and p.military = #{military}</if>
  187. <if test="idcard != null and idcard != ''"> and p.idcard = #{idcard}</if>
  188. <if test="enlistDate != null "> and p.enlist_date = #{enlistDate}</if>
  189. <if test="enlistaddress != null and enlistaddress != ''"> and p.enlistaddress = #{enlistaddress}</if>
  190. <if test="rankId != null "> and p.rank_id = #{rankId}</if>
  191. <if test="rankDate != null "> and p.rank_date = #{rankDate}</if>
  192. <if test="nationId != null "> and p.nation_id = #{nationId}</if>
  193. <if test="origin != null and origin != ''"> and p.origin = #{origin}</if>
  194. <if test="classId != null "> and p.class_id = #{classId}</if>
  195. <if test="educationId != null "> and p.education_id = #{educationId}</if>
  196. <if test="degreeId != null "> and p.degree_id = #{degreeId}</if>
  197. <if test="graduationDate != null "> and p.graduation_date = #{graduationDate}</if>
  198. <if test="school != null and school != ''"> and p.school = #{school}</if>
  199. <if test="partyId != null "> and p.party_id = #{partyId}</if>
  200. <if test="partyDate != null "> and p.party_date = #{partyDate}</if>
  201. <if test="training != null and training != ''"> and p.training = #{training}</if>
  202. <if test="readmeFile != null and readmeFile != ''"> and p.readme_file = #{readmeFile}</if>
  203. <if test="readmeFileName != null and readmeFileName != ''"> and p.readme_file_name like concat('%', #{readmeFileName}, '%')</if>
  204. <if test="prize != null and prize != ''"> and p.prize = #{prize}</if>
  205. <if test="marryList != null and marryList != ''"> and p.marry_list = #{marryList}</if>
  206. <if test="childrenList != null and childrenList != ''"> and p.children_list = #{childrenList}</if>
  207. <if test="unitId != null and unitId != ''"> and p.unit_id = #{unitId}</if>
  208. <if test="avatar != null and avatar != ''"> and p.avatar = #{avatar}</if>
  209. <if test="address != null and address != ''"> and p.address = #{address}</if>
  210. <if test="phone != null and phone != ''"> and p.phone = #{phone}</if>
  211. <if test="status != null "> and p.status = #{status}</if>
  212. <if test="createtimes != null "> and p.createtimes = #{createtimes}</if>
  213. <if test="updatetimes != null "> and p.updatetimes = #{updatetimes}</if>
  214. <if test="reign != null "> and p.reign = #{reign}</if>
  215. <if test="jobTime != null "> and p.job_time = #{jobTime}</if>
  216. <if test="healthy != null and healthy != ''"> and p.healthy = #{healthy}</if>
  217. <if test="bloodType != null and bloodType != ''"> and p.blood_type = #{bloodType}</if>
  218. <if test="postTime != null "> and p.post_time = #{postTime}</if>
  219. <if test="major != null and major != ''"> and p.major = #{major}</if>
  220. <if test="admissionTime != null "> and p.admission_time = #{admissionTime}</if>
  221. <if test="mobilePhoneModel != null and mobilePhoneModel != ''"> and p.mobile_phone_model = #{mobilePhoneModel}</if>
  222. <if test="guaranteeCardNo != null and guaranteeCardNo != ''"> and p.guarantee_card_no = #{guaranteeCardNo}</if>
  223. <if test="payrollCardNo != null and payrollCardNo != ''"> and p.payroll_card_no = #{payrollCardNo}</if>
  224. <if test="authorizedStrength != null and authorizedStrength != ''"> and p.authorized_strength = #{authorizedStrength}</if>
  225. <if test="aboral != null and aboral != ''"> and p.aboral = #{aboral}</if>
  226. <if test="live != null and live != ''"> and p.live = #{live}</if>
  227. <if test="userId != null "> and p.user_id = #{userId}</if>
  228. <if test="nowMilitaryRank != null and nowMilitaryRank != ''"> and p.now_military_rank = #{nowMilitaryRank}</if>
  229. <if test="treatmentLevel != null and treatmentLevel != ''"> and p.treatment_level = #{treatmentLevel}</if>
  230. <if test="rankUpgradeTime != null "> and p.Rank_upgrade_time = #{rankUpgradeTime}</if>
  231. <if test="statusrk != null "> and p.statusrk = #{statusrk}</if>
  232. <if test="deptId !=null">
  233. and (p.dept_id =#{deptId} or
  234. find_in_set(#{deptId}, d.ancestors) )
  235. </if>
  236. </where>
  237. order by p.post_id desc
  238. </select>
  239. <select id="selectExaminationList" parameterType="BdglPeople" resultMap="BdglPeopleResult">
  240. select p.id, p.name, p.sex, p.age, p.birth_date, p.command, p.duty, p.post_id, p.grade_id, p.post_date, p.job, p.skill_id, p.skill_date, p.level_id, p.level_date, p.military, idcard, p.enlist_date, p.enlistaddress,p.rank_id, p.rank_date, p.nation_id, origin, p.class_id, p.education_id, p.degree_id,
  241. p.graduation_date, p.school, p.party_id, p.party_date, p.training, p.readme_file, p.readme_file_name, p.prize,
  242. p.marry_list, p.children_list, p.unit_id, p.avatar, p.address, p.phone, p.status, p.createtimes, p.updatetimes,
  243. p.reign, p.job_time, p.healthy, p.blood_type, p.post_time, p.major,p.admission_time, p.mobile_phone_model,
  244. p. guarantee_card_no, p.payroll_card_no, p.authorized_strength, p.aboral, p.live, p.dept_id, p.user_id,
  245. p.now_military_rank, p.treatment_level, p.Rank_upgrade_time,p.dept_name,p.phone_standby,p.is_bianzhi,p.statusrk
  246. from bdgl_people p
  247. left join sys_dept d on p.dept_id = d.dept_id
  248. <where>
  249. and p.status=0
  250. <if test="job != null and job != ''"> and p.job &lt;&gt; #{job}</if>
  251. </where>
  252. </select>
  253. <!--获取当前部门 在位 在编 未在编 人员情况-->
  254. <select id="getDeptXiangQi" resultType="java.util.Map">
  255. SELECT
  256. *
  257. FROM
  258. (
  259. SELECT
  260. a.aa zbgb,
  261. b.bb zbsb,
  262. c.cc zbyw
  263. FROM
  264. (
  265. SELECT
  266. count( p.id ) aa
  267. FROM
  268. `bdgl_people` p
  269. LEFT JOIN sys_dept d ON p.dept_id = d.dept_id
  270. WHERE
  271. authorized_strength = 'Y'
  272. AND class_id IN ( 2, 3 )
  273. AND ( p.dept_id = #{deptId} OR find_in_set(#{deptId}, d.ancestors) )
  274. ) a,
  275. (
  276. SELECT
  277. count( p.id ) bb
  278. FROM
  279. `bdgl_people` p
  280. LEFT JOIN sys_dept d ON p.dept_id = d.dept_id
  281. WHERE
  282. authorized_strength = 'Y'
  283. AND class_id = 1
  284. AND ( p.dept_id = #{deptId} OR find_in_set(#{deptId}, d.ancestors) )
  285. ) b,
  286. (
  287. SELECT
  288. count( p.id ) cc
  289. FROM
  290. `bdgl_people` p
  291. LEFT JOIN sys_dept d ON p.dept_id = d.dept_id
  292. WHERE
  293. authorized_strength = 'Y'
  294. AND class_id = 0
  295. AND ( p.dept_id = #{deptId} OR find_in_set(#{deptId}, d.ancestors) )
  296. ) c
  297. ) a,
  298. (
  299. SELECT
  300. a.aa zwgb,
  301. b.bb zwsb,
  302. c.cc zwyw
  303. FROM
  304. (
  305. SELECT
  306. count( id ) aa
  307. FROM
  308. `bdgl_people` p
  309. LEFT JOIN sys_dept d ON p.dept_id = d.dept_id
  310. WHERE
  311. reign = 0
  312. AND class_id IN ( 2, 3 )
  313. AND ( p.dept_id = #{deptId} OR find_in_set(#{deptId}, d.ancestors) )
  314. ) a,
  315. (
  316. SELECT
  317. count( id ) bb
  318. FROM
  319. `bdgl_people` p
  320. LEFT JOIN sys_dept d ON p.dept_id = d.dept_id
  321. WHERE
  322. reign = 0
  323. AND class_id = 1
  324. AND ( p.dept_id = #{deptId} OR find_in_set(#{deptId}, d.ancestors) )
  325. ) b,
  326. (
  327. SELECT
  328. count( id ) cc
  329. FROM
  330. `bdgl_people` p
  331. LEFT JOIN sys_dept d ON p.dept_id = d.dept_id
  332. WHERE
  333. reign = 0
  334. AND class_id = 0
  335. AND ( p.dept_id = #{deptId} OR find_in_set(#{deptId}, d.ancestors) )
  336. ) c
  337. ) b,
  338. (
  339. SELECT
  340. a.aa bzwgb,
  341. b.bb bzwsb,
  342. c.cc bzwyw
  343. FROM
  344. (
  345. SELECT
  346. count( id ) aa
  347. FROM
  348. `bdgl_people` p
  349. LEFT JOIN sys_dept d ON p.dept_id = d.dept_id
  350. WHERE
  351. authorized_strength = 'N'
  352. AND class_id IN ( 2, 3 )
  353. AND ( p.dept_id = #{deptId} OR find_in_set(#{deptId}, d.ancestors) )
  354. ) a,
  355. (
  356. SELECT
  357. count( id ) bb
  358. FROM
  359. `bdgl_people` p
  360. LEFT JOIN sys_dept d ON p.dept_id = d.dept_id
  361. WHERE
  362. authorized_strength = 'N'
  363. AND class_id = 1
  364. AND ( p.dept_id = #{deptId} OR find_in_set(#{deptId}, d.ancestors) )
  365. ) b,
  366. (
  367. SELECT
  368. count( id ) cc
  369. FROM
  370. `bdgl_people` p
  371. LEFT JOIN sys_dept d ON p.dept_id = d.dept_id
  372. WHERE
  373. authorized_strength = 'N'
  374. AND class_id = 0
  375. AND ( p.dept_id = #{deptId} OR find_in_set(#{deptId}, d.ancestors) )
  376. ) c
  377. ) c
  378. </select>
  379. <select id="select" resultMap="BdglPeopleResult">
  380. <include refid="selectBdglPeopleVo"/>
  381. where id in
  382. <foreach item="item" collection="split" index="index" open="(" separator="," close=")">
  383. #{item}
  384. </foreach>
  385. </select>
  386. <insert id="insertBdglPeople" parameterType="BdglPeople" useGeneratedKeys="true" keyProperty="id">
  387. insert into bdgl_people
  388. <trim prefix="(" suffix=")" suffixOverrides=",">
  389. <if test="name != null and name != ''">name,</if>
  390. <if test="sex != null and sex != ''">sex,</if>
  391. <if test="age != null">age,</if>
  392. <if test="birthDate != null">birth_date,</if>
  393. <if test="command != null and command != ''">command,</if>
  394. <if test="duty != null and duty != ''">duty,</if>
  395. <if test="postId != null">post_id,</if>
  396. <if test="gradeId != null">grade_id,</if>
  397. <if test="postDate != null">post_date,</if>
  398. <if test="job != null and job != ''">job,</if>
  399. <if test="skillId != null">skill_id,</if>
  400. <if test="skillDate != null">skill_date,</if>
  401. <if test="levelId != null">level_id,</if>
  402. <if test="levelDate != null">level_date,</if>
  403. <if test="military != null and military != ''">military,</if>
  404. <if test="idcard != null and idcard != ''">idcard,</if>
  405. <if test="enlistDate != null">enlist_date,</if>
  406. <if test="enlistaddress != null">enlistaddress,</if>
  407. <if test="rankId != null">rank_id,</if>
  408. <if test="rankDate != null">rank_date,</if>
  409. <if test="nationId != null">nation_id,</if>
  410. <if test="origin != null and origin != ''">origin,</if>
  411. <if test="classId != null">class_id,</if>
  412. <if test="educationId != null">education_id,</if>
  413. <if test="degreeId != null">degree_id,</if>
  414. <if test="graduationDate != null">graduation_date,</if>
  415. <if test="school != null">school,</if>
  416. <if test="partyId != null">party_id,</if>
  417. <if test="partyDate != null">party_date,</if>
  418. <if test="training != null">training,</if>
  419. <if test="readmeFile != null">readme_file,</if>
  420. <if test="readmeFileName != null">readme_file_name,</if>
  421. <if test="prize != null">prize,</if>
  422. <if test="marryList != null">marry_list,</if>
  423. <if test="childrenList != null">children_list,</if>
  424. <if test="unitId != null and unitId != ''">unit_id,</if>
  425. <if test="avatar != null">avatar,</if>
  426. <if test="address != null">address,</if>
  427. <if test="phone != null">phone,</if>
  428. <if test="status != null">status,</if>
  429. <if test="createtimes != null">createtimes,</if>
  430. <if test="updatetimes != null">updatetimes,</if>
  431. <if test="reign != null">reign,</if>
  432. <if test="jobTime != null">job_time,</if>
  433. <if test="healthy != null">healthy,</if>
  434. <if test="bloodType != null">blood_type,</if>
  435. <if test="postTime != null">post_time,</if>
  436. <if test="major != null">major,</if>
  437. <if test="admissionTime != null">admission_time,</if>
  438. <if test="mobilePhoneModel != null">mobile_phone_model,</if>
  439. <if test="guaranteeCardNo != null">guarantee_card_no,</if>
  440. <if test="payrollCardNo != null">payroll_card_no,</if>
  441. <if test="authorizedStrength != null">authorized_strength,</if>
  442. <if test="aboral != null">aboral,</if>
  443. <if test="live != null">live,</if>
  444. <if test="deptId != null">dept_id,</if>
  445. <if test="userId != null">user_id,</if>
  446. <if test="nowMilitaryRank != null">now_military_rank,</if>
  447. <if test="treatmentLevel != null">treatment_level,</if>
  448. <if test="rankUpgradeTime != null">Rank_upgrade_time,</if>
  449. <if test="deptName != null "> dept_name ,</if>
  450. <if test="phoneStandby != null "> phone_standby ,</if>
  451. <if test="isBianzhi != null "> is_bianzhi,</if>
  452. <if test="statusrk != null "> statusrk,</if>
  453. </trim>
  454. <trim prefix="values (" suffix=")" suffixOverrides=",">
  455. <if test="name != null and name != ''">#{name},</if>
  456. <if test="sex != null and sex != ''">#{sex},</if>
  457. <if test="age != null">#{age},</if>
  458. <if test="birthDate != null">#{birthDate},</if>
  459. <if test="command != null and command != ''">#{command},</if>
  460. <if test="duty != null and duty != ''">#{duty},</if>
  461. <if test="postId != null">#{postId},</if>
  462. <if test="gradeId != null">#{gradeId},</if>
  463. <if test="postDate != null">#{postDate},</if>
  464. <if test="job != null and job != ''">#{job},</if>
  465. <if test="skillId != null">#{skillId},</if>
  466. <if test="skillDate != null">#{skillDate},</if>
  467. <if test="levelId != null">#{levelId},</if>
  468. <if test="levelDate != null">#{levelDate},</if>
  469. <if test="military != null and military != ''">#{military},</if>
  470. <if test="idcard != null and idcard != ''">#{idcard},</if>
  471. <if test="enlistDate != null">#{enlistDate},</if>
  472. <if test="enlistaddress != null">#{enlistaddress},</if>
  473. <if test="rankId != null">#{rankId},</if>
  474. <if test="rankDate != null">#{rankDate},</if>
  475. <if test="nationId != null">#{nationId},</if>
  476. <if test="origin != null and origin != ''">#{origin},</if>
  477. <if test="classId != null">#{classId},</if>
  478. <if test="educationId != null">#{educationId},</if>
  479. <if test="degreeId != null">#{degreeId},</if>
  480. <if test="graduationDate != null">#{graduationDate},</if>
  481. <if test="school != null">#{school},</if>
  482. <if test="partyId != null">#{partyId},</if>
  483. <if test="partyDate != null">#{partyDate},</if>
  484. <if test="training != null">#{training},</if>
  485. <if test="readmeFile != null">#{readmeFile},</if>
  486. <if test="readmeFileName != null">#{readmeFileName},</if>
  487. <if test="prize != null">#{prize},</if>
  488. <if test="marryList != null">#{marryList},</if>
  489. <if test="childrenList != null">#{childrenList},</if>
  490. <if test="unitId != null and unitId != ''">#{unitId},</if>
  491. <if test="avatar != null">#{avatar},</if>
  492. <if test="address != null">#{address},</if>
  493. <if test="phone != null">#{phone},</if>
  494. <if test="status != null">#{status},</if>
  495. <if test="createtimes != null">#{createtimes},</if>
  496. <if test="updatetimes != null">#{updatetimes},</if>
  497. <if test="reign != null">#{reign},</if>
  498. <if test="jobTime != null">#{jobTime},</if>
  499. <if test="healthy != null">#{healthy},</if>
  500. <if test="bloodType != null">#{bloodType},</if>
  501. <if test="postTime != null">#{postTime},</if>
  502. <if test="major != null">#{major},</if>
  503. <if test="admissionTime != null">#{admissionTime},</if>
  504. <if test="mobilePhoneModel != null">#{mobilePhoneModel},</if>
  505. <if test="guaranteeCardNo != null">#{guaranteeCardNo},</if>
  506. <if test="payrollCardNo != null">#{payrollCardNo},</if>
  507. <if test="authorizedStrength != null">#{authorizedStrength},</if>
  508. <if test="aboral != null">#{aboral},</if>
  509. <if test="live != null">#{live},</if>
  510. <if test="deptId != null">#{deptId},</if>
  511. <if test="userId != null">#{userId},</if>
  512. <if test="nowMilitaryRank != null">#{nowMilitaryRank},</if>
  513. <if test="treatmentLevel != null">#{treatmentLevel},</if>
  514. <if test="rankUpgradeTime != null">#{rankUpgradeTime},</if>
  515. <if test="deptName != null "> #{deptName},</if>
  516. <if test="phoneStandby != null "> #{phoneStandby},</if>
  517. <if test="isBianzhi != null"> #{isBianzhi},</if>
  518. <if test="statusrk != null"> #{statusrk},</if>
  519. </trim>
  520. </insert>
  521. <update id="updateBdglPeople" parameterType="BdglPeople">
  522. update bdgl_people
  523. <trim prefix="SET" suffixOverrides=",">
  524. <if test="name != null and name != ''">name = #{name},</if>
  525. <if test="sex != null and sex != ''">sex = #{sex},</if>
  526. <if test="age != null">age = #{age},</if>
  527. <if test="birthDate != null">birth_date = #{birthDate},</if>
  528. <if test="command != null and command != ''">command = #{command},</if>
  529. <if test="duty != null and duty != ''">duty = #{duty},</if>
  530. <if test="postId != null">post_id = #{postId},</if>
  531. <if test="gradeId != null">grade_id = #{gradeId},</if>
  532. <if test="postDate != null">post_date = #{postDate},</if>
  533. <if test="job != null and job != ''">job = #{job},</if>
  534. <if test="skillId != null">skill_id = #{skillId},</if>
  535. <if test="skillDate != null">skill_date = #{skillDate},</if>
  536. <if test="levelId != null">level_id = #{levelId},</if>
  537. <if test="levelDate != null">level_date = #{levelDate},</if>
  538. <if test="military != null and military != ''">military = #{military},</if>
  539. <if test="idcard != null and idcard != ''">idcard = #{idcard},</if>
  540. <if test="enlistDate != null">enlist_date = #{enlistDate},</if>
  541. <if test="enlistaddress != null">enlistaddress = #{enlistaddress},</if>
  542. <if test="rankId != null">rank_id = #{rankId},</if>
  543. <if test="rankDate != null">rank_date = #{rankDate},</if>
  544. <if test="nationId != null">nation_id = #{nationId},</if>
  545. <if test="origin != null and origin != ''">origin = #{origin},</if>
  546. <if test="classId != null">class_id = #{classId},</if>
  547. <if test="educationId != null">education_id = #{educationId},</if>
  548. <if test="degreeId != null">degree_id = #{degreeId},</if>
  549. <if test="graduationDate != null">graduation_date = #{graduationDate},</if>
  550. <if test="school != null">school = #{school},</if>
  551. <if test="partyId != null">party_id = #{partyId},</if>
  552. <if test="partyDate != null">party_date = #{partyDate},</if>
  553. <if test="training != null">training = #{training},</if>
  554. <if test="readmeFile != null">readme_file = #{readmeFile},</if>
  555. <if test="readmeFileName != null">readme_file_name = #{readmeFileName},</if>
  556. <if test="prize != null">prize = #{prize},</if>
  557. <if test="marryList != null">marry_list = #{marryList},</if>
  558. <if test="childrenList != null">children_list = #{childrenList},</if>
  559. <if test="unitId != null and unitId != ''">unit_id = #{unitId},</if>
  560. <if test="avatar != null">avatar = #{avatar},</if>
  561. <if test="address != null">address = #{address},</if>
  562. <if test="phone != null">phone = #{phone},</if>
  563. <if test="status != null">status = #{status},</if>
  564. <if test="createtimes != null">createtimes = #{createtimes},</if>
  565. <if test="updatetimes != null">updatetimes = #{updatetimes},</if>
  566. <if test="reign != null">reign = #{reign},</if>
  567. <if test="jobTime != null">job_time = #{jobTime},</if>
  568. <if test="healthy != null">healthy = #{healthy},</if>
  569. <if test="bloodType != null">blood_type = #{bloodType},</if>
  570. <if test="postTime != null">post_time = #{postTime},</if>
  571. <if test="major != null">major = #{major},</if>
  572. <if test="admissionTime != null">admission_time = #{admissionTime},</if>
  573. <if test="mobilePhoneModel != null">mobile_phone_model = #{mobilePhoneModel},</if>
  574. <if test="guaranteeCardNo != null">guarantee_card_no = #{guaranteeCardNo},</if>
  575. <if test="payrollCardNo != null">payroll_card_no = #{payrollCardNo},</if>
  576. <if test="authorizedStrength != null">authorized_strength = #{authorizedStrength},</if>
  577. <if test="aboral != null">aboral = #{aboral},</if>
  578. <if test="live != null">live = #{live},</if>
  579. <if test="deptId != null">dept_id = #{deptId},</if>
  580. <if test="userId != null">user_id = #{userId},</if>
  581. <if test="nowMilitaryRank != null">now_military_rank = #{nowMilitaryRank},</if>
  582. <if test="treatmentLevel != null">treatment_level = #{treatmentLevel},</if>
  583. <if test="rankUpgradeTime != null">Rank_upgrade_time = #{rankUpgradeTime},</if>
  584. <if test="deptName != null "> dept_name = #{deptName},</if>
  585. <if test="phoneStandby != null "> phone_standby = #{phoneStandby},</if>
  586. <if test="isBianzhi != null and isBianzhi != ''"> is_bianzhi = #{isBianzhi},</if>
  587. <if test="statusrk != null and statusrk != ''"> statusrk = #{statusrk},</if>
  588. </trim>
  589. where id = #{id}
  590. </update>
  591. <delete id="deleteBdglPeopleById" parameterType="Long">
  592. delete from bdgl_people where id = #{id}
  593. </delete>
  594. <delete id="deleteBdglPeopleByIds" parameterType="String">
  595. delete from bdgl_people where id in
  596. <foreach item="id" collection="array" open="(" separator="," close=")">
  597. #{id}
  598. </foreach>
  599. </delete>
  600. <!-- 根据人员状态和是否在编 获取人员数量 -->
  601. <select id="selectPeopleByRegin" parameterType="String" resultType="java.util.HashMap">
  602. SELECT
  603. count(0) AS munber,
  604. reign AS reign
  605. FROM
  606. bdgl_people
  607. WHERE
  608. 1=1
  609. AND
  610. authorized_strength = #{type}
  611. GROUP BY
  612. reign
  613. </select>
  614. <!--//根据人员id获取人员姓名-->
  615. <select id="selectname" resultMap="BdglPeopleResult">
  616. <include refid="selectBdglPeopleVo"/>
  617. where id in
  618. <foreach item="item" collection="split" index="index" open="(" separator="," close=")">
  619. #{item}
  620. </foreach>
  621. </select>
  622. <!-- 根据人员状态和是否是否纳编来查询人员信息 -->
  623. <select id="selectBdglPeopleInfo" parameterType="BdglPeople" resultMap="BdglPeopleResult">
  624. <include refid="selectBdglPeopleVo"/>
  625. <where>
  626. <if test="reign != null "> and reign = #{reign}</if>
  627. <if test="authorizedStrength != null and authorizedStrength != ''"> and authorized_strength = #{authorizedStrength}</if>
  628. </where>
  629. </select>
  630. <select id="selectGroupBYPeope" resultType="java.util.HashMap">
  631. select count(p.id)as number , c.dict_label as type
  632. from bdgl_people p
  633. left join sys_dept d on p.dept_id = d.dept_id
  634. left join sys_dict_data c on p.reign=c.dict_value
  635. <where>
  636. <if test="deptId !=null">
  637. and (p.dept_id =#{deptId} or
  638. d.ancestors LIKE concat('%', #{deptId},'%') )
  639. </if>
  640. and c.dict_type='people_state'
  641. </where>
  642. group by p.reign
  643. </select>
  644. <select id="selectTotalCountByDeptId" resultType="java.lang.Integer">
  645. select count(1) from bdgl_people where dept_id = #{deptId}
  646. </select>
  647. <select id="selectReginCountByDeptId" resultType="java.lang.Integer">
  648. select count(1) from bdgl_people where dept_id = #{deptId} and reign = 0
  649. </select>
  650. <select id="selectBdglPeopleOnUnitList" parameterType="BdglPeople" resultMap="BdglPeopleResult">
  651. <include refid="selectBdglPeopleVo"/>
  652. <where>
  653. dept_id= #{unitId}
  654. </where>
  655. order by id desc
  656. </select>
  657. <select id="selectBdglPeopleByunitId" resultType="java.lang.Integer">
  658. select count(*) from bdgl_people where dept_id = #{unitId}
  659. -- and YEAR(createtime)= #{year}
  660. </select>
  661. <select id="selectReginCount2ByDeptId" resultType="java.lang.Integer">
  662. select count(1) from bdgl_people where dept_id = #{deptId} and reign <![CDATA[<>]]> 0
  663. </select>
  664. <select id="selectReginByDeptId" resultType="com.supervision.peopleManage.domain.dto.StatOutPeopleDto">
  665. select reign as reign,count(*) AS count from bdgl_people where dept_id = #{deptId} and reign <![CDATA[<>]]> 0 GROUP BY reign
  666. </select>
  667. <select id="selectPersonAgeQjList" resultType="com.supervision.peopleManage.domain.dto.StatPersonAgeDto">
  668. SELECT
  669. nlqj AS nlqj,
  670. count(*) AS rs
  671. FROM
  672. (
  673. SELECT
  674. CASE
  675. WHEN age <![CDATA[ <= ]]> 20 THEN '20岁以下'
  676. WHEN age > 21 AND age <![CDATA[ <= ]]> 30 THEN '21-30'
  677. WHEN age > 31 AND age <![CDATA[ <= ]]> 40 THEN '31-40'
  678. WHEN age > 41 AND age <![CDATA[ <= ]]> 50 THEN '41-50'
  679. WHEN age > 51 AND age <![CDATA[ <= ]]> 60 THEN '51-60'
  680. WHEN age > 60 THEN '60岁以上'
  681. END AS nlqj
  682. FROM
  683. bdgl_people
  684. WHERE dept_id IN
  685. <foreach collection="list" item="id" index="index" open="(" close=")" separator=",">
  686. #{id}
  687. </foreach>
  688. ) a
  689. GROUP BY
  690. nlqj
  691. </select>
  692. <select id="selectZzmmAndCountWithDeptId"
  693. resultType="com.supervision.peopleManage.domain.dto.StatPersonZzmmDto">
  694. SELECT
  695. party_id as zzmm,count(*) AS rs
  696. FROM
  697. bdgl_people
  698. WHERE dept_id IN
  699. <foreach collection="list" item="id" index="index" open="(" close=")" separator=",">
  700. #{id}
  701. </foreach>
  702. GROUP BY party_id
  703. </select>
  704. <select id="selectReginCount" resultType="com.supervision.peopleManage.domain.dto.StatOutPeopleDto">
  705. select
  706. reign as reign,
  707. count(*) AS count
  708. from bdgl_people
  709. where reign > 0
  710. and
  711. dept_id IN
  712. <foreach collection="list" item="id" index="index" open="(" close=")" separator=",">
  713. #{id}
  714. </foreach>
  715. GROUP BY reign
  716. </select>
  717. <select id="selectPersonAgeDtoAllList"
  718. resultType="com.supervision.peopleManage.domain.dto.StatPersonAgeDto">
  719. SELECT
  720. nlqj AS nlqj,
  721. count(*) AS rs
  722. FROM
  723. (
  724. SELECT
  725. CASE
  726. WHEN age <![CDATA[ <= ]]> 20 THEN '20岁以下'
  727. WHEN age > 21 AND age <![CDATA[ <= ]]> 30 THEN '21-30'
  728. WHEN age > 31 AND age <![CDATA[ <= ]]> 40 THEN '31-40'
  729. WHEN age > 41 AND age <![CDATA[ <= ]]> 50 THEN '41-50'
  730. WHEN age > 51 AND age <![CDATA[ <= ]]> 60 THEN '51-60'
  731. WHEN age > 60 THEN '60岁以上'
  732. END AS nlqj
  733. FROM
  734. bdgl_people
  735. ) a
  736. GROUP BY
  737. nlqj
  738. </select>
  739. <select id="selectZzmmAndCountAll" resultType="com.supervision.peopleManage.domain.dto.StatPersonZzmmDto">
  740. SELECT
  741. party_id as zzmm,count(*) AS rs
  742. FROM
  743. bdgl_people
  744. where dept_id IN
  745. <foreach collection="set" item="id" index="index" open="(" close=")" separator=",">
  746. #{id}
  747. </foreach>
  748. GROUP BY party_id
  749. </select>
  750. <select id="countTypeNumber" resultMap="BdglPeopleResult">
  751. select count(id) id,dept_name from bdgl_people group by dept_id
  752. </select>
  753. <select id="getDeptXiangQi2" resultType="java.util.Map">
  754. SELECT
  755. *
  756. FROM
  757. (
  758. SELECT
  759. a.aa sb,
  760. b.bb zhjg,
  761. c.cc zyjg,
  762. d.dd zs,
  763. e.cc wz,
  764. f.cc cjsg,
  765. j.cc zjsg,
  766. k.cc gjsg
  767. FROM
  768. (
  769. SELECT
  770. count( p.id ) aa
  771. FROM
  772. `bdgl_people` p
  773. LEFT JOIN sys_dept d ON p.dept_id = d.dept_id
  774. WHERE
  775. class_id =0
  776. AND ( p.dept_id = #{deptId} OR find_in_set(#{deptId}, d.ancestors) ) and p.status=0
  777. ) a,
  778. (
  779. SELECT
  780. count( p.id ) bb
  781. FROM
  782. `bdgl_people` p
  783. LEFT JOIN sys_dept d ON p.dept_id = d.dept_id
  784. WHERE
  785. class_id = 2
  786. AND ( p.dept_id = #{deptId} OR find_in_set(#{deptId}, d.ancestors) ) and p.status=0
  787. ) b,
  788. (
  789. SELECT
  790. count( p.id ) cc
  791. FROM
  792. `bdgl_people` p
  793. LEFT JOIN sys_dept d ON p.dept_id = d.dept_id
  794. WHERE
  795. class_id = 3
  796. AND ( p.dept_id = #{deptId} OR find_in_set(#{deptId}, d.ancestors) ) and p.status=0
  797. ) c,
  798. (
  799. SELECT
  800. count( p.id ) dd
  801. FROM
  802. `bdgl_people` p
  803. LEFT JOIN sys_dept d ON p.dept_id = d.dept_id
  804. WHERE
  805. ( p.dept_id = #{deptId} OR find_in_set(#{deptId}, d.ancestors) ) and p.status=0
  806. ) d,
  807. (
  808. SELECT
  809. count( p.id ) cc
  810. FROM
  811. `bdgl_people` p
  812. LEFT JOIN sys_dept d ON p.dept_id = d.dept_id
  813. WHERE
  814. class_id = 4
  815. AND ( p.dept_id = #{deptId} OR find_in_set(#{deptId}, d.ancestors) ) and p.status=0
  816. ) e,
  817. (
  818. SELECT
  819. count( p.id ) cc
  820. FROM
  821. `bdgl_people` p
  822. LEFT JOIN sys_dept d ON p.dept_id = d.dept_id
  823. WHERE
  824. class_id = 5
  825. AND ( p.dept_id = #{deptId} OR find_in_set(#{deptId}, d.ancestors) ) and p.status=0
  826. ) f,
  827. (
  828. SELECT
  829. count( p.id ) cc
  830. FROM
  831. `bdgl_people` p
  832. LEFT JOIN sys_dept d ON p.dept_id = d.dept_id
  833. WHERE
  834. class_id = 6
  835. AND ( p.dept_id = #{deptId} OR find_in_set(#{deptId}, d.ancestors) ) and p.status=0
  836. ) j,
  837. (
  838. SELECT
  839. count( p.id ) cc
  840. FROM
  841. `bdgl_people` p
  842. LEFT JOIN sys_dept d ON p.dept_id = d.dept_id
  843. WHERE
  844. class_id = 7
  845. AND ( p.dept_id = #{deptId} OR find_in_set(#{deptId}, d.ancestors) ) and p.status=0
  846. ) k
  847. ) a
  848. </select>
  849. <select id="getDeptXiangQi3" resultType="java.util.Map">
  850. SELECT
  851. *
  852. FROM
  853. (
  854. SELECT
  855. a.aa sb,
  856. b.bb zhjg,
  857. c.cc zyjg,
  858. d.dd zs,
  859. e.cc wz,
  860. f.cc cjsg,
  861. j.cc zjsg,
  862. k.cc gjsg
  863. FROM
  864. (
  865. SELECT
  866. count( p.id ) aa
  867. FROM
  868. `bdgl_people` p
  869. LEFT JOIN sys_dept d ON p.dept_id = d.dept_id
  870. WHERE
  871. class_id = 0
  872. AND p.dept_id = #{deptId} and p.status=0
  873. ) a,
  874. (
  875. SELECT
  876. count( p.id ) bb
  877. FROM
  878. `bdgl_people` p
  879. LEFT JOIN sys_dept d ON p.dept_id = d.dept_id
  880. WHERE
  881. class_id = 2
  882. AND p.dept_id = #{deptId} and p.status=0
  883. ) b,
  884. (
  885. SELECT
  886. count( p.id ) cc
  887. FROM
  888. `bdgl_people` p
  889. LEFT JOIN sys_dept d ON p.dept_id = d.dept_id
  890. WHERE
  891. class_id = 3
  892. AND p.dept_id = #{deptId} and p.status=0
  893. ) c,
  894. (
  895. SELECT
  896. count( p.id ) dd
  897. FROM
  898. `bdgl_people` p
  899. LEFT JOIN sys_dept d ON p.dept_id = d.dept_id
  900. WHERE
  901. p.dept_id = #{deptId} and p.status=0
  902. ) d,
  903. (
  904. SELECT
  905. count( p.id ) cc
  906. FROM
  907. `bdgl_people` p
  908. LEFT JOIN sys_dept d ON p.dept_id = d.dept_id
  909. WHERE
  910. class_id = 4
  911. AND p.dept_id = #{deptId} and p.status=0
  912. ) e,
  913. (
  914. SELECT
  915. count( p.id ) cc
  916. FROM
  917. `bdgl_people` p
  918. LEFT JOIN sys_dept d ON p.dept_id = d.dept_id
  919. WHERE
  920. class_id = 5
  921. AND p.dept_id = #{deptId} and p.status=0
  922. ) f,
  923. (
  924. SELECT
  925. count( p.id ) cc
  926. FROM
  927. `bdgl_people` p
  928. LEFT JOIN sys_dept d ON p.dept_id = d.dept_id
  929. WHERE
  930. class_id = 6
  931. AND p.dept_id = #{deptId} and p.status=0
  932. ) j,
  933. (
  934. SELECT
  935. count( p.id ) cc
  936. FROM
  937. `bdgl_people` p
  938. LEFT JOIN sys_dept d ON p.dept_id = d.dept_id
  939. WHERE
  940. class_id = 7
  941. AND p.dept_id = #{deptId} and p.status=0
  942. ) k
  943. ) a
  944. </select>
  945. <select id="examinationCountss" resultType="java.util.Map">
  946. SELECT count(job) as job FROM bdgl_people
  947. <where>
  948. status=0
  949. <if test="job != null and job != ''"> and job = #{job}</if>
  950. </where>
  951. </select>
  952. <select id="selectBdglPeople" resultMap="BdglPeopleResult">
  953. <include refid="selectBdglPeopleVo"/>
  954. where name = #{ename}
  955. limit 1
  956. </select>
  957. <select id="selectPowerPeoleListes" resultType="java.lang.String">
  958. SELECT DISTINCT id FROM bdgl_people
  959. where `name` like concat('%', #{peopleId}, '%')
  960. </select>
  961. <select id="selectPowerPeoleListsss" parameterType="BdglPeople" resultMap="BdglPeopleResult">
  962. select p.id, p.name, p.sex, p.age, p.birth_date, p.command, p.duty, p.post_id, p.grade_id, p.post_date, p.job, p.skill_id, p.skill_date, p.level_id, p.level_date, p.military, idcard, p.enlist_date, p.enlistaddress,p.rank_id, p.rank_date, p.nation_id, origin, p.class_id, p.education_id, p.degree_id,
  963. p.graduation_date, p.school, p.party_id, p.party_date, p.training, p.readme_file, p.readme_file_name, p.prize,
  964. p.marry_list, p.children_list, p.unit_id, p.avatar, p.address, p.phone, p.status, p.createtimes, p.updatetimes,
  965. p.reign, p.job_time, p.healthy, p.blood_type, p.post_time, p.major,p.admission_time, p.mobile_phone_model,
  966. p. guarantee_card_no, p.payroll_card_no, p.authorized_strength, p.aboral, p.live, p.dept_id, p.user_id,
  967. p.now_military_rank, p.treatment_level, p.Rank_upgrade_time,p.dept_name,p.phone_standby,p.is_bianzhi,p.statusrk
  968. from bdgl_people p
  969. left join sys_dept d on p.dept_id = d.dept_id
  970. <where>
  971. <if test="name != null and name != ''"> and p.name like concat('%', #{name}, '%')</if>
  972. <if test="sex != null and sex != ''"> and p.sex = #{sex}</if>
  973. <if test="age != null "> and p.age = #{age}</if>
  974. <if test="birthDate != null "> and p.birth_date = #{birthDate}</if>
  975. <if test="command != null and command != ''"> and p.command = #{command}</if>
  976. <if test="duty != null and duty != ''"> and p.duty = #{duty}</if>
  977. <if test="postId != null "> and p.post_id = #{postId}</if>
  978. <if test="gradeId != null "> and p.grade_id = #{gradeId}</if>
  979. <if test="postDate != null "> and p.post_date = #{postDate}</if>
  980. <if test="job != null and job != ''"> and p.job = #{job}</if>
  981. <if test="skillId != null "> and p.skill_id = #{skillId}</if>
  982. <if test="skillDate != null "> and p.skill_date = #{skillDate}</if>
  983. <if test="levelId != null "> and p.level_id = #{levelId}</if>
  984. <if test="levelDate != null "> and p.level_date = #{levelDate}</if>
  985. <if test="military != null and military != ''"> and p.military = #{military}</if>
  986. <if test="idcard != null and idcard != ''"> and p.idcard = #{idcard}</if>
  987. <if test="enlistDate != null "> and p.enlist_date = #{enlistDate}</if>
  988. <if test="enlistaddress != null and enlistaddress != ''"> and p.enlistaddress = #{enlistaddress}</if>
  989. <if test="rankId != null "> and p.rank_id = #{rankId}</if>
  990. <if test="rankDate != null "> and p.rank_date = #{rankDate}</if>
  991. <if test="nationId != null "> and p.nation_id = #{nationId}</if>
  992. <if test="origin != null and origin != ''"> and p.origin = #{origin}</if>
  993. <if test="classId != null "> and p.class_id = #{classId}</if>
  994. <if test="educationId != null "> and p.education_id = #{educationId}</if>
  995. <if test="degreeId != null "> and p.degree_id = #{degreeId}</if>
  996. <if test="graduationDate != null "> and p.graduation_date = #{graduationDate}</if>
  997. <if test="school != null and school != ''"> and p.school = #{school}</if>
  998. <if test="partyId != null "> and p.party_id = #{partyId}</if>
  999. <if test="partyDate != null "> and p.party_date = #{partyDate}</if>
  1000. <if test="training != null and training != ''"> and p.training = #{training}</if>
  1001. <if test="readmeFile != null and readmeFile != ''"> and p.readme_file = #{readmeFile}</if>
  1002. <if test="readmeFileName != null and readmeFileName != ''"> and p.readme_file_name like concat('%', #{readmeFileName}, '%')</if>
  1003. <if test="prize != null and prize != ''"> and p.prize = #{prize}</if>
  1004. <if test="marryList != null and marryList != ''"> and p.marry_list = #{marryList}</if>
  1005. <if test="childrenList != null and childrenList != ''"> and p.children_list = #{childrenList}</if>
  1006. <if test="unitId != null and unitId != ''"> and p.unit_id = #{unitId}</if>
  1007. <if test="avatar != null and avatar != ''"> and p.avatar = #{avatar}</if>
  1008. <if test="address != null and address != ''"> and p.address = #{address}</if>
  1009. <if test="phone != null and phone != ''"> and p.phone = #{phone}</if>
  1010. <if test="status != null "> and p.status = #{status}</if>
  1011. <if test="createtimes != null "> and p.createtimes = #{createtimes}</if>
  1012. <if test="updatetimes != null "> and p.updatetimes = #{updatetimes}</if>
  1013. <if test="reign != null "> and p.reign = #{reign}</if>
  1014. <if test="jobTime != null "> and p.job_time = #{jobTime}</if>
  1015. <if test="healthy != null and healthy != ''"> and p.healthy = #{healthy}</if>
  1016. <if test="bloodType != null and bloodType != ''"> and p.blood_type = #{bloodType}</if>
  1017. <if test="postTime != null "> and p.post_time = #{postTime}</if>
  1018. <if test="major != null and major != ''"> and p.major = #{major}</if>
  1019. <if test="admissionTime != null "> and p.admission_time = #{admissionTime}</if>
  1020. <if test="mobilePhoneModel != null and mobilePhoneModel != ''"> and p.mobile_phone_model = #{mobilePhoneModel}</if>
  1021. <if test="guaranteeCardNo != null and guaranteeCardNo != ''"> and p.guarantee_card_no = #{guaranteeCardNo}</if>
  1022. <if test="payrollCardNo != null and payrollCardNo != ''"> and p.payroll_card_no = #{payrollCardNo}</if>
  1023. <if test="authorizedStrength != null and authorizedStrength != ''"> and p.authorized_strength = #{authorizedStrength}</if>
  1024. <if test="aboral != null and aboral != ''"> and p.aboral = #{aboral}</if>
  1025. <if test="live != null and live != ''"> and p.live = #{live}</if>
  1026. <if test="userId != null "> and p.user_id = #{userId}</if>
  1027. <if test="nowMilitaryRank != null and nowMilitaryRank != ''"> and p.now_military_rank = #{nowMilitaryRank}</if>
  1028. <if test="treatmentLevel != null and treatmentLevel != ''"> and p.treatment_level = #{treatmentLevel}</if>
  1029. <if test="rankUpgradeTime != null "> and p.Rank_upgrade_time = #{rankUpgradeTime}</if>
  1030. <if test="statusrk != null "> and p.statusrk = #{statusrk}</if>
  1031. </where>
  1032. order by p.post_id desc
  1033. </select>
  1034. </mapper>