PartyMemberManageMapper.xml 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416
  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.inspur.mapper.PartyMemberManageMapper">
  6. <resultMap type="com.inspur.domain.partywork.PartyMemberManage" id="PartyMemberManageResult">
  7. <result property="id" column="id" />
  8. <result property="name" column="name" />
  9. <result property="gender" column="gender" />
  10. <result property="nation" column="nation" />
  11. <result property="birth" column="birth" />
  12. <result property="idNumber" column="id_number" />
  13. <result property="education" column="education" />
  14. <result property="picPath" column="pic_path" />
  15. <result property="nativePlace" column="native_place" />
  16. <result property="address" column="address" />
  17. <result property="partyType" column="party_type" />
  18. <result property="joinTime" column="join_time" />
  19. <result property="isExcellent" column="is_excellent" />
  20. <result property="isRetire" column="is_retire" />
  21. <result property="status" column="status" />
  22. <result property="mobile" column="mobile" />
  23. <result property="email" column="email" />
  24. <result property="filePath" column="file_path" />
  25. <result property="sort" column="sort" />
  26. <result property="orgId" column="org_id" />
  27. <result property="createTime" column="create_time" />
  28. <result property="createBy" column="create_by" />
  29. <result property="orgName" column="org_name" />
  30. <result property="userTableId" column="user_table_id" />
  31. <result property="userTableId" column="userTableId" />
  32. <result property="office" column="office" />
  33. <result property="dtId" column="dt_id" />
  34. <result property="dtOrgId" column="dt_org_id" />
  35. </resultMap>
  36. <sql id="selectPartyMemberManageVo">
  37. select id, name, gender, nation, birth, id_number, education, pic_path, native_place, address, party_type,
  38. join_time, is_excellent, is_retire, status, mobile, email, file_path, sort, org_id, create_time,
  39. create_by,user_table_id, dt_id, dt_org_id
  40. from party_member_manage
  41. </sql>
  42. <select id="selectPartyMemberManageList" parameterType="com.inspur.domain.partywork.PartyMemberManage" resultMap="PartyMemberManageResult">
  43. select b.id, b.name, b.gender, b.nation, b.birth, b.id_number, b.education, b.pic_path, b.native_place, b.address, b.party_type,
  44. b.join_time, b.is_excellent, b.is_retire, b.status, b.mobile, b.email, b.file_path, b.sort, b.org_id, b.create_time, b.create_by,b.org_name,b.userTableId,
  45. GROUP_CONCAT(b.office SEPARATOR ',') AS office
  46. from (select m.id, m.name, m.gender, m.nation, m.birth, m.id_number, m.education, m.pic_path, m.native_place, m.address, m.party_type,
  47. m.join_time, m.is_excellent, m.is_retire, m.status, m.mobile, m.email, m.file_path, m.sort, m.org_id, m.create_time, m.create_by,
  48. ifnull(concat(p.name, ' / ', o.name), o.name) as org_name,
  49. m.user_table_id as userTableId,
  50. a.office
  51. from party_member_manage m
  52. left join party_org_manage o on o.id = m.org_id
  53. left join party_org_manage p on p.id = o.pid
  54. left join (select rel.id, rel.post_id, pos.office, rel.member_id
  55. from party_post_member_rel rel
  56. left join party_org_post pos on rel.post_id = pos.id ) a on m.id = a.member_id) b
  57. <where>
  58. <if test="name != null and name != ''"> and b.name like concat('%', #{name}, '%')</if>
  59. <if test="gender != null "> and b.gender = #{gender}</if>
  60. <if test="nation != null "> and b.nation = #{nation}</if>
  61. <if test="birth != null "> and b.birth = #{birth}</if>
  62. <if test="idNumber != null and idNumber != ''"> and m.id_number = #{idNumber}</if>
  63. <if test="education != null "> and b.education = #{education}</if>
  64. <if test="picPath != null and picPath != ''"> and b.pic_path = #{picPath}</if>
  65. <if test="nativePlace != null and nativePlace != ''"> and b.native_place = #{nativePlace}</if>
  66. <if test="address != null and address != ''"> and b.address = #{address}</if>
  67. <if test="partyType != null "> and b.party_type = #{partyType}</if>
  68. <if test="joinTime != null "> and b.join_time = #{joinTime}</if>
  69. <if test="isExcellent != null "> and b.is_excellent = #{isExcellent}</if>
  70. <if test="isRetire != null "> and b.is_retire = #{isRetire}</if>
  71. <if test="status != null "> and b.status = #{status}</if>
  72. <if test="mobile != null and mobile != ''"> and b.mobile = #{mobile}</if>
  73. <if test="email != null and email != ''"> and b.email = #{email}</if>
  74. <if test="filePath != null and filePath != ''"> and b.file_path = #{filePath}</if>
  75. <if test="sort != null "> and b.sort = #{sort}</if>
  76. <if test="orgIds != null ">
  77. and b.org_id in
  78. <foreach collection="orgIds" item="orgId" open="(" close=")" separator=",">
  79. #{orgId}
  80. </foreach>
  81. </if>
  82. <if test="userTableId != null "> and b.userTableId = #{userTableId}</if>
  83. <if test="memberList == null "> and b.status = "0"</if>
  84. </where>
  85. group by b.id
  86. order by b.sort, b.id
  87. </select>
  88. <select id="selectPartyMemberManageById" parameterType="Long" resultMap="PartyMemberManageResult">
  89. <include refid="selectPartyMemberManageVo"/>
  90. where id = #{id}
  91. </select>
  92. <select id="selectPartyMemberManageByDtId" parameterType="String" resultMap="PartyMemberManageResult">
  93. <include refid="selectPartyMemberManageVo"/>
  94. where dt_id = #{dtId}
  95. </select>
  96. <select id="selectPartyMemberManageByDtIdAndUid" resultMap="PartyMemberManageResult">
  97. <include refid="selectPartyMemberManageVo"/>
  98. where dt_id = #{dtId} and user_table_id = #{uid}
  99. </select>
  100. <insert id="insertPartyMemberManage" parameterType="com.inspur.domain.partywork.PartyMemberManage" useGeneratedKeys="true" keyProperty="id">
  101. insert into party_member_manage
  102. <trim prefix="(" suffix=")" suffixOverrides=",">
  103. <if test="name != null">name,</if>
  104. <if test="gender != null">gender,</if>
  105. <if test="nation != null">nation,</if>
  106. <if test="birth != null">birth,</if>
  107. <if test="idNumber != null">id_number,</if>
  108. <if test="education != null">education,</if>
  109. <if test="picPath != null">pic_path,</if>
  110. <if test="nativePlace != null">native_place,</if>
  111. <if test="address != null">address,</if>
  112. <if test="partyType != null">party_type,</if>
  113. <if test="joinTime != null">join_time,</if>
  114. <if test="isExcellent != null">is_excellent,</if>
  115. <if test="isRetire != null">is_retire,</if>
  116. <if test="status != null">status,</if>
  117. <if test="mobile != null">mobile,</if>
  118. <if test="email != null">email,</if>
  119. <if test="filePath != null">file_path,</if>
  120. <if test="sort != null">sort,</if>
  121. <if test="orgId != null">org_id,</if>
  122. <if test="createTime != null">create_time,</if>
  123. <if test="createBy != null">create_by,</if>
  124. <if test="userTableId != null">user_table_id,</if>
  125. <if test="dtId != null">dt_id,</if>
  126. <if test="dtOrgId != null">dt_org_id,</if>
  127. </trim>
  128. <trim prefix="values (" suffix=")" suffixOverrides=",">
  129. <if test="name != null">#{name},</if>
  130. <if test="gender != null">#{gender},</if>
  131. <if test="nation != null">#{nation},</if>
  132. <if test="birth != null">#{birth},</if>
  133. <if test="idNumber != null">#{idNumber},</if>
  134. <if test="education != null">#{education},</if>
  135. <if test="picPath != null">#{picPath},</if>
  136. <if test="nativePlace != null">#{nativePlace},</if>
  137. <if test="address != null">#{address},</if>
  138. <if test="partyType != null">#{partyType},</if>
  139. <if test="joinTime != null">#{joinTime},</if>
  140. <if test="isExcellent != null">#{isExcellent},</if>
  141. <if test="isRetire != null">#{isRetire},</if>
  142. <if test="status != null">#{status},</if>
  143. <if test="mobile != null">#{mobile},</if>
  144. <if test="email != null">#{email},</if>
  145. <if test="filePath != null">#{filePath},</if>
  146. <if test="sort != null">#{sort},</if>
  147. <if test="orgId != null">#{orgId},</if>
  148. <if test="createTime != null">#{createTime},</if>
  149. <if test="createBy != null">#{createBy},</if>
  150. <if test="userTableId != null">#{userTableId},</if>
  151. <if test="dtId != null">#{dtId},</if>
  152. <if test="dtOrgId != null">#{dtOrgId},</if>
  153. </trim>
  154. </insert>
  155. <update id="updatePartyMemberManage" parameterType="com.inspur.domain.partywork.PartyMemberManage">
  156. update party_member_manage
  157. <trim prefix="SET" suffixOverrides=",">
  158. <if test="name != null">name = #{name},</if>
  159. <if test="gender != null">gender = #{gender},</if>
  160. <if test="nation != null">nation = #{nation},</if>
  161. <if test="birth != null">birth = #{birth},</if>
  162. <if test="idNumber != null">id_number = #{idNumber},</if>
  163. <if test="education != null">education = #{education},</if>
  164. <if test="picPath != null">pic_path = #{picPath},</if>
  165. <if test="nativePlace != null">native_place = #{nativePlace},</if>
  166. <if test="address != null">address = #{address},</if>
  167. <if test="partyType != null">party_type = #{partyType},</if>
  168. <if test="joinTime != null">join_time = #{joinTime},</if>
  169. <if test="isExcellent != null">is_excellent = #{isExcellent},</if>
  170. <if test="isRetire != null">is_retire = #{isRetire},</if>
  171. <if test="status != null">status = #{status},</if>
  172. <if test="mobile != null">mobile = #{mobile},</if>
  173. <if test="email != null">email = #{email},</if>
  174. <if test="filePath != null">file_path = #{filePath},</if>
  175. <if test="sort != null">sort = #{sort},</if>
  176. <if test="orgId != null">org_id = #{orgId},</if>
  177. <if test="createTime != null">create_time = #{createTime},</if>
  178. <if test="createBy != null">create_by = #{createBy},</if>
  179. <if test="dtId != null">dt_id = #{dtId},</if>
  180. <if test="dtOrgId != null">dt_org_id = #{dtOrgId},</if>
  181. </trim>
  182. where id = #{id}
  183. </update>
  184. <delete id="deletePartyMemberManageById" parameterType="Long">
  185. delete from party_member_manage where id = #{id}
  186. </delete>
  187. <delete id="deletePartyMemberManageByIds" parameterType="String">
  188. delete from party_member_manage where id in
  189. <foreach item="id" collection="array" open="(" separator="," close=")">
  190. #{id}
  191. </foreach>
  192. </delete>
  193. <select id="selectPartyMemberManageListAll" parameterType="com.inspur.domain.partywork.PartyMemberManage" resultType="com.inspur.domain.partywork.OrgTreeVo">
  194. select id as 'value' ,name as label ,org_id as orgId from party_member_manage and user_table_id = #{userTableId} order by sort
  195. </select>
  196. <select id="selectScreenMemberListByOrgIds" resultType="com.inspur.domain.screen.ScreenMemberResultVo" parameterType="String">
  197. SELECT
  198. m.id AS userid,
  199. m. NAME AS username,
  200. m.gender AS sex,
  201. m.nation,
  202. m.birth,
  203. m.id_number AS card,
  204. m.education,
  205. m.pic_path,
  206. m.native_place,
  207. m.address,
  208. m.party_type AS party_member_type,
  209. m.join_time,
  210. m.mobile,
  211. m.email,
  212. m.org_id AS orgid,
  213. p.bac_office AS office
  214. FROM
  215. party_member_manage m
  216. LEFT JOIN party_post_member_rel r ON m.id = r.member_id
  217. LEFT JOIN party_org_post p ON r.post_id = p.id
  218. WHERE
  219. m.org_id in
  220. <foreach collection="orgIds" item="orgId" open="(" close=")" separator=",">
  221. #{orgId}
  222. </foreach>
  223. and m.status = 0
  224. order by m.sort, m.id
  225. </select>
  226. <select id="selectMemberListByIds" resultType="com.inspur.domain.screen.ScreenMemberResultVo" parameterType="Long">
  227. SELECT
  228. m.id AS userid,
  229. m. NAME AS username,
  230. m.gender AS sex,
  231. m.nation,
  232. m.birth,
  233. m.id_number AS card,
  234. m.education,
  235. m.pic_path,
  236. m.native_place,
  237. m.address,
  238. m.party_type AS party_member_type,
  239. m.join_time,
  240. m.mobile,
  241. m.email,
  242. m.org_id AS orgid,
  243. p.office
  244. FROM
  245. party_member_manage m
  246. LEFT JOIN party_post_member_rel r ON m.id = r.member_id
  247. LEFT JOIN party_org_post p ON r.post_id = p.id
  248. WHERE
  249. m.id in
  250. <foreach collection="ids" item="id" open="(" close=")" separator=",">
  251. #{id}
  252. </foreach>
  253. </select>
  254. <select id="selectOffice" resultType="java.util.LinkedHashMap" parameterType="String">
  255. SELECT p.bac_office as office,m.`name` from party_org_post p
  256. LEFT JOIN party_post_member_rel r on p.id = r.post_id
  257. LEFT JOIN party_member_manage m on m.id = r.member_id
  258. where p.org_id = #{orgId}
  259. </select>
  260. <select id="selectMaleFemale" resultType="java.util.LinkedHashMap" parameterType="Long">
  261. select case when a.gender =0 then 'female' else 'male' end sex,
  262. count(1) count from party_member_manage a
  263. where a.user_table_id = #{userTableId}
  264. GROUP BY a.gender
  265. </select>
  266. <select id="age_distribution" resultType="java.util.LinkedHashMap" parameterType="Long">
  267. select
  268. IFNULL(sum(IF((TIMESTAMPDIFF(YEAR,a.birth,CURDATE()) &lt;20), 1, 0)), 0) AS 20岁以下,
  269. IFNULL(sum(IF((TIMESTAMPDIFF(YEAR,a.birth,CURDATE())>=20 and TIMESTAMPDIFF(YEAR,a.birth,CURDATE()) &lt;30), 1, 0)), 0) AS "20-30岁",
  270. IFNULL(sum(IF((TIMESTAMPDIFF(YEAR,a.birth,CURDATE())>=30 and TIMESTAMPDIFF(YEAR,a.birth,CURDATE()) &lt;40), 1, 0)), 0) AS "30-40岁",
  271. IFNULL(sum(IF((TIMESTAMPDIFF(YEAR,a.birth,CURDATE())>=40 and TIMESTAMPDIFF(YEAR,a.birth,CURDATE()) &lt;50), 1, 0)), 0) AS "40-50岁",
  272. IFNULL(sum(IF((TIMESTAMPDIFF(YEAR,a.birth,CURDATE())>=50 and TIMESTAMPDIFF(YEAR,a.birth,CURDATE()) &lt;=60), 1, 0)), 0) AS "50-60岁",
  273. IFNULL(sum(IF((TIMESTAMPDIFF(YEAR,a.birth,CURDATE())>60), 1, 0)), 0) AS "60岁以上"
  274. from party_member_manage a
  275. where a.user_table_id = #{userTableId}
  276. </select>
  277. <select id="probationary_distribution" resultType="java.util.LinkedHashMap" parameterType="Long">
  278. select
  279. ROUND(truncate(IFNULL(sum(IF((TIMESTAMPDIFF(YEAR,a.join_time,CURDATE()) &lt;5), 1, 0)), 0)/count(1),5)*100,0) AS 5年以下,
  280. ROUND(truncate(IFNULL(sum(IF((TIMESTAMPDIFF(YEAR,a.join_time,CURDATE())>=5 and TIMESTAMPDIFF(YEAR,a.join_time,CURDATE()) &lt;10), 1, 0)), 0)/count(1),5)*100,0) AS "5-10年",
  281. ROUND(truncate(IFNULL(sum(IF((TIMESTAMPDIFF(YEAR,a.join_time,CURDATE())>=10 and TIMESTAMPDIFF(YEAR,a.join_time,CURDATE()) &lt;15), 1, 0)), 0)/count(1),5)*100,0) AS "10-15年",
  282. ROUND(truncate(IFNULL(sum(IF((TIMESTAMPDIFF(YEAR,a.join_time,CURDATE())>=15 and TIMESTAMPDIFF(YEAR,a.join_time,CURDATE()) &lt;20), 1, 0)), 0)/count(1),5)*100,0) AS "15-20年",
  283. ROUND(truncate(IFNULL(sum(IF((TIMESTAMPDIFF(YEAR,a.join_time,CURDATE())>=20 and TIMESTAMPDIFF(YEAR,a.join_time,CURDATE()) &lt;=30), 1, 0)), 0)/count(1),5)*100,0) AS "20-30年",
  284. ROUND(truncate(IFNULL(sum(IF((TIMESTAMPDIFF(YEAR,a.join_time,CURDATE())>30), 1, 0)), 0)/count(1),5)*100,0) AS "30年以上"
  285. from party_member_manage a
  286. where a.user_table_id = #{userTableId}
  287. </select>
  288. <select id="selectMemberNum" resultType="java.util.LinkedHashMap" parameterType="Long">
  289. select
  290. IFNULL(sum(IF((TIMESTAMPDIFF(YEAR,a.join_time,CURDATE()) &lt;5), 1, 0)), 0) AS 5年以下,
  291. IFNULL(sum(IF((TIMESTAMPDIFF(YEAR,a.join_time,CURDATE())>=5 and TIMESTAMPDIFF(YEAR,a.join_time,CURDATE()) &lt;10), 1, 0)), 0) AS "5-10年",
  292. IFNULL(sum(IF((TIMESTAMPDIFF(YEAR,a.join_time,CURDATE())>=10 and TIMESTAMPDIFF(YEAR,a.join_time,CURDATE()) &lt;15), 1, 0)), 0) AS "10-15年",
  293. IFNULL(sum(IF((TIMESTAMPDIFF(YEAR,a.join_time,CURDATE())>=15 and TIMESTAMPDIFF(YEAR,a.join_time,CURDATE()) &lt;20), 1, 0)), 0) AS "15-20年",
  294. IFNULL(sum(IF((TIMESTAMPDIFF(YEAR,a.join_time,CURDATE())>=20 and TIMESTAMPDIFF(YEAR,a.join_time,CURDATE()) &lt;=30), 1, 0)), 0) AS "20-30年",
  295. IFNULL(sum(IF((TIMESTAMPDIFF(YEAR,a.join_time,CURDATE())>30), 1, 0)), 0) AS "30年以上"
  296. from party_member_manage a
  297. where a.user_table_id = #{userTableId}
  298. </select>
  299. <select id="partyMembers" resultType="java.util.LinkedHashMap" parameterType="Long">
  300. select b.name,
  301. (select count(1) from party_member_manage a where a.org_id=b.id) count,
  302. (select count(1) from party_member_manage a where a.user_table_id = #{userTableId}) "all"
  303. from party_org_manage b
  304. where b.user_table_id = #{orgTableId}
  305. order by b.sort
  306. </select>
  307. <select id="degree_distribution" resultType="java.util.LinkedHashMap" parameterType="Long">
  308. select
  309. ROUND(truncate(IFNULL(sum(IF((a.education =1 or a.education =2), 1, 0)), 0)/count(1),4)*100) '初中及以下',
  310. ROUND(truncate(IFNULL(sum(IF((a.education =3 or a.education =4), 1, 0)), 0)/count(1),4)*100) '高中/中专',
  311. ROUND(truncate(IFNULL(sum(IF(a.education =5, 1, 0)), 0)/count(1),4)*100) '大专',
  312. ROUND(truncate(IFNULL(sum(IF(a.education =6, 1, 0)), 0)/count(1),4)*100) '本科',
  313. ROUND(truncate(IFNULL(sum(IF((a.education =7 or a.education =8), 1, 0)), 0)/count(1),4)*100) '研究生及以上',
  314. ROUND(truncate(IFNULL(sum(IF((a.education =9), 1, 0)), 0)/count(1),4)*100) '其他'
  315. from party_member_manage a
  316. where a.user_table_id = #{userTableId}
  317. </select>
  318. <select id="degree_distribution2" resultType="java.util.LinkedHashMap" parameterType="Long">
  319. select
  320. IFNULL(sum(IF((a.education = 1 or a.education = 2), 1, 0)), 0) '初中及以下',
  321. IFNULL(sum(IF((a.education = 3 or a.education = 4), 1, 0)), 0) '高中/中专',
  322. IFNULL(sum(IF(a.education = 5, 1, 0)), 0) '大专',
  323. IFNULL(sum(IF(a.education = 6, 1, 0)), 0) '本科',
  324. IFNULL(sum(IF(a.education = 7, 1, 0)), 0) '硕士研究生',
  325. IFNULL(sum(IF(a.education = 8, 1, 0)), 0) '博士研究生'
  326. from party_member_manage a
  327. where a.user_table_id = #{userTableId}
  328. </select>
  329. <select id="learningpacesetter" resultType="java.util.LinkedHashMap" parameterType="Long">
  330. select b.org_name orgname,a.pic_path pic,a.id userid,a.name username from party_member_manage a,party_model_student b
  331. where a.id = b.member_id and a.user_table_id = #{userTableId}
  332. order by b.sort, b.create_time desc
  333. </select>
  334. <select id="selectNoBindWxList" resultMap="PartyMemberManageResult">
  335. <include refid="selectPartyMemberManageVo" />
  336. where user_table_id = #{userTableId}
  337. and status = '0'
  338. <if test="bindMemberIds != null and bindMemberIds.size != 0">
  339. and id not in
  340. <foreach collection="bindMemberIds" item="id" open="(" close=")" separator=",">
  341. #{id}
  342. </foreach>
  343. </if>
  344. </select>
  345. <select id="probationaryDistributionCount" parameterType="Long" resultType="java.util.LinkedHashMap">
  346. select
  347. IFNULL(sum(IF((TIMESTAMPDIFF(YEAR,a.join_time,CURDATE()) &lt; 5), 1, 0)),0) AS "5年以下",
  348. IFNULL(sum(IF((TIMESTAMPDIFF(YEAR,a.join_time,CURDATE())>=5 and TIMESTAMPDIFF(YEAR,a.join_time,CURDATE()) &lt; 10), 1, 0)),0) AS "5-10年",
  349. IFNULL(sum(IF((TIMESTAMPDIFF(YEAR,a.join_time,CURDATE())>=10 and TIMESTAMPDIFF(YEAR,a.join_time,CURDATE()) &lt; 15), 1, 0)),0) AS "10-15年",
  350. IFNULL(sum(IF((TIMESTAMPDIFF(YEAR,a.join_time,CURDATE())>=15 and TIMESTAMPDIFF(YEAR,a.join_time,CURDATE()) &lt; 20), 1, 0)),0) AS "15-20年",
  351. IFNULL(sum(IF((TIMESTAMPDIFF(YEAR,a.join_time,CURDATE())>=20 and TIMESTAMPDIFF(YEAR,a.join_time,CURDATE()) &lt;= 30), 1, 0)),0) AS "20-30年",
  352. IFNULL(sum(IF((TIMESTAMPDIFF(YEAR,a.join_time,CURDATE())>30), 1, 0)),0) AS "30年以上"
  353. from party_member_manage a
  354. where a.user_table_id = #{userTableId}
  355. </select>
  356. <select id="selectCount" parameterType="Long" resultType="Integer">
  357. select count(1) from party_member_manage where user_table_id = #{userTableId}
  358. </select>
  359. <select id="partyOrgMembers" resultType="java.util.LinkedHashMap" parameterType="Long">
  360. select
  361. b.name,
  362. (select count(1) from party_member_manage a where a.org_id = b.id) as "countNum",
  363. (select count(1) from party_member_manage a where a.org_id = b.id and a.is_excellent = '1') as "excellentNum"
  364. from party_org_manage b
  365. where b.user_table_id = #{orgUserTableId}
  366. order by b.sort
  367. </select>
  368. <select id="selectWxMemberInfoVo" parameterType="Long" resultType="com.inspur.domain.app.PartyMemberInfoVo">
  369. SELECT m.id, m.`name`,m.gender,m.join_time as joinTime,m.pic_path as picPath,m.org_id as orgId,o.`name` as orgName,p.`name` as parentOrgName from party_member_manage m
  370. LEFT JOIN party_org_manage o on o.id = m.org_id
  371. LEFT JOIN party_org_manage p on o.pid = p.id
  372. where m.id = #{memeberId}
  373. </select>
  374. <select id="selectMemberManageList" parameterType="String" resultMap="PartyMemberManageResult">
  375. select m.id, m.name, m.gender, m.nation, m.birth, m.id_number, m.education, m.pic_path, m.native_place, m.address, m.party_type,
  376. m.join_time, m.is_excellent, m.is_retire, m.status, m.mobile, m.email, m.file_path, m.sort, m.org_id, m.create_time, m.create_by,o.name as org_name,m.user_table_id as userTableId from party_member_manage m left join party_org_manage o on o.id = m.org_id
  377. where m.org_id = #{orgId}
  378. order by m.sort
  379. </select>
  380. <select id="selectMyOrgMemberList" parameterType="Long" resultType="com.inspur.domain.partywork.PartyMemberManage">
  381. SELECT m.id, m.`name`,m.gender,m.join_time as joinTime,m.pic_path as picPath,m.org_id as orgId,IFNULL(CONCAT(p.`name`,'/',o.`name`),o.`name`) as orgName from party_member_manage m
  382. LEFT JOIN party_org_manage o on o.id = m.org_id
  383. LEFT JOIN party_org_manage p on o.pid = p.id
  384. where m.user_table_id = #{userTableId}
  385. and m.status = '0'
  386. order by m.sort
  387. </select>
  388. </mapper>