TacExprRcmmDao.xml 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493
  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 <include refid="table_columns" /> from TAC_EXPR_RCMM where ID = #{id}
  152. </select>
  153. <select id="getBy" resultMap="tacExprRcmmResultMap">
  154. select <include refid="table_columns" /> from TAC_EXPR_RCMM <include refid="page_where" />
  155. </select>
  156. <select id="findAll" resultMap="tacExprRcmmResultMap">
  157. select <include refid="table_columns" /> from TAC_EXPR_RCMM
  158. </select>
  159. <select id="findList" resultMap="tacExprRcmmResultMap">
  160. select <include refid="table_columns" /> from TAC_EXPR_RCMM <include refid="page_where" />
  161. </select>
  162. <select id="selectCount" resultType="int" >
  163. select count(ID) from TAC_EXPR_RCMM <include refid="page_where" />
  164. </select>
  165. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.TacExprRcmm">
  166. insert into TAC_EXPR_RCMM( <include refid="table_columns" /> )
  167. values ( <include refid="entity_properties" /> )
  168. </insert>
  169. <delete id="delete" parameterType="java.lang.String">
  170. delete from TAC_EXPR_RCMM where ID = #{id}
  171. </delete>
  172. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.TacExprRcmm">
  173. delete from TAC_EXPR_RCMM <include refid="page_where" />
  174. </delete>
  175. <update id="deleteInFlag" parameterType="java.lang.String">
  176. update TAC_EXPR_RCMM set flag_valid = 0 where ID = #{id}
  177. </update>
  178. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.TacExprRcmm">
  179. update TAC_EXPR_RCMM
  180. <trim prefix="set" suffixOverrides=",">
  181. <if test="depCode != null and depCode != ''">DEP_CODE = #{depCode},</if>
  182. <if test="depNm != null and depNm != ''">DEP_NM = #{depNm},</if>
  183. <if test="name != null and name != ''">NAME = #{name},</if>
  184. <if test="sex != null and sex != ''">SEX = #{sex},</if>
  185. <if test="idNo != null and idNo != ''">ID_NO = #{idNo},</if>
  186. <if test="education != null and education != ''">EDUCATION = #{education},</if>
  187. <if test="roleType != null and roleType != ''">ROLE_TYPE = #{roleType},</if>
  188. <if test="groupType != null and groupType != ''">GROUP_TYPE = #{groupType},</if>
  189. <if test="isOffice != null and isOffice != ''">IS_OFFICE = #{isOffice},</if>
  190. <if test="isTraining != null and isTraining != ''">IS_TRAINING = #{isTraining},</if>
  191. <if test="workAd != null and workAd != ''">WORK_AD = #{workAd},</if>
  192. <if test="workAdNm != null and workAdNm != ''">WORK_AD_NM = #{workAdNm},</if>
  193. <if test="workDpNm != null and workDpNm != ''">WORK_DP_NM = #{workDpNm},</if>
  194. <if test="unitRanks != null and unitRanks != ''">UNIT_RANKS = #{unitRanks},</if>
  195. <if test="titles != null and titles != ''">TITLES = #{titles},</if>
  196. <if test="duty != null and duty != ''">DUTY = #{duty},</if>
  197. <if test="professional != null and professional != ''">PROFESSIONAL = #{professional},</if>
  198. <if test="isCvl != null and isCvl != ''">IS_CVL = #{isCvl},</if>
  199. <if test="orgCode != null and orgCode != ''">ORG_CODE = #{orgCode},</if>
  200. <if test="orgNm != null and orgNm != ''">ORG_NM = #{orgNm},</if>
  201. <if test="telnumb != null and telnumb != ''">TELNUMB = #{telnumb},</if>
  202. <if test="mobilenumb != null and mobilenumb != ''">MOBILENUMB = #{mobilenumb},</if>
  203. <if test="email != null and email != ''">EMAIL = #{email},</if>
  204. <if test="emgcCntct != null and emgcCntct != ''">EMGC_CNTCT = #{emgcCntct},</if>
  205. <if test="emgcCntctPhone != null and emgcCntctPhone != ''">EMGC_CNTCT_PHONE = #{emgcCntctPhone},</if>
  206. <if test="bankAccount != null and bankAccount != ''">BANK_ACCOUNT = #{bankAccount},</if>
  207. <if test="bankName != null and bankName != ''">BANK_NAME = #{bankName},</if>
  208. <if test="oe != null and oe != ''">OE = #{oe},</if>
  209. <if test="state != null and state != ''">STATE = #{state},</if>
  210. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  211. <if test="intm != null">INTM = #{intm},</if>
  212. <if test="uptm != null">UPTM = #{uptm},</if>
  213. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  214. </trim>
  215. <where>ID = #{id}</where>
  216. </update>
  217. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.TacExprRcmm">
  218. update TAC_EXPR_RCMM
  219. <trim prefix="set" suffixOverrides=",">
  220. <if test="depCode != null and depCode != ''">DEP_CODE = #{depCode},</if>
  221. <if test="depNm != null and depNm != ''">DEP_NM = #{depNm},</if>
  222. <if test="name != null and name != ''">NAME = #{name},</if>
  223. <if test="sex != null and sex != ''">SEX = #{sex},</if>
  224. <if test="idNo != null and idNo != ''">ID_NO = #{idNo},</if>
  225. <if test="education != null and education != ''">EDUCATION = #{education},</if>
  226. <if test="roleType != null and roleType != ''">ROLE_TYPE = #{roleType},</if>
  227. <if test="groupType != null and groupType != ''">GROUP_TYPE = #{groupType},</if>
  228. <if test="isOffice != null and isOffice != ''">IS_OFFICE = #{isOffice},</if>
  229. <if test="isTraining != null and isTraining != ''">IS_TRAINING = #{isTraining},</if>
  230. <if test="workAd != null and workAd != ''">WORK_AD = #{workAd},</if>
  231. <if test="workAdNm != null and workAdNm != ''">WORK_AD_NM = #{workAdNm},</if>
  232. <if test="workDpNm != null and workDpNm != ''">WORK_DP_NM = #{workDpNm},</if>
  233. <if test="unitRanks != null and unitRanks != ''">UNIT_RANKS = #{unitRanks},</if>
  234. <if test="titles != null and titles != ''">TITLES = #{titles},</if>
  235. <if test="duty != null and duty != ''">DUTY = #{duty},</if>
  236. <if test="professional != null and professional != ''">PROFESSIONAL = #{professional},</if>
  237. <if test="isCvl != null and isCvl != ''">IS_CVL = #{isCvl},</if>
  238. <if test="orgCode != null and orgCode != ''">ORG_CODE = #{orgCode},</if>
  239. <if test="orgNm != null and orgNm != ''">ORG_NM = #{orgNm},</if>
  240. <if test="telnumb != null and telnumb != ''">TELNUMB = #{telnumb},</if>
  241. <if test="mobilenumb != null and mobilenumb != ''">MOBILENUMB = #{mobilenumb},</if>
  242. <if test="email != null and email != ''">EMAIL = #{email},</if>
  243. <if test="emgcCntct != null and emgcCntct != ''">EMGC_CNTCT = #{emgcCntct},</if>
  244. <if test="emgcCntctPhone != null and emgcCntctPhone != ''">EMGC_CNTCT_PHONE = #{emgcCntctPhone},</if>
  245. <if test="bankAccount != null and bankAccount != ''">BANK_ACCOUNT = #{bankAccount},</if>
  246. <if test="bankName != null and bankName != ''">BANK_NAME = #{bankName},</if>
  247. <if test="oe != null and oe != ''">OE = #{oe},</if>
  248. <if test="state != null and state != ''">STATE = #{state},</if>
  249. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  250. <if test="intm != null">INTM = #{intm},</if>
  251. <if test="uptm != null">UPTM = #{uptm},</if>
  252. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  253. </trim>
  254. <include refid="page_where" />
  255. </update>
  256. <!-- 其他自定义SQL -->
  257. <select id="getRcmmList" resultMap="tacExprRcmmResultMap" parameterType="cn.com.goldenwater.dcproj.param.TacExprRcmmParam">
  258. select <include refid="table_columns" /> from TAC_EXPR_RCMM
  259. WHERE 1=1
  260. <if test="state != null and state != ''">
  261. and state in (${state})
  262. </if>
  263. <if test="workAd != null and workAd != ''">
  264. and work_ad in (${workAd})
  265. </if>
  266. <if test="province != null and province != ''">
  267. and work_ad like '%${province}%'
  268. </if>
  269. <if test="orgCode != null and orgCode != ''">
  270. and ORG_CODE in (${orgCode})
  271. </if>
  272. <if test="sttm != null and sttm != '' and entm != null and entm != ''">
  273. AND IN_TM &gt;= TO_DATE(#{sttm},'YYYY-MM-DD') AND IN_TM &lt; TO_DATE(#{entm},'YYYY-MM-DD')+1
  274. </if>
  275. <if test="roleType != null and roleType != ''">
  276. AND ROLE_TYPE in (${roleType})
  277. </if>
  278. <if test="rcmmIds != null and rcmmIds != ''">
  279. AND id in (${rcmmIds})
  280. </if>
  281. <if test="isOffice != null and isOffice != ''">
  282. AND IS_OFFICE = #{isOffice}
  283. </if>
  284. <if test="isCvl != null and isCvl != ''">
  285. AND IS_CVL = #{isCvl}
  286. </if>
  287. </select>
  288. <select id="getRcmmListByTime" parameterType="cn.com.goldenwater.dcproj.param.TacExprRcmmParam" resultType="cn.com.goldenwater.dcproj.model.TacExprRcmm">
  289. 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 and t.INTM = to_date( #{exprTm},'yyyy-MM-dd HH24:mi')
  290. <if test="roleType != null and roleType != ''">
  291. AND r.ROLE_TYPE in (${roleType})
  292. </if>
  293. <if test="name != null and name != ''">
  294. AND r.name like '%${name}%'
  295. </if>
  296. </select>
  297. <update id="updateByExprTime" parameterType="cn.com.goldenwater.dcproj.dto.TacExprRcmmRcrdDto">
  298. update TAC_EXPR_RCMM set state = '1' where id in (select EXPR_RCMM_ID from TAC_EXPR_RCMM_RCRD where INTM = to_date( #{exprTm},'yyyy-MM-dd HH24:mi'))
  299. </update>
  300. <select id="countRcmmByTitles" parameterType="cn.com.goldenwater.dcproj.param.TacExprRcmmParam" resultType="cn.com.goldenwater.dcproj.dto.TacCountDto">
  301. select count(*) as count,t.titles as code,
  302. (case when t.titles = '1' then '正高'
  303. when t.titles = '2' then '副高'
  304. when t.titles = '3' then '中级'
  305. else '初级' end) as name from TAC_EXPR_RCMM t
  306. where t.titles is not null
  307. <if test="state != null and state != ''">
  308. and state in (${state})
  309. </if>
  310. <if test="sttm != null and sttm != '' and entm != null and entm != ''">
  311. AND INTM &gt;= TO_DATE(#{sttm},'YYYY-MM-DD') AND INTM &lt; TO_DATE(#{entm},'YYYY-MM-DD')+1
  312. </if>
  313. <if test="roleType != null and roleType != ''">
  314. AND ROLE_TYPE in (${roleType})
  315. </if>
  316. <if test="isOffice != null and isOffice != ''">
  317. AND IS_OFFICE = #{isOffice}
  318. </if>
  319. <if test="isCvl != null and isCvl != ''">
  320. AND IS_CVL = #{isCvl}
  321. </if>
  322. <if test="sex != null and sex != ''">
  323. and sex = #{sex}
  324. </if>
  325. <if test="education != null and education != ''">
  326. and education in (${education})
  327. </if>
  328. <if test="titles != null and titles != ''">
  329. and titles in (${titles})
  330. </if>
  331. <if test="unitRanks != null and unitRanks != ''">
  332. and UNIT_RANKS in ${unitRanks}
  333. </if>
  334. <if test="name != null and name != ''">
  335. and name like '%${name}%'
  336. </if>
  337. group by t.titles
  338. </select>
  339. <select id="countRcmmByRoleType" parameterType="cn.com.goldenwater.dcproj.param.TacExprRcmmParam" resultType="cn.com.goldenwater.dcproj.dto.TacCountDto">
  340. select count(*) as count,ROLE_TYPE as code,
  341. (
  342. CASE WHEN ROLE_TYPE = '20' THEN '专家组长'
  343. WHEN ROLE_TYPE = '19' THEN '助理'
  344. WHEN ROLE_TYPE = '11' THEN '前期专家'
  345. WHEN ROLE_TYPE = '12' THEN '建管专家'
  346. WHEN ROLE_TYPE = '13' THEN '计划专家'
  347. WHEN ROLE_TYPE = '14' THEN '财务专家'
  348. WHEN ROLE_TYPE = '15' THEN '质量专家'
  349. WHEN ROLE_TYPEE = '16' THEN '安全专家'
  350. WHEN ROLE_TYPE = '21' THEN '特派员'
  351. end
  352. ) as name from TAC_EXPR_RCMM t
  353. where ROLE_TYPE is not null
  354. <if test="state != null and state != ''">
  355. and state in (${state})
  356. </if>
  357. <if test="sttm != null and sttm != '' and entm != null and entm != ''">
  358. AND INTM &gt;= TO_DATE(#{sttm},'YYYY-MM-DD') AND INTM &lt; TO_DATE(#{entm},'YYYY-MM-DD')+1
  359. </if>
  360. <if test="roleType != null and roleType != ''">
  361. AND ROLE_TYPE in (${roleType})
  362. </if>
  363. <if test="isOffice != null and isOffice != ''">
  364. AND IS_OFFICE = #{isOffice}
  365. </if>
  366. <if test="isCvl != null and isCvl != ''">
  367. AND IS_CVL = #{isCvl}
  368. </if>
  369. <if test="sex != null and sex != ''">
  370. and sex = #{sex}
  371. </if>
  372. <if test="education != null and education != ''">
  373. and education in (${education})
  374. </if>
  375. <if test="titles != null and titles != ''">
  376. and titles in (${titles})
  377. </if>
  378. <if test="unitRanks != null and unitRanks != ''">
  379. and UNIT_RANKS in ${unitRanks}
  380. </if>
  381. <if test="name != null and name != ''">
  382. and name like '%${name}%'
  383. </if>
  384. group by ROLE_TYPE
  385. </select>
  386. <select id="countRcmmByEducation" parameterType="cn.com.goldenwater.dcproj.param.TacExprRcmmParam" resultType="cn.com.goldenwater.dcproj.dto.TacCountDto">
  387. select count(*) as count, EDUCATION as code,
  388. (
  389. CASE WHEN EDUCATION = '1' THEN '专科及以下'
  390. WHEN EDUCATION = '2' THEN '本科'
  391. WHEN EDUCATION = '3' THEN '研究生'
  392. WHEN EDUCATION = '4' THEN '博士'
  393. end
  394. ) NAME from TAC_EXPR_RCMM t
  395. where EDUCATION is not null
  396. <if test="state != null and state != ''">
  397. and state in (${state})
  398. </if>
  399. <if test="sttm != null and sttm != '' and entm != null and entm != ''">
  400. AND INTM &gt;= TO_DATE(#{sttm},'YYYY-MM-DD') AND INTM &lt; TO_DATE(#{entm},'YYYY-MM-DD')+1
  401. </if>
  402. <if test="roleType != null and roleType != ''">
  403. AND ROLE_TYPE in (${roleType})
  404. </if>
  405. <if test="isOffice != null and isOffice != ''">
  406. AND IS_OFFICE = #{isOffice}
  407. </if>
  408. <if test="isCvl != null and isCvl != ''">
  409. AND IS_CVL = #{isCvl}
  410. </if>
  411. <if test="sex != null and sex != ''">
  412. and sex = #{sex}
  413. </if>
  414. <if test="education != null and education != ''">
  415. and education in (${education})
  416. </if>
  417. <if test="titles != null and titles != ''">
  418. and titles in (${titles})
  419. </if>
  420. <if test="unitRanks != null and unitRanks != ''">
  421. and UNIT_RANKS in ${unitRanks}
  422. </if>
  423. <if test="name != null and name != ''">
  424. and name like '%${name}%'
  425. </if>
  426. group by EDUCATION
  427. </select>
  428. <select id="countRcmmByIsOffice" parameterType="cn.com.goldenwater.dcproj.param.TacExprRcmmParam" resultType="cn.com.goldenwater.dcproj.dto.TacCountDto">
  429. select count(*) as count, IS_OFFICE as code,
  430. (
  431. CASE WHEN IS_OFFICE = '1' THEN '在职'
  432. WHEN IS_OFFICE = '2' THEN '离职'
  433. end
  434. ) NAME from TAC_EXPR_RCMM t
  435. where IS_OFFICE is not null
  436. <if test="state != null and state != ''">
  437. and state in (${state})
  438. </if>
  439. <if test="sttm != null and sttm != '' and entm != null and entm != ''">
  440. AND INTM &gt;= TO_DATE(#{sttm},'YYYY-MM-DD') AND INTM &lt; TO_DATE(#{entm},'YYYY-MM-DD')+1
  441. </if>
  442. <if test="roleType != null and roleType != ''">
  443. AND ROLE_TYPE in (${roleType})
  444. </if>
  445. <if test="isOffice != null and isOffice != ''">
  446. AND IS_OFFICE = #{isOffice}
  447. </if>
  448. <if test="isCvl != null and isCvl != ''">
  449. AND IS_CVL = #{isCvl}
  450. </if>
  451. <if test="sex != null and sex != ''">
  452. and sex = #{sex}
  453. </if>
  454. <if test="education != null and education != ''">
  455. and education in (${education})
  456. </if>
  457. <if test="titles != null and titles != ''">
  458. and titles in (${titles})
  459. </if>
  460. <if test="unitRanks != null and unitRanks != ''">
  461. and UNIT_RANKS in ${unitRanks}
  462. </if>
  463. <if test="name != null and name != ''">
  464. and name like '%${name}%'
  465. </if>
  466. group by IS_OFFICE
  467. </select>
  468. </mapper>