TacExprRcmmDao.xml 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="cn.com.goldenwater.dcproj.dao.TacExprRcmmDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.TacExprRcmm" id="tacExprRcmmResultMap">
  5. <result property="id" column="ID"/>
  6. <result property="depCode" column="DEP_CODE"/>
  7. <result property="depNm" column="DEP_NM"/>
  8. <result property="name" column="NAME"/>
  9. <result property="sex" column="SEX"/>
  10. <result property="idNo" column="ID_NO"/>
  11. <result property="education" column="EDUCATION"/>
  12. <result property="roleType" column="ROLE_TYPE"/>
  13. <result property="groupType" column="GROUP_TYPE"/>
  14. <result property="isOffice" column="IS_OFFICE"/>
  15. <result property="isTraining" column="IS_TRAINING"/>
  16. <result property="workAd" column="WORK_AD"/>
  17. <result property="workAdNm" column="WORK_AD_NM"/>
  18. <result property="workDpNm" column="WORK_DP_NM"/>
  19. <result property="unitRanks" column="UNIT_RANKS"/>
  20. <result property="titles" column="TITLES"/>
  21. <result property="duty" column="DUTY"/>
  22. <result property="professional" column="PROFESSIONAL"/>
  23. <result property="isCvl" column="IS_CVL"/>
  24. <result property="orgCode" column="ORG_CODE"/>
  25. <result property="orgNm" column="ORG_NM"/>
  26. <result property="telnumb" column="TELNUMB"/>
  27. <result property="mobilenumb" column="MOBILENUMB"/>
  28. <result property="email" column="EMAIL"/>
  29. <result property="emgcCntct" column="EMGC_CNTCT"/>
  30. <result property="emgcCntctPhone" column="EMGC_CNTCT_PHONE"/>
  31. <result property="bankAccount" column="BANK_ACCOUNT"/>
  32. <result property="bankName" column="BANK_NAME"/>
  33. <result property="oe" column="OE"/>
  34. <result property="state" column="STATE"/>
  35. <result property="persId" column="PERS_ID"/>
  36. <result property="intm" column="INTM"/>
  37. <result property="uptm" column="UPTM"/>
  38. <result property="dataStat" column="DATA_STAT"/>
  39. </resultMap>
  40. <sql id="table_columns">
  41. ID,
  42. DEP_CODE,
  43. DEP_NM,
  44. NAME,
  45. SEX,
  46. ID_NO,
  47. EDUCATION,
  48. ROLE_TYPE,
  49. GROUP_TYPE,
  50. IS_OFFICE,
  51. IS_TRAINING,
  52. WORK_AD,
  53. WORK_AD_NM,
  54. WORK_DP_NM,
  55. UNIT_RANKS,
  56. TITLES,
  57. DUTY,
  58. PROFESSIONAL,
  59. IS_CVL,
  60. ORG_CODE,
  61. ORG_NM,
  62. TELNUMB,
  63. MOBILENUMB,
  64. EMAIL,
  65. EMGC_CNTCT,
  66. EMGC_CNTCT_PHONE,
  67. BANK_ACCOUNT,
  68. BANK_NAME,
  69. OE,
  70. STATE,
  71. PERS_ID,
  72. INTM,
  73. UPTM,
  74. DATA_STAT
  75. </sql>
  76. <sql id="entity_properties">
  77. #{id},
  78. #{depCode},
  79. #{depNm},
  80. #{name},
  81. #{sex},
  82. #{idNo},
  83. #{education},
  84. #{roleType},
  85. #{groupType},
  86. #{isOffice},
  87. #{isTraining},
  88. #{workAd},
  89. #{workAdNm},
  90. #{workDpNm},
  91. #{unitRanks},
  92. #{titles},
  93. #{duty},
  94. #{professional},
  95. #{isCvl},
  96. #{orgCode},
  97. #{orgNm},
  98. #{telnumb},
  99. #{mobilenumb},
  100. #{email},
  101. #{emgcCntct},
  102. #{emgcCntctPhone},
  103. #{bankAccount},
  104. #{bankName},
  105. #{oe},
  106. #{state},
  107. #{persId},
  108. #{intm},
  109. #{uptm},
  110. #{dataStat}
  111. </sql>
  112. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  113. <sql id="page_where">
  114. <trim prefix="where" prefixOverrides="and | or ">
  115. <if test="depCode != null and depCode != ''">and DEP_CODE = #{depCode}</if>
  116. <if test="depNm != null and depNm != ''">and DEP_NM = #{depNm}</if>
  117. <if test="name != null and name != ''">and NAME like '%${name}%'</if>
  118. <if test="sex != null and sex != ''">and SEX = #{sex}</if>
  119. <if test="idNo != null and idNo != ''">and ID_NO = #{idNo}</if>
  120. <if test="education != null and education != ''">and EDUCATION = #{education}</if>
  121. <if test="roleType != null and roleType != ''">and ROLE_TYPE = #{roleType}</if>
  122. <if test="groupType != null and groupType != ''">and GROUP_TYPE = #{groupType}</if>
  123. <if test="isOffice != null and isOffice != ''">and IS_OFFICE = #{isOffice}</if>
  124. <if test="isTraining != null and isTraining != ''">and IS_TRAINING = #{isTraining}</if>
  125. <if test="workAd != null and workAd != ''">and WORK_AD = #{workAd}</if>
  126. <if test="workAdNm != null and workAdNm != ''">and WORK_AD_NM = #{workAdNm}</if>
  127. <if test="workDpNm != null and workDpNm != ''">and WORK_DP_NM = #{workDpNm}</if>
  128. <if test="unitRanks != null and unitRanks != ''">and UNIT_RANKS = #{unitRanks}</if>
  129. <if test="titles != null and titles != ''">and TITLES = #{titles}</if>
  130. <if test="duty != null and duty != ''">and DUTY = #{duty}</if>
  131. <if test="professional != null and professional != ''">and PROFESSIONAL = #{professional}</if>
  132. <if test="isCvl != null and isCvl != ''">and IS_CVL = #{isCvl}</if>
  133. <if test="orgCode != null and orgCode != ''">and ORG_CODE = #{orgCode}</if>
  134. <if test="orgNm != null and orgNm != ''">and ORG_NM = #{orgNm}</if>
  135. <if test="telnumb != null and telnumb != ''">and TELNUMB = #{telnumb}</if>
  136. <if test="mobilenumb != null and mobilenumb != ''">and MOBILENUMB = #{mobilenumb}</if>
  137. <if test="email != null and email != ''">and EMAIL = #{email}</if>
  138. <if test="emgcCntct != null and emgcCntct != ''">and EMGC_CNTCT = #{emgcCntct}</if>
  139. <if test="emgcCntctPhone != null and emgcCntctPhone != ''">and EMGC_CNTCT_PHONE = #{emgcCntctPhone}</if>
  140. <if test="bankAccount != null and bankAccount != ''">and BANK_ACCOUNT = #{bankAccount}</if>
  141. <if test="bankName != null and bankName != ''">and BANK_NAME = #{bankName}</if>
  142. <if test="oe != null and oe != ''">and OE = #{oe}</if>
  143. <if test="state != null and state != ''">and STATE = #{state}</if>
  144. <if test="persId != null and persId != ''">and PERS_ID = #{persId}</if>
  145. <if test="intm != null">and INTM = #{intm}</if>
  146. <if test="uptm != null">and UPTM = #{uptm}</if>
  147. <if test="dataStat != null and dataStat != ''">and DATA_STAT = #{dataStat}</if>
  148. </trim>
  149. </sql>
  150. <select id="get" resultMap="tacExprRcmmResultMap" parameterType="String">
  151. select
  152. <include refid="table_columns"/>
  153. from TAC_EXPR_RCMM where ID = #{id}
  154. </select>
  155. <select id="getBy" resultMap="tacExprRcmmResultMap">
  156. select
  157. <include refid="table_columns"/>
  158. from TAC_EXPR_RCMM
  159. <include refid="page_where"/>
  160. </select>
  161. <select id="findAll" resultMap="tacExprRcmmResultMap">
  162. select
  163. <include refid="table_columns"/>
  164. from TAC_EXPR_RCMM
  165. </select>
  166. <select id="findList" resultMap="tacExprRcmmResultMap">
  167. select
  168. <include refid="table_columns"/>
  169. from TAC_EXPR_RCMM
  170. <include refid="page_where"/>
  171. </select>
  172. <select id="selectCount" resultType="int">
  173. select count(ID) from TAC_EXPR_RCMM
  174. <include refid="page_where"/>
  175. </select>
  176. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.TacExprRcmm">
  177. insert into TAC_EXPR_RCMM(
  178. <include refid="table_columns"/>
  179. )
  180. values (
  181. <include refid="entity_properties"/>
  182. )
  183. </insert>
  184. <delete id="delete" parameterType="java.lang.String">
  185. delete from TAC_EXPR_RCMM where ID = #{id}
  186. </delete>
  187. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.TacExprRcmm">
  188. delete from TAC_EXPR_RCMM
  189. <include refid="page_where"/>
  190. </delete>
  191. <update id="deleteInFlag" parameterType="java.lang.String">
  192. update TAC_EXPR_RCMM set flag_valid = 0 where ID = #{id}
  193. </update>
  194. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.TacExprRcmm">
  195. update TAC_EXPR_RCMM
  196. <trim prefix="set" suffixOverrides=",">
  197. <if test="depCode != null and depCode != ''">DEP_CODE = #{depCode},</if>
  198. <if test="depNm != null and depNm != ''">DEP_NM = #{depNm},</if>
  199. <if test="name != null and name != ''">NAME = #{name},</if>
  200. <if test="sex != null and sex != ''">SEX = #{sex},</if>
  201. <if test="idNo != null and idNo != ''">ID_NO = #{idNo},</if>
  202. <if test="education != null and education != ''">EDUCATION = #{education},</if>
  203. <if test="roleType != null and roleType != ''">ROLE_TYPE = #{roleType},</if>
  204. <if test="groupType != null and groupType != ''">GROUP_TYPE = #{groupType},</if>
  205. <if test="isOffice != null and isOffice != ''">IS_OFFICE = #{isOffice},</if>
  206. <if test="isTraining != null and isTraining != ''">IS_TRAINING = #{isTraining},</if>
  207. <if test="workAd != null and workAd != ''">WORK_AD = #{workAd},</if>
  208. <if test="workAdNm != null and workAdNm != ''">WORK_AD_NM = #{workAdNm},</if>
  209. <if test="workDpNm != null and workDpNm != ''">WORK_DP_NM = #{workDpNm},</if>
  210. <if test="unitRanks != null and unitRanks != ''">UNIT_RANKS = #{unitRanks},</if>
  211. <if test="titles != null and titles != ''">TITLES = #{titles},</if>
  212. <if test="duty != null and duty != ''">DUTY = #{duty},</if>
  213. <if test="professional != null and professional != ''">PROFESSIONAL = #{professional},</if>
  214. <if test="isCvl != null and isCvl != ''">IS_CVL = #{isCvl},</if>
  215. <if test="orgCode != null and orgCode != ''">ORG_CODE = #{orgCode},</if>
  216. <if test="orgNm != null and orgNm != ''">ORG_NM = #{orgNm},</if>
  217. <if test="telnumb != null and telnumb != ''">TELNUMB = #{telnumb},</if>
  218. <if test="mobilenumb != null and mobilenumb != ''">MOBILENUMB = #{mobilenumb},</if>
  219. <if test="email != null and email != ''">EMAIL = #{email},</if>
  220. <if test="emgcCntct != null and emgcCntct != ''">EMGC_CNTCT = #{emgcCntct},</if>
  221. <if test="emgcCntctPhone != null and emgcCntctPhone != ''">EMGC_CNTCT_PHONE = #{emgcCntctPhone},</if>
  222. <if test="bankAccount != null and bankAccount != ''">BANK_ACCOUNT = #{bankAccount},</if>
  223. <if test="bankName != null and bankName != ''">BANK_NAME = #{bankName},</if>
  224. <if test="oe != null and oe != ''">OE = #{oe},</if>
  225. <if test="state != null and state != ''">STATE = #{state},</if>
  226. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  227. <if test="intm != null">INTM = #{intm},</if>
  228. <if test="uptm != null">UPTM = #{uptm},</if>
  229. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  230. </trim>
  231. <where>ID = #{id}</where>
  232. </update>
  233. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.TacExprRcmm">
  234. update TAC_EXPR_RCMM
  235. <trim prefix="set" suffixOverrides=",">
  236. <if test="depCode != null and depCode != ''">DEP_CODE = #{depCode},</if>
  237. <if test="depNm != null and depNm != ''">DEP_NM = #{depNm},</if>
  238. <if test="name != null and name != ''">NAME = #{name},</if>
  239. <if test="sex != null and sex != ''">SEX = #{sex},</if>
  240. <if test="idNo != null and idNo != ''">ID_NO = #{idNo},</if>
  241. <if test="education != null and education != ''">EDUCATION = #{education},</if>
  242. <if test="roleType != null and roleType != ''">ROLE_TYPE = #{roleType},</if>
  243. <if test="groupType != null and groupType != ''">GROUP_TYPE = #{groupType},</if>
  244. <if test="isOffice != null and isOffice != ''">IS_OFFICE = #{isOffice},</if>
  245. <if test="isTraining != null and isTraining != ''">IS_TRAINING = #{isTraining},</if>
  246. <if test="workAd != null and workAd != ''">WORK_AD = #{workAd},</if>
  247. <if test="workAdNm != null and workAdNm != ''">WORK_AD_NM = #{workAdNm},</if>
  248. <if test="workDpNm != null and workDpNm != ''">WORK_DP_NM = #{workDpNm},</if>
  249. <if test="unitRanks != null and unitRanks != ''">UNIT_RANKS = #{unitRanks},</if>
  250. <if test="titles != null and titles != ''">TITLES = #{titles},</if>
  251. <if test="duty != null and duty != ''">DUTY = #{duty},</if>
  252. <if test="professional != null and professional != ''">PROFESSIONAL = #{professional},</if>
  253. <if test="isCvl != null and isCvl != ''">IS_CVL = #{isCvl},</if>
  254. <if test="orgCode != null and orgCode != ''">ORG_CODE = #{orgCode},</if>
  255. <if test="orgNm != null and orgNm != ''">ORG_NM = #{orgNm},</if>
  256. <if test="telnumb != null and telnumb != ''">TELNUMB = #{telnumb},</if>
  257. <if test="mobilenumb != null and mobilenumb != ''">MOBILENUMB = #{mobilenumb},</if>
  258. <if test="email != null and email != ''">EMAIL = #{email},</if>
  259. <if test="emgcCntct != null and emgcCntct != ''">EMGC_CNTCT = #{emgcCntct},</if>
  260. <if test="emgcCntctPhone != null and emgcCntctPhone != ''">EMGC_CNTCT_PHONE = #{emgcCntctPhone},</if>
  261. <if test="bankAccount != null and bankAccount != ''">BANK_ACCOUNT = #{bankAccount},</if>
  262. <if test="bankName != null and bankName != ''">BANK_NAME = #{bankName},</if>
  263. <if test="oe != null and oe != ''">OE = #{oe},</if>
  264. <if test="state != null and state != ''">STATE = #{state},</if>
  265. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  266. <if test="intm != null">INTM = #{intm},</if>
  267. <if test="uptm != null">UPTM = #{uptm},</if>
  268. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  269. </trim>
  270. <include refid="page_where"/>
  271. </update>
  272. <!-- 其他自定义SQL -->
  273. <select id="getRcmmList" resultMap="tacExprRcmmResultMap"
  274. parameterType="cn.com.goldenwater.dcproj.param.TacExprRcmmParam">
  275. SELECT
  276. <include refid="table_columns"/>
  277. FROM TAC_EXPR_RCMM
  278. WHERE 1=1
  279. <if test="sex != null and sex != '' ">
  280. AND SEX = #{sex}
  281. </if>
  282. <if test="education != null and education != ''">AND EDUCATION = #{education}</if>
  283. <if test="titles != null and titles != ''">AND TITLES = #{titles}</if>
  284. <if test="unitRanks != null and unitRanks != ''">AND UNIT_RANKS = #{unitRanks}</if>
  285. <if test="state != null and state != ''">
  286. and state in (${state})
  287. </if>
  288. <if test="workAd != null and workAd != ''">
  289. and work_ad in (${workAd})
  290. </if>
  291. <if test="orgCode != null and orgCode != ''">
  292. and ORG_CODE in (${orgCode})
  293. </if>
  294. <if test="sttm != null and sttm != '' and entm != null and entm != ''">
  295. AND INTM &gt;= str_to_date(#{sttm},'%Y-%m-%d') AND INTM &lt; str_to_date(#{entm},'%Y-%m-%d')
  296. </if>
  297. <if test="roleType != null and roleType != ''">
  298. AND ROLE_TYPE in (${roleType})
  299. </if>
  300. <if test="rcmmIds != null and rcmmIds != ''">
  301. AND id in (${rcmmIds})
  302. </if>
  303. <if test="isOffice != null and isOffice != ''">
  304. AND IS_OFFICE = #{isOffice}
  305. </if>
  306. <if test="isCvl != null and isCvl != ''">
  307. AND IS_CVL = #{isCvl}
  308. </if>
  309. </select>
  310. <select id="getRcmmListByTime" parameterType="cn.com.goldenwater.dcproj.param.TacExprRcmmParam"
  311. resultType="cn.com.goldenwater.dcproj.model.TacExprRcmm">
  312. SELECT r.* FROM TAC_EXPR_RCMM_RCRD t LEFT JOIN TAC_EXPR_RCMM r ON t.EXPR_RCMM_ID = r.id where r.id is not null
  313. and t.INTM = DATE_FORMAT( #{exprTm},'%Y-%m-%d %H:%i:%s')
  314. <if test="roleType != null and roleType != ''">
  315. AND r.ROLE_TYPE in (${roleType})
  316. </if>
  317. <if test="name != null and name != ''">
  318. AND r.name like '%${name}%'
  319. </if>
  320. </select>
  321. <update id="updateByExprTime" parameterType="cn.com.goldenwater.dcproj.dto.TacExprRcmmRcrdDto">
  322. update TAC_EXPR_RCMM set state = '1' where id in (select EXPR_RCMM_ID from TAC_EXPR_RCMM_RCRD where INTM = DATE_FORMAT( #{exprTm},'%Y-%m-%d %H:%i'))
  323. </update>
  324. <select id="countRcmmByTitles" parameterType="cn.com.goldenwater.dcproj.param.TacExprRcmmParam" resultType="cn.com.goldenwater.dcproj.dto.TacCountDto">
  325. select
  326. count(*) as count,t.titles as code,
  327. (case when t.titles = '1' then '正高'
  328. when t.titles = '2' then '副高'
  329. when t.titles = '3' then '中级'
  330. else '初级' end) as name
  331. from TAC_EXPR_RCMM t
  332. where
  333. t.titles is not null
  334. <if test="state != null and state != ''">
  335. and state in (${state})
  336. </if>
  337. <if test="sttm != null and sttm != '' and entm != null and entm != ''">
  338. AND INTM &gt;= STR_TO_DATE(#{sttm},'%Y-%m-%d') AND INTM &lt; STR_TO_DATE(#{entm},'%Y-%m-%d')
  339. </if>
  340. <if test="roleType != null and roleType != ''">
  341. AND ROLE_TYPE in (${roleType})
  342. </if>
  343. <if test="isOffice != null and isOffice != ''">
  344. AND IS_OFFICE = #{isOffice}
  345. </if>
  346. <if test="isCvl != null and isCvl != ''">
  347. AND IS_CVL = #{isCvl}
  348. </if>
  349. <if test="sex != null and sex != ''">
  350. and sex = #{sex}
  351. </if>
  352. <if test="education != null and education != ''">
  353. and education in (${education})
  354. </if>
  355. <if test="titles != null and titles != ''">
  356. and titles in (${titles})
  357. </if>
  358. <if test="unitRanks != null and unitRanks != ''">
  359. and UNIT_RANKS in ${unitRanks}
  360. </if>
  361. <if test="name != null and name != ''">
  362. and name like '%${name}%'
  363. </if>
  364. group by t.titles
  365. </select>
  366. <select id="countRcmmByRoleType" parameterType="cn.com.goldenwater.dcproj.param.TacExprRcmmParam" resultType="cn.com.goldenwater.dcproj.dto.TacCountDto">
  367. select count(*) as count,ROLE_TYPE as code,
  368. (
  369. CASE WHEN ROLE_TYPE = '20' THEN '专家组长'
  370. WHEN ROLE_TYPE = '19' THEN '助理'
  371. WHEN ROLE_TYPE = '11' THEN '前期专家'
  372. WHEN ROLE_TYPE = '12' THEN '建管专家'
  373. WHEN ROLE_TYPE = '13' THEN '计划专家'
  374. WHEN ROLE_TYPE = '14' THEN '财务专家'
  375. WHEN ROLE_TYPE = '15' THEN '质量专家'
  376. WHEN ROLE_TYPEE = '16' THEN '安全专家'
  377. WHEN ROLE_TYPE = '21' THEN '特派员'
  378. end
  379. ) as name from TAC_EXPR_RCMM t
  380. where ROLE_TYPE is not null
  381. <if test="state != null and state != ''">
  382. and state in (${state})
  383. </if>
  384. <if test="sttm != null and sttm != '' and entm != null and entm != ''">
  385. AND INTM &gt;= STR_TO_DATE(#{sttm},'%Y-%m-%d') AND INTM &lt; STR_TO_DATE(#{entm},'%Y-%m-%d')
  386. </if>
  387. <if test="roleType != null and roleType != ''">
  388. AND ROLE_TYPE in (${roleType})
  389. </if>
  390. <if test="isOffice != null and isOffice != ''">
  391. AND IS_OFFICE = #{isOffice}
  392. </if>
  393. <if test="isCvl != null and isCvl != ''">
  394. AND IS_CVL = #{isCvl}
  395. </if>
  396. <if test="sex != null and sex != ''">
  397. and sex = #{sex}
  398. </if>
  399. <if test="education != null and education != ''">
  400. and education in (${education})
  401. </if>
  402. <if test="titles != null and titles != ''">
  403. and titles in (${titles})
  404. </if>
  405. <if test="unitRanks != null and unitRanks != ''">
  406. and UNIT_RANKS in ${unitRanks}
  407. </if>
  408. <if test="name != null and name != ''">
  409. and name like '%${name}%'
  410. </if>
  411. group by ROLE_TYPE
  412. </select>
  413. <select id="countRcmmByEducation" parameterType="cn.com.goldenwater.dcproj.param.TacExprRcmmParam" resultType="cn.com.goldenwater.dcproj.dto.TacCountDto">
  414. select count(*) as count, EDUCATION as code,
  415. (
  416. CASE WHEN EDUCATION = '1' THEN '专科及以下'
  417. WHEN EDUCATION = '2' THEN '本科'
  418. WHEN EDUCATION = '3' THEN '研究生'
  419. WHEN EDUCATION = '4' THEN '博士'
  420. end
  421. ) NAME from TAC_EXPR_RCMM t
  422. where EDUCATION is not null
  423. <if test="state != null and state != ''">
  424. and state in (${state})
  425. </if>
  426. <if test="sttm != null and sttm != '' and entm != null and entm != ''">
  427. AND INTM &gt;= STR_TO_DATE(#{sttm},'%Y-%m-%d') AND INTM &lt; DATE_ADD(STR_TO_DATE(#{entm},'%Y-%m-%d'), INTERVAL 1 DAY)
  428. </if>
  429. <if test="roleType != null and roleType != ''">
  430. AND ROLE_TYPE in (${roleType})
  431. </if>
  432. <if test="isOffice != null and isOffice != ''">
  433. AND IS_OFFICE = #{isOffice}
  434. </if>
  435. <if test="isCvl != null and isCvl != ''">
  436. AND IS_CVL = #{isCvl}
  437. </if>
  438. <if test="sex != null and sex != ''">
  439. and sex = #{sex}
  440. </if>
  441. <if test="education != null and education != ''">
  442. and education in (${education})
  443. </if>
  444. <if test="titles != null and titles != ''">
  445. and titles in (${titles})
  446. </if>
  447. <if test="unitRanks != null and unitRanks != ''">
  448. and UNIT_RANKS in ${unitRanks}
  449. </if>
  450. <if test="name != null and name != ''">
  451. and name like '%${name}%'
  452. </if>
  453. group by EDUCATION
  454. </select>
  455. <select id="countRcmmByIsOffice" parameterType="cn.com.goldenwater.dcproj.param.TacExprRcmmParam" resultType="cn.com.goldenwater.dcproj.dto.TacCountDto">
  456. select count(*) as count, IS_OFFICE as code,
  457. (
  458. CASE WHEN IS_OFFICE = '1' THEN '在职'
  459. WHEN IS_OFFICE = '2' THEN '离职'
  460. end
  461. ) NAME from TAC_EXPR_RCMM t
  462. where IS_OFFICE is not null
  463. <if test="state != null and state != ''">
  464. and state in (${state})
  465. </if>
  466. <if test="sttm != null and sttm != '' and entm != null and entm != ''">
  467. AND INTM &gt;= STR_TO_DATE(#{sttm},'%Y-%m-%d') AND INTM &lt; STR_TO_DATE(#{entm},'%Y-%m-%d')
  468. </if>
  469. <if test="roleType != null and roleType != ''">
  470. AND ROLE_TYPE in (${roleType})
  471. </if>
  472. <if test="isOffice != null and isOffice != ''">
  473. AND IS_OFFICE = #{isOffice}
  474. </if>
  475. <if test="isCvl != null and isCvl != ''">
  476. AND IS_CVL = #{isCvl}
  477. </if>
  478. <if test="sex != null and sex != ''">
  479. and sex = #{sex}
  480. </if>
  481. <if test="education != null and education != ''">
  482. and education in (${education})
  483. </if>
  484. <if test="titles != null and titles != ''">
  485. and titles in (${titles})
  486. </if>
  487. <if test="unitRanks != null and unitRanks != ''">
  488. and UNIT_RANKS in ${unitRanks}
  489. </if>
  490. <if test="name != null and name != ''">
  491. and name like '%${name}%'
  492. </if>
  493. group by IS_OFFICE
  494. </select>
  495. </mapper>