| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="cn.com.goldenwater.dcproj.dao.TacWorkerBDao">
- <resultMap type="cn.com.goldenwater.dcproj.model.TacWorkerB" id="tacWorkerBResultMap">
- <result property="id" column="ID"/>
- <result property="loginId" column="LOGIN_ID"/>
- <result property="name" column="NAME"/>
- <result property="sex" column="SEX"/>
- <result property="age" column="AGE"/>
- <result property="birthdate" column="BIRTHDATE"/>
- <result property="idNo" column="ID_NO"/>
- <result property="telnumb" column="TELNUMB"/>
- <result property="mobilenumb" column="MOBILENUMB"/>
- <result property="email" column="EMAIL"/>
- <result property="roleType" column="ROLE_TYPE"/>
- <result property="groupType" column="GROUP_TYPE"/>
- <result property="education" column="EDUCATION"/>
- <result property="isOffice" column="IS_OFFICE"/>
- <result property="isTraining" column="IS_TRAINING"/>
- <result property="recommendedUnits" column="RECOMMENDED_UNITS"/>
- <result property="workAd" column="WORK_AD"/>
- <result property="workAdNm" column="WORK_AD_NM"/>
- <result property="workDpNm" column="WORK_DP_NM"/>
- <result property="workTrendAd" column="WORK_TREND_AD"/>
- <result property="workTrendNm" column="WORK_TREND_NM"/>
- <result property="unitRanks" column="UNIT_RANKS"/>
- <result property="titles" column="TITLES"/>
- <result property="duty" column="DUTY"/>
- <result property="professional" column="PROFESSIONAL"/>
- <result property="orgCode" column="ORG_CODE"/>
- <result property="orgNm" column="ORG_NM"/>
- <result property="emgcCntct" column="EMGC_CNTCT"/>
- <result property="emgcCntctPhone" column="EMGC_CNTCT_PHONE"/>
- <result property="bankAccount" column="BANK_ACCOUNT"/>
- <result property="bankName" column="BANK_NAME"/>
- <result property="oe" column="OE"/>
- <result property="resume" column="RESUME"/>
- <result property="isA" column="IS_A"/>
- <result property="isB" column="IS_B"/>
- <result property="isC" column="IS_C"/>
- <result property="isD" column="IS_D"/>
- <result property="isE" column="IS_E"/>
- <result property="isNew" column="IS_NEW"/>
- <result property="persId" column="PERS_ID"/>
- <result property="inTm" column="IN_TM"/>
- <result property="upTm" column="UP_TM"/>
- <result property="dataStat" column="DATA_STAT"/>
- <result property="province" column="PROVINCE"/>
- <result property="isExternal" column="IS_EXTERNAL"/>
- </resultMap>
- <sql id="table_columns">
- ID,
- LOGIN_ID,
- NAME,
- SEX,
- AGE,
- BIRTHDATE,
- ID_NO,
- TELNUMB,
- MOBILENUMB,
- EMAIL,
- ROLE_TYPE,
- GROUP_TYPE,
- EDUCATION,
- IS_OFFICE,
- IS_TRAINING,
- RECOMMENDED_UNITS,
- WORK_AD,
- WORK_AD_NM,
- WORK_DP_NM,
- WORK_TREND_AD,
- WORK_TREND_NM,
- UNIT_RANKS,
- TITLES,
- DUTY,
- PROFESSIONAL,
- ORG_CODE,
- ORG_NM,
- EMGC_CNTCT,
- EMGC_CNTCT_PHONE,
- BANK_ACCOUNT,
- BANK_NAME,
- OE,
- RESUME,
- IS_A,
- IS_B,
- IS_C,
- IS_D,
- IS_E,
- IS_NEW,
- PERS_ID,
- IN_TM,
- UP_TM,
- DATA_STAT,PROVINCE,IS_EXTERNAL
- </sql>
- <sql id="entity_properties">
- #{id},
- #{loginId},
- #{name},
- #{sex},
- #{age},
- #{birthdate},
- #{idNo},
- #{telnumb},
- #{mobilenumb},
- #{email},
- #{roleType},
- #{groupType},
- #{education},
- #{isOffice},
- #{isTraining},
- #{recommendedUnits},
- #{workAd},
- #{workAdNm},
- #{workDpNm},
- #{workTrendAd},
- #{workTrendNm},
- #{unitRanks},
- #{titles},
- #{duty},
- #{professional},
- #{orgCode},
- #{orgNm},
- #{emgcCntct},
- #{emgcCntctPhone},
- #{bankAccount},
- #{bankName},
- #{oe},
- #{resume},
- #{isA},
- #{isB},
- #{isC},
- #{isD},
- #{isE},
- #{isNew},
- #{persId},
- #{inTm},
- #{upTm},
- #{dataStat},#{province},#{isExternal}
- </sql>
- <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
- <sql id="page_where">
- <trim prefix="where" prefixOverrides="and | or ">
- <if test="loginId != null and loginId != ''">and LOGIN_ID = #{loginId}</if>
- <if test="name != null and name != ''">and NAME like '%${name}%'</if>
- <if test="sex != null and sex != ''">and SEX = #{sex}</if>
- <if test="age != null and age != ''">and AGE = #{age}</if>
- <if test="birthdate != null">and BIRTHDATE = #{birthdate}</if>
- <if test="idNo != null and idNo != ''">and ID_NO = #{idNo}</if>
- <if test="telnumb != null and telnumb != ''">and TELNUMB = #{telnumb}</if>
- <if test="mobilenumb != null and mobilenumb != ''">and MOBILENUMB = #{mobilenumb}</if>
- <if test="email != null and email != ''">and EMAIL = #{email}</if>
- <if test="roleType != null and roleType != ''">and ROLE_TYPE = #{roleType}</if>
- <if test="groupType != null and groupType != ''">and GROUP_TYPE = #{groupType}</if>
- <if test="education != null and education != ''">and EDUCATION = #{education}</if>
- <if test="isOffice != null and isOffice != ''">and IS_OFFICE = #{isOffice}</if>
- <if test="isTraining != null and isTraining != ''">and IS_TRAINING = #{isTraining}</if>
- <if test="recommendedUnits != null and recommendedUnits != ''">and RECOMMENDED_UNITS = #{recommendedUnits}</if>
- <if test="workAd != null and workAd != ''">and WORK_AD = #{workAd}</if>
- <if test="workAdNm != null and workAdNm != ''">and WORK_AD_NM = #{workAdNm}</if>
- <if test="workDpNm != null and workDpNm != ''">and WORK_DP_NM = #{workDpNm}</if>
- <if test="workTrendAd != null and workTrendAd != ''">and WORK_TREND_AD = #{workTrendAd}</if>
- <if test="workTrendNm != null and workTrendNm != ''">and WORK_TREND_NM = #{workTrendNm}</if>
- <if test="unitRanks != null and unitRanks != ''">and UNIT_RANKS = #{unitRanks}</if>
- <if test="titles != null and titles != ''">and TITLES = #{titles}</if>
- <if test="duty != null and duty != ''">and DUTY = #{duty}</if>
- <if test="professional != null and professional != ''">and PROFESSIONAL = #{professional}</if>
- <if test="orgCode != null and orgCode != ''">and ORG_CODE = #{orgCode}</if>
- <if test="orgNm != null and orgNm != ''">and ORG_NM = #{orgNm}</if>
- <if test="emgcCntct != null and emgcCntct != ''">and EMGC_CNTCT = #{emgcCntct}</if>
- <if test="emgcCntctPhone != null and emgcCntctPhone != ''">and EMGC_CNTCT_PHONE = #{emgcCntctPhone}</if>
- <if test="bankAccount != null and bankAccount != ''">and BANK_ACCOUNT = #{bankAccount}</if>
- <if test="bankName != null and bankName != ''">and BANK_NAME = #{bankName}</if>
- <if test="oe != null and oe != ''">and OE = #{oe}</if>
- <if test="resume != null and resume != ''">and RESUME = #{resume}</if>
- <if test="isA != null and isA != ''">and IS_A = #{isA}</if>
- <if test="isB != null and isB != ''">and IS_B = #{isB}</if>
- <if test="isC != null and isC != ''">and IS_C = #{isC}</if>
- <if test="isD != null and isD != ''">and IS_D = #{isD}</if>
- <if test="isE != null and isE != ''">and IS_E = #{isE}</if>
- <if test="isNew != null and isNew != ''">and IS_NEW = #{isNew}</if>
- <if test="persId != null and persId != ''">and PERS_ID = #{persId}</if>
- <if test="inTm != null">and IN_TM = #{inTm}</if>
- <if test="upTm != null">and UP_TM = #{upTm}</if>
- <if test="dataStat != null and dataStat != ''">and DATA_STAT = #{dataStat}</if>
- <if test="isExternal != null and isExternal != ''">and IS_EXTERNAL = #{isExternal}</if>
- <include refid="choseSql"/>
- </trim>
- </sql>
- <sql id="choseSql">
- <choose>
- <when test="province !=null and province !=''">
- and t.PROVINCE = #{province}
- </when>
- <otherwise>
- and t.PROVINCE is null
- </otherwise>
- </choose>
- </sql>
- <select id="get" resultMap="tacWorkerBResultMap" parameterType="String" >
- select <include refid="table_columns" /> from TAC_WORKER_B where ID = #{id}
- </select>
- <select id="getBy" resultMap="tacWorkerBResultMap">
- select <include refid="table_columns" /> from TAC_WORKER_B t <include refid="page_where" />
- </select>
- <select id="findAll" resultMap="tacWorkerBResultMap">
- select <include refid="table_columns" /> from TAC_WORKER_B
- </select>
- <select id="findList" resultMap="tacWorkerBResultMap">
- select <include refid="table_columns" /> from TAC_WORKER_B t <include refid="page_where" />
- </select>
- <select id="selectCount" resultType="int" >
- select count(ID) from TAC_WORKER_B t <include refid="page_where" />
- </select>
- <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.TacWorkerB">
- insert into TAC_WORKER_B( <include refid="table_columns" /> )
- values ( <include refid="entity_properties" /> )
- </insert>
- <select id="findBlankList" parameterType="String" resultMap="tacWorkerBResultMap">
- select * from tac_worker_b o where o.login_id is null
- <choose>
- <when test="province !=null and province !=''">
- and o.province=#{province}
- </when>
- <otherwise>
- and o.province is null
- </otherwise>
- </choose>
- </select>
- <select id="findPerInZLOrTPY" resultMap="tacWorkerBResultMap">
- select * from tac_worker_b o where (o.role_type like '%19%' or o.role_type like '%20%') and o.login_id=#{loginId}
- </select>
- <delete id="delete" parameterType="java.lang.String">
- delete from TAC_WORKER_B where ID = #{id}
- </delete>
- <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.TacWorkerB">
- delete from TAC_WORKER_B <include refid="page_where" />
- </delete>
- <update id="deleteInFlag" parameterType="java.lang.String">
- update TAC_WORKER_B set flag_valid = 0 where ID = #{id}
- </update>
- <update id="update" parameterType="cn.com.goldenwater.dcproj.model.TacWorkerB">
- update TAC_WORKER_B
- <trim prefix="set" suffixOverrides=",">
- <if test="loginId != null and loginId != ''">LOGIN_ID = #{loginId},</if>
- <if test="name != null and name != ''">NAME = #{name},</if>
- <if test="sex != null and sex != ''">SEX = #{sex},</if>
- <if test="age != null and age != ''">AGE = #{age},</if>
- <if test="birthdate != null">BIRTHDATE = #{birthdate},</if>
- <if test="idNo != null and idNo != ''">ID_NO = #{idNo},</if>
- <if test="telnumb != null and telnumb != ''">TELNUMB = #{telnumb},</if>
- <if test="mobilenumb != null and mobilenumb != ''">MOBILENUMB = #{mobilenumb},</if>
- <if test="email != null and email != ''">EMAIL = #{email},</if>
- <if test="roleType != null and roleType != ''">ROLE_TYPE = #{roleType},</if>
- <if test="groupType != null and groupType != ''">GROUP_TYPE = #{groupType},</if>
- <if test="education != null and education != ''">EDUCATION = #{education},</if>
- <if test="isOffice != null and isOffice != ''">IS_OFFICE = #{isOffice},</if>
- <if test="isTraining != null and isTraining != ''">IS_TRAINING = #{isTraining},</if>
- <if test="recommendedUnits != null and recommendedUnits != ''">RECOMMENDED_UNITS = #{recommendedUnits},</if>
- <if test="workAd != null and workAd != ''">WORK_AD = #{workAd},</if>
- <if test="workAdNm != null and workAdNm != ''">WORK_AD_NM = #{workAdNm},</if>
- <if test="workDpNm != null and workDpNm != ''">WORK_DP_NM = #{workDpNm},</if>
- <if test="workTrendAd != null and workTrendAd != ''">WORK_TREND_AD = #{workTrendAd},</if>
- <if test="workTrendNm != null and workTrendNm != ''">WORK_TREND_NM = #{workTrendNm},</if>
- <if test="unitRanks != null and unitRanks != ''">UNIT_RANKS = #{unitRanks},</if>
- <if test="titles != null and titles != ''">TITLES = #{titles},</if>
- <if test="duty != null and duty != ''">DUTY = #{duty},</if>
- <if test="professional != null and professional != ''">PROFESSIONAL = #{professional},</if>
- <if test="orgCode != null and orgCode != ''">ORG_CODE = #{orgCode},</if>
- <if test="orgNm != null and orgNm != ''">ORG_NM = #{orgNm},</if>
- <if test="emgcCntct != null and emgcCntct != ''">EMGC_CNTCT = #{emgcCntct},</if>
- <if test="emgcCntctPhone != null and emgcCntctPhone != ''">EMGC_CNTCT_PHONE = #{emgcCntctPhone},</if>
- <if test="bankAccount != null and bankAccount != ''">BANK_ACCOUNT = #{bankAccount},</if>
- <if test="bankName != null and bankName != ''">BANK_NAME = #{bankName},</if>
- <if test="oe != null and oe != ''">OE = #{oe},</if>
- <if test="resume != null and resume != ''">RESUME = #{resume},</if>
- <if test="isA != null and isA != ''">IS_A = #{isA},</if>
- <if test="isB != null and isB != ''">IS_B = #{isB},</if>
- <if test="isC != null and isC != ''">IS_C = #{isC},</if>
- <if test="isD != null and isD != ''">IS_D = #{isD},</if>
- <if test="isE != null and isE != ''">IS_E = #{isE},</if>
- <if test="isNew != null and isNew != ''">IS_NEW = #{isNew},</if>
- <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
- <if test="inTm != null">IN_TM = #{inTm},</if>
- <if test="upTm != null">UP_TM = #{upTm},</if>
- <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
- <if test="province != null and province != ''">PROVINCE = #{province},</if>
- <if test="isExternal != null and isExternal != ''">IS_EXTERNAL = #{isExternal},</if>
- </trim>
- <where>ID = #{id}</where>
- </update>
- <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.TacWorkerB">
- update TAC_WORKER_B
- <trim prefix="set" suffixOverrides=",">
- <if test="loginId != null and loginId != ''">LOGIN_ID = #{loginId},</if>
- <if test="name != null and name != ''">NAME = #{name},</if>
- <if test="sex != null and sex != ''">SEX = #{sex},</if>
- <if test="age != null and age != ''">AGE = #{age},</if>
- <if test="birthdate != null">BIRTHDATE = #{birthdate},</if>
- <if test="idNo != null and idNo != ''">ID_NO = #{idNo},</if>
- <if test="telnumb != null and telnumb != ''">TELNUMB = #{telnumb},</if>
- <if test="mobilenumb != null and mobilenumb != ''">MOBILENUMB = #{mobilenumb},</if>
- <if test="email != null and email != ''">EMAIL = #{email},</if>
- <if test="roleType != null and roleType != ''">ROLE_TYPE = #{roleType},</if>
- <if test="groupType != null and groupType != ''">GROUP_TYPE = #{groupType},</if>
- <if test="education != null and education != ''">EDUCATION = #{education},</if>
- <if test="isOffice != null and isOffice != ''">IS_OFFICE = #{isOffice},</if>
- <if test="isTraining != null and isTraining != ''">IS_TRAINING = #{isTraining},</if>
- <if test="recommendedUnits != null and recommendedUnits != ''">RECOMMENDED_UNITS = #{recommendedUnits},</if>
- <if test="workAd != null and workAd != ''">WORK_AD = #{workAd},</if>
- <if test="workAdNm != null and workAdNm != ''">WORK_AD_NM = #{workAdNm},</if>
- <if test="workDpNm != null and workDpNm != ''">WORK_DP_NM = #{workDpNm},</if>
- <if test="workTrendAd != null and workTrendAd != ''">WORK_TREND_AD = #{workTrendAd},</if>
- <if test="workTrendNm != null and workTrendNm != ''">WORK_TREND_NM = #{workTrendNm},</if>
- <if test="unitRanks != null and unitRanks != ''">UNIT_RANKS = #{unitRanks},</if>
- <if test="titles != null and titles != ''">TITLES = #{titles},</if>
- <if test="duty != null and duty != ''">DUTY = #{duty},</if>
- <if test="professional != null and professional != ''">PROFESSIONAL = #{professional},</if>
- <if test="orgCode != null and orgCode != ''">ORG_CODE = #{orgCode},</if>
- <if test="orgNm != null and orgNm != ''">ORG_NM = #{orgNm},</if>
- <if test="emgcCntct != null and emgcCntct != ''">EMGC_CNTCT = #{emgcCntct},</if>
- <if test="emgcCntctPhone != null and emgcCntctPhone != ''">EMGC_CNTCT_PHONE = #{emgcCntctPhone},</if>
- <if test="bankAccount != null and bankAccount != ''">BANK_ACCOUNT = #{bankAccount},</if>
- <if test="bankName != null and bankName != ''">BANK_NAME = #{bankName},</if>
- <if test="oe != null and oe != ''">OE = #{oe},</if>
- <if test="resume != null and resume != ''">RESUME = #{resume},</if>
- <if test="isA != null and isA != ''">IS_A = #{isA},</if>
- <if test="isB != null and isB != ''">IS_B = #{isB},</if>
- <if test="isC != null and isC != ''">IS_C = #{isC},</if>
- <if test="isD != null and isD != ''">IS_D = #{isD},</if>
- <if test="isE != null and isE != ''">IS_E = #{isE},</if>
- <if test="isNew != null and isNew != ''">IS_NEW = #{isNew},</if>
- <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
- <if test="inTm != null">IN_TM = #{inTm},</if>
- <if test="upTm != null">UP_TM = #{upTm},</if>
- <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
- <if test="province != null and province != ''">PROVINCE = #{province},</if>
- <if test="isExternal != null and isExternal != ''">IS_EXTERNAL = #{isExternal},</if>
- </trim>
- <include refid="page_where" />
- </update>
- <!-- 其他自定义SQL -->
- <select id="countByAdCode" parameterType="cn.com.goldenwater.dcproj.param.TacWorkerBParam" resultType="cn.com.goldenwater.dcproj.dto.TacCountDto">
- select count(*) count, WORK_AD code,WORK_AD_NM name from TAC_WORKER_B t
- where 1 = 1
- <include refid="choseSql"/>
- <if test="name != null and name != ''">
- AND NAME like '${name}%'
- </if>
- <if test="isOffice != null and isOffice != ''">
- AND IS_OFFICE = #{isOffice}
- </if>
- <if test="isExternal != null and isExternal != ''">
- AND IS_EXTERNAL = #{isExternal}
- </if>
- <if test="isTraining != null and isTraining != ''">
- AND IS_TRAINING = #{isTraining}
- </if>
- <if test="sttm != null and sttm != '' and entm != null and entm != ''">
- AND (IN_TM >to_date(#{sttm},'yyyy-MM-dd') and in_tm < to_date(#{entm}, 'yyyy-MM-dd')+1)
- </if>
- <if test="groupType != null and groupType != ''">
- AND GROUP_TYPE in (${groupType})
- </if>
- <if test="roleType != null and roleType != ''">
- AND t.id in (select workerId from tac_worker_type where value in (${roleType}))
- </if>
- <if test="workAd!= null and workAd != ''">
- AND WORK_AD in (${workAd})
- </if>
- <if test="orgCode != null and orgCode != ''">
- AND ORG_CODE in (${orgCode})
- </if>
- <if test="education != null and education != ''">
- AND EDUCATION in (${education})
- </if>
- <if test="titles != null and titles != ''">
- AND TITLES in (${titles})
- </if>
- <if test="unitRanks != null and unitRanks != ''">
- AND UNIT_RANKS in (${unitRanks})
- </if>
- <if test="ageLimits != null and ageLimits != ''">
- ${ageLimits}
- </if>
- <if test="isAll != null and isAll != ''">
- ${isAll}
- </if>
- group by WORK_AD,WORK_AD_NM
- </select>
- <select id="countByTitles" parameterType="cn.com.goldenwater.dcproj.param.TacWorkerBParam" resultType="cn.com.goldenwater.dcproj.dto.TacCountDto">
- select count(*) count, TITLES CODE,
- (
- CASE WHEN TITLES = '1' THEN '正高'
- WHEN TITLES = '2' THEN '副高'
- WHEN TITLES = '3' THEN '中级'
- WHEN TITLES = '4' THEN '初级'
- end
- ) NAME FROM TAC_WORKER_B t
- where 1 = 1
- <include refid="choseSql"/>
- <if test="name != null and name != ''">
- AND NAME like '${name}%'
- </if>
- <if test="isOffice != null and isOffice != ''">
- AND IS_OFFICE = #{isOffice}
- </if>
- <if test="isExternal != null and isExternal != ''">
- AND IS_EXTERNAL = #{isExternal}
- </if>
- <if test="isTraining != null and isTraining != ''">
- AND IS_TRAINING = #{isTraining}
- </if>
- <if test="sttm != null and sttm != '' and entm != null and entm != ''">
- AND (IN_TM >to_date(#{sttm},'yyyy-MM-dd') and in_tm < to_date(#{entm}, 'yyyy-MM-dd')+1)
- </if>
- <if test="groupType != null and groupType != ''">
- AND GROUP_TYPE in (${groupType})
- </if>
- <if test="roleType != null and roleType != ''">
- AND t.id in (select workerId from tac_worker_type where value in (${roleType}))
- </if>
- <if test="workAd!= null and workAd != ''">
- AND WORK_AD in (${workAd})
- </if>
- <if test="orgCode != null and orgCode != ''">
- AND ORG_CODE in (${orgCode})
- </if>
- <if test="education != null and education != ''">
- AND EDUCATION in (${education})
- </if>
- <if test="titles != null and titles != ''">
- AND TITLES in (${titles})
- </if>
- <if test="unitRanks != null and unitRanks != ''">
- AND UNIT_RANKS in (${unitRanks})
- </if>
- <if test="ageLimits != null and ageLimits != ''">
- ${ageLimits}
- </if>
- <if test="isAll != null and isAll != ''">
- ${isAll}
- </if>
- GROUP BY TITLES
- </select>
- <select id="countByRole" parameterType="cn.com.goldenwater.dcproj.param.TacWorkerBParam" resultType="cn.com.goldenwater.dcproj.dto.TacCountDto">
- select count(*) count, p.VALUE CODE,
- (
- CASE WHEN p.VALUE = '20' THEN '专家组长'
- WHEN p.VALUE = '19' THEN '助理'
- WHEN p.VALUE = '11' THEN '前期专家'
- WHEN p.VALUE = '12' THEN '建管专家'
- WHEN p.VALUE = '13' THEN '计划专家'
- WHEN p.VALUE = '14' THEN '财务专家'
- WHEN p.VALUE = '15' THEN '质量专家'
- WHEN p.VALUE = '16' THEN '安全专家'
- WHEN p.VALUE = '21' THEN '特派员'
- end
- ) NAME FROM TAC_WORKER_B t left join (select * from tac_worker_type where type = '1') p on t.id = p.workerId
- where 1 = 1 and p.id is not null
- <include refid="choseSql"/>
- <if test="yearBatchId != null and yearBatchId != ''">
- and t.Id not in (
- select t.pers_id from TAC_INSP_YEAR_BATCH_GROUP_PERS t where t.year_batch_id = #{yearBatchId}
- )
- </if>
- <if test="name != null and name != ''">
- AND t.NAME like '${name}%'
- </if>
- <if test="isOffice != null and isOffice != ''">
- AND t.IS_OFFICE = #{isOffice}
- </if>
- <if test="isExternal != null and isExternal != ''">
- AND t.IS_EXTERNAL = #{isExternal}
- </if>
- <if test="isTraining != null and isTraining != ''">
- AND t.IS_TRAINING = #{isTraining}
- </if>
- <if test="sttm != null and sttm != '' and entm != null and entm != ''">
- AND (t.IN_TM >to_date(#{sttm},'yyyy-MM-dd') and t.in_tm < to_date(#{entm}, 'yyyy-MM-dd')+1)
- </if>
- <if test="groupType != null and groupType != ''">
- AND t.GROUP_TYPE in (${groupType})
- </if>
- <if test="roleType != null and roleType != ''">
- AND p.VALUE in (${roleType})
- </if>
- <if test="workAd!= null and workAd != ''">
- AND t.WORK_AD in (${workAd})
- </if>
- <if test="orgCode != null and orgCode != ''">
- AND t.ORG_CODE in (${orgCode})
- </if>
- <if test="education != null and education != ''">
- AND t.EDUCATION in (${education})
- </if>
- <if test="titles != null and titles != ''">
- AND t.TITLES in (${titles})
- </if>
- <if test="unitRanks != null and unitRanks != ''">
- AND t.UNIT_RANKS in (${unitRanks})
- </if>
- <if test="ageLimits != null and ageLimits != ''">
- ${ageLimits}
- </if>
- <if test="isAll != null and isAll != ''">
- ${isAll}
- </if>
- GROUP BY p.VALUE
- </select>
- <select id="countByEdu" parameterType="cn.com.goldenwater.dcproj.param.TacWorkerBParam" resultType="cn.com.goldenwater.dcproj.dto.TacCountDto">
- select count(*) count, EDUCATION CODE,
- (
- CASE WHEN EDUCATION = '1' THEN '专科及以下'
- WHEN EDUCATION = '2' THEN '本科'
- WHEN EDUCATION = '3' THEN '研究生'
- WHEN EDUCATION = '4' THEN '博士'
- end
- ) NAME FROM TAC_WORKER_B t
- where 1 = 1
- <include refid="choseSql"/>
- <if test="name != null and name != ''">
- AND NAME like '${name}%'
- </if>
- <if test="isOffice != null and isOffice != ''">
- AND IS_OFFICE = #{isOffice}
- </if>
- <if test="isExternal != null and isExternal != ''">
- AND IS_EXTERNAL = #{isExternal}
- </if>
- <if test="isTraining != null and isTraining != ''">
- AND IS_TRAINING = #{isTraining}
- </if>
- <if test="sttm != null and sttm != '' and entm != null and entm != ''">
- AND (IN_TM >to_date(#{sttm},'yyyy-MM-dd') and in_tm < to_date(#{entm}, 'yyyy-MM-dd')+1)
- </if>
- <if test="groupType != null and groupType != ''">
- AND GROUP_TYPE in (${groupType})
- </if>
- <if test="roleType != null and roleType != ''">
- AND t.id in (select workerId from tac_worker_type where value in (${roleType}))
- </if>
- <if test="workAd!= null and workAd != ''">
- AND WORK_AD in (${workAd})
- </if>
- <if test="orgCode != null and orgCode != ''">
- AND ORG_CODE in (${orgCode})
- </if>
- <if test="education != null and education != ''">
- AND EDUCATION in (${education})
- </if>
- <if test="titles != null and titles != ''">
- AND TITLES in (${titles})
- </if>
- <if test="unitRanks != null and unitRanks != ''">
- AND UNIT_RANKS in (${unitRanks})
- </if>
- <if test="ageLimits != null and ageLimits != ''">
- ${ageLimits}
- </if>
- <if test="isAll != null and isAll != ''">
- ${isAll}
- </if>
- GROUP BY EDUCATION
- </select>
- <select id="countByAge" parameterType="cn.com.goldenwater.dcproj.param.TacWorkerBParam" resultType="cn.com.goldenwater.dcproj.dto.TacCountDto">
- select count(*) count,
- (
- CASE WHEN AGE <= 30 THEN '30岁以下'
- WHEN AGE BETWEEN 31 and 35 THEN '31-35岁'
- WHEN AGE BETWEEN 36 and 40 THEN '36-40岁'
- WHEN AGE BETWEEN 41 and 45 THEN '41-45岁'
- WHEN AGE BETWEEN 46 and 50 THEN '46-50岁'
- WHEN AGE BETWEEN 51 and 55 THEN '51-55岁'
- WHEN AGE BETWEEN 56 and 60 THEN '56-60岁'
- WHEN AGE BETWEEN 61 and 65 THEN '61-65岁'
- WHEN AGE BETWEEN 66 and 70 THEN '66-70岁'
- WHEN AGE >=71 THEN '71岁以上'
- when age is null then '没有年龄信息'
- end
- ) NAME FROM TAC_WORKER_B t
- where 1 = 1
- <include refid="choseSql"/>
- <if test="name != null and name != ''">
- AND NAME like '${name}%'
- </if>
- <if test="isOffice != null and isOffice != ''">
- AND IS_OFFICE = #{isOffice}
- </if>
- <if test="isExternal != null and isExternal != ''">
- AND IS_EXTERNAL = #{isExternal}
- </if>
- <if test="isTraining != null and isTraining != ''">
- AND IS_TRAINING = #{isTraining}
- </if>
- <if test="sttm != null and sttm != '' and entm != null and entm != ''">
- AND (IN_TM >to_date(#{sttm},'yyyy-MM-dd') and in_tm < to_date(#{entm}, 'yyyy-MM-dd')+1)
- </if>
- <if test="groupType != null and groupType != ''">
- AND GROUP_TYPE in (${groupType})
- </if>
- <if test="roleType != null and roleType != ''">
- AND t.id in (select workerId from tac_worker_type where value in (${roleType}))
- </if>
- <if test="workAd!= null and workAd != ''">
- AND WORK_AD in (${workAd})
- </if>
- <if test="orgCode != null and orgCode != ''">
- AND ORG_CODE in (${orgCode})
- </if>
- <if test="education != null and education != ''">
- AND EDUCATION in (${education})
- </if>
- <if test="titles != null and titles != ''">
- AND TITLES in (${titles})
- </if>
- <if test="unitRanks != null and unitRanks != ''">
- AND UNIT_RANKS in (${unitRanks})
- </if>
- <if test="ageLimits != null and ageLimits != ''">
- ${ageLimits}
- </if>
- <if test="isAll != null and isAll != ''">
- ${isAll}
- </if>
- GROUP BY CASE WHEN AGE <= 30 THEN '30岁以下'
- WHEN AGE BETWEEN 31 and 35 THEN '31-35岁'
- WHEN AGE BETWEEN 36 and 40 THEN '36-40岁'
- WHEN AGE BETWEEN 41 and 45 THEN '41-45岁'
- WHEN AGE BETWEEN 46 and 50 THEN '46-50岁'
- WHEN AGE BETWEEN 51 and 55 THEN '51-55岁'
- WHEN AGE BETWEEN 56 and 60 THEN '56-60岁'
- WHEN AGE BETWEEN 61 and 65 THEN '61-65岁'
- WHEN AGE BETWEEN 66 and 70 THEN '66-70岁'
- WHEN AGE >=71 THEN '71岁以上'
- when age is null then '没有年龄信息' end
- </select>
- <select id="countByOffice" parameterType="cn.com.goldenwater.dcproj.param.TacWorkerBParam" resultType="cn.com.goldenwater.dcproj.dto.TacCountDto">
- select count(*) count, IS_OFFICE CODE,
- (
- CASE WHEN IS_OFFICE = '1' THEN '在职'
- WHEN IS_OFFICE = '2' THEN '离职'
- end
- ) NAME FROM TAC_WORKER_B t
- where 1 = 1
- <include refid="choseSql"/>
- <if test="name != null and name != ''">
- AND NAME like '${name}%'
- </if>
- <if test="isOffice != null and isOffice != ''">
- AND IS_OFFICE = #{isOffice}
- </if>
- <if test="isExternal != null and isExternal != ''">
- AND IS_EXTERNAL = #{isExternal}
- </if>
- <if test="isTraining != null and isTraining != ''">
- AND IS_TRAINING = #{isTraining}
- </if>
- <if test="sttm != null and sttm != '' and entm != null and entm != ''">
- AND (IN_TM >to_date(#{sttm},'yyyy-MM-dd') and in_tm < to_date(#{entm}, 'yyyy-MM-dd')+1)
- </if>
- <if test="groupType != null and groupType != ''">
- AND GROUP_TYPE in (${groupType})
- </if>
- <if test="roleType != null and roleType != ''">
- AND t.id in (select workerId from tac_worker_type where value in (${roleType}))
- </if>
- <if test="workAd!= null and workAd != ''">
- AND WORK_AD in (${workAd})
- </if>
- <if test="orgCode != null and orgCode != ''">
- AND ORG_CODE in (${orgCode})
- </if>
- <if test="education != null and education != ''">
- AND EDUCATION in (${education})
- </if>
- <if test="titles != null and titles != ''">
- AND TITLES in (${titles})
- </if>
- <if test="unitRanks != null and unitRanks != ''">
- AND UNIT_RANKS in (${unitRanks})
- </if>
- <if test="ageLimits != null and ageLimits != ''">
- ${ageLimits}
- </if>
- <if test="isAll != null and isAll != ''">
- ${isAll}
- </if>
- GROUP BY IS_OFFICE
- </select>
- <select id="getWorkerList" resultType="cn.com.goldenwater.dcproj.model.TacWorkerB" parameterType="cn.com.goldenwater.dcproj.param.TacWorkerBParam">
- select distinct t.* from (
- select t.*,case when b.count is null then 0 else b.count end as count from TAC_WORKER_B t
- left join (select * from tac_worker_type where type = '1' )p on t.id = p.workerId
- left join (select count(*) count,pers_id from TAC_INSP_YEAR_BATCH_GROUP_PERS group by pers_id) b on t.id = b.pers_id
- <if test="roleType != null and roleType != ''">
- where p.value = #{roleType}
- </if>
- ) t
- WHERE 1=1
- <include refid="choseSql"/>
- <if test="groupType != null and groupType != ''">
- and t.GROUP_TYPE = #{groupType}
- </if>
- <if test="newSize != null and newSize != ''">
- and t.count <= #{newSize}
- </if>
- <if test="isAll != null and isAll != ''">
- and (${isAll})
- </if>
- <if test="yearBatchId != null and yearBatchId != ''">
- AND t.id not in (
- select t.pers_id from TAC_INSP_YEAR_BATCH_GROUP_PERS t where t.year_batch_id = #{yearBatchId}
- <if test="roleType != null and roleType != ''">
- and t.ROLE_TYPE = #{roleType}
- </if>
- )
- </if>
- <if test="name != null and name != ''">
- And t.name like '%${name}%'
- </if>
- <if test="styr != null and enyr != null">
- AND t.id in (
- select t.pers_id from TAC_INSP_YEAR_BATCH_GROUP_PERS t where t.year >= #{styr} and t.year < #{enyr}
- )
- </if>
- <if test="stba != null and enba != null">
- AND t.id in (
- select t.pers_id from TAC_INSP_YEAR_BATCH_GROUP_PERS t where t.batch >= #{stba} and t.batch < #{enba}
- )
- </if>
- </select>
- <select id="getIsNotFitWorkerList" resultType="cn.com.goldenwater.dcproj.model.TacWorkerB" parameterType="cn.com.goldenwater.dcproj.param.TacWorkerBParam">
- select t.* from (
- select t.*,case when b.count is null then 0 else b.count end as count from TAC_WORKER_B t
- left join (select * from tac_worker_type where type = '1' ) p on t.id = p.workerId
- left join (select count(*) count,pers_id from TAC_INSP_YEAR_BATCH_GROUP_PERS group by pers_id) b on t.id = b.pers_id
- <if test="roleType != null and roleType != ''">
- where p.value = #{roleType}
- </if>
- ) t
- WHERE 1=1
- <include refid="choseSql"/>
- <if test="groupType != null and groupType != ''">
- and t.GROUP_TYPE = #{groupType}
- </if>
- <if test="isNew != null and isNew != ''">
- and t.count > #{newSize}
- </if>
- <if test="isNotAll != null and isNotAll != ''">
- and (${isNotAll})
- </if>
- <if test="yearBatchId != null and yearBatchId != ''">
- AND t.id not in (
- select t.pers_id from TAC_INSP_YEAR_BATCH_GROUP_PERS t where t.year_batch_id = #{yearBatchId}
- )
- </if>
- </select>
- <select id="getWorkerbsList" resultMap="tacWorkerBResultMap" parameterType="cn.com.goldenwater.dcproj.param.TacWorkerBParam">
- select t.* from TAC_WORKER_B t
- where 1 = 1
- <include refid="choseSql"/>
- <if test="name != null and name != ''">
- AND NAME like '${name}%'
- </if>
- <if test="isOffice != null and isOffice != ''">
- AND IS_OFFICE = #{isOffice}
- </if>
- <if test="isExternal != null and isExternal != ''">
- <choose>
- <when test='isExternal=="1"'>
- AND IS_EXTERNAL = #{isExternal}
- </when>
- <otherwise>
- AND (IS_EXTERNAL = #{isExternal} or IS_EXTERNAL is NULL)
- </otherwise>
- </choose>
- </if>
- <if test="isTraining != null and isTraining != ''">
- AND IS_TRAINING = #{isTraining}
- </if>
- <if test="sttm != null and sttm != '' and entm != null and entm != ''">
- AND (IN_TM >to_date(#{sttm},'yyyy-MM-dd') and in_tm < to_date(#{entm}, 'yyyy-MM-dd')+1)
- </if>
- <if test="groupType != null and groupType != ''">
- AND GROUP_TYPE in (${groupType})
- </if>
- <if test="roleType != null and roleType != ''">
- AND t.id in (select workerId from tac_worker_type where value in (${roleType}))
- </if>
- <if test="workAd!= null and workAd != ''">
- AND WORK_AD in (${workAd})
- </if>
- <if test="orgCode != null and orgCode != ''">
- AND ORG_CODE in (${orgCode})
- </if>
- <if test="education != null and education != ''">
- AND EDUCATION in (${education})
- </if>
- <if test="titles != null and titles != ''">
- AND TITLES in (${titles})
- </if>
- <if test="unitRanks != null and unitRanks != ''">
- AND UNIT_RANKS in (${unitRanks})
- </if>
- <if test="ageLimits != null and ageLimits != ''">
- ${ageLimits}
- </if>
- <if test="isAll != null and isAll != ''">
- ${isAll}
- </if>
- <if test="workDpNm != null and workDpNm != ''">
- AND WORK_DP_NM LIKE '%${workDpNm}%'
- </if>
- <if test="professional != null and professional != ''">
- AND PROFESSIONAL LIKE '%${professional}%'
- </if>
- </select>
- <select id="countPersBatch" resultType="cn.com.goldenwater.dcproj.dto.TacWorkerBDto" parameterType="cn.com.goldenwater.dcproj.param.TacWorkerBParam">
- select t.name,t.sex,t.work_dp_nm,t.role_type,(case when ba.count is null then 0 else ba.count end )as count from TAC_WORKER_B t left join
- (
- select count(*) as count,b.pers_id from (
- select distinct p.year_batch_id,p.pers_id from
- TAC_INSP_YEAR_BATCH_GROUP_PERS p
- where 1=1
- <if test="year != null and year != 0">
- and p.year = #{year}
- </if>
- <if test="batch != null and batch != 0">
- and p.batch = #{batch}
- </if>
- ) b group by b.pers_id
- ) ba
- on t.id = ba.pers_id
- where 1=1
- <include refid="choseSql"/>
- <if test="roleType != null and roleType!= ''">
- AND t.id in (select workerId from tac_worker_type where value in (${roleType}))
- </if>
- <if test="groupType != null and groupType !=''">
- and t.group_type = #{groupType}
- </if>
- <if test="sttm != null and sttm != '' and entm != null and entm != ''">
- AND (IN_TM >to_date(#{sttm},'yyyy-MM-dd') and in_tm < to_date(#{entm}, 'yyyy-MM-dd')+1)
- </if>
- </select>
- <select id="getWorkListByGroupId" resultType="cn.com.goldenwater.dcproj.model.TacWorkerB" parameterType="cn.com.goldenwater.dcproj.param.TacWorkerBParam">
- select p.role_type,t.name,t.id,p.IS_JOIN as "isJoin" from TAC_INSP_YEAR_BATCH_GROUP_PERS p left join TAC_WORKER_B t on t.id = p.pers_id
- left join tac_insp_year_batch h on p.year_batch_id=h.id
- where h.data_stat='0'
- <include refid="choseSql"/>
- <if test="groupId != null and groupId != ''">
- and p.GROUP_ID = #{groupId}
- </if>
- <if test="name != null and name != ''">
- and t.name like '%${name}%'
- </if>
- </select>
- <select id="getWorkerbsListById" resultType="cn.com.goldenwater.dcproj.model.TacWorkerB" parameterType="cn.com.goldenwater.dcproj.param.TacWorkerBParam">
- select DISTINCT t.* from TAC_WORKER_B t
- left join TAC_INSP_YEAR_BATCH_GROUP_PERS p on t.id = p.pers_id
- left join tac_insp_year_batch h on p.year_batch_id=h.id
- left join (select * from tac_worker_type where type = '1' ) a on t.id = a.workerId
- where h.data_stat='0'
- <include refid="choseSql"/>
- <if test="id != null and id !=''">
- AND t.id != #{id}
- </if>
- <if test="loginId != null and loginId != ''">
- AND t.login_id != loginId and p.group_id in (select t.group_id from TAC_INSP_YEAR_BATCH_GROUP_PERS t WHERE PERS_ID in (select b.id from TAC_WORKER_B b where b.login_id = #{loginId})
- </if>
- <if test="persId != null and persId != ''">
- AND p.GROUP_ID in ( select t.group_id from TAC_INSP_YEAR_BATCH_GROUP_PERS t WHERE PERS_ID in (select b.id from TAC_WORKER_B b where b.login_id = #{persId})
- )
- </if>
- <if test="groupId != null and groupId != ''">
- and p.GROUP_ID = #{groupId}
- </if>
- <if test="roleType != null and roleType != ''">
- and p.role_type = #{roleType}
- </if>
- <if test="yearBatchId != null and yearBatchId != ''">
- and p.YEAR_BATCH_ID = #{yearBatchId}
- </if>
- <if test="name != null and name != ''">
- and t.name like '%${name}%'
- </if>
- <if test="groupType != null and groupType != ''">
- and t.group_type = #{groupType}
- </if>
- </select>
- <select id="getWorkerbsListByYear" resultType="cn.com.goldenwater.dcproj.model.TacWorkerB" parameterType="cn.com.goldenwater.dcproj.param.TacWorkerBParam">
- select * from (
- SELECT t.ID, LOGIN_ID, NAME, SEX, AGE
- , BIRTHDATE, ID_NO, TELNUMB, MOBILENUMB, EMAIL
- , p.ROLE_TYPE, GROUP_TYPE, EDUCATION, IS_OFFICE, IS_TRAINING
- , RECOMMENDED_UNITS, WORK_AD, WORK_AD_NM, WORK_DP_NM, WORK_TREND_AD
- , WORK_TREND_NM, UNIT_RANKS, TITLES, DUTY, PROFESSIONAL
- , ORG_CODE, ORG_NM, EMGC_CNTCT, EMGC_CNTCT_PHONE, BANK_ACCOUNT
- , BANK_NAME, OE, RESUME, IS_A, IS_B
- , IS_C, IS_D, IS_E, IS_NEW, t.PERS_ID
- , t.IN_TM, t.UP_TM, t.DATA_STAT, PROVINCE, IS_CVL
- , l.syn_lot
- FROM TAC_WORKER_B t
- LEFT JOIN (
- SELECT *
- FROM TAC_YEAR_LOT t
- WHERE t.year = #{year}
- ) l
- ON t.id = l.pers_id
- LEFT JOIN TAC_INSP_YEAR_BATCH_GROUP_PERS p ON t.id = p.pers_id
- WHERE 1 = 1
- <if test="id != null and id !=''">
- AND t.id != id
- </if>
- <include refid="choseSql"/>
- <if test="groupId != null and groupId != ''">
- and p.GROUP_ID = #{groupId}
- </if>
- <if test="yearBatchId != null and yearBatchId != ''">
- and p.YEAR_BATCH_ID = #{yearBatchId}
- </if>
- )t
- <if test="orderBy != null and orderBy != ''">
- where t.syn_lot is not null
- order by ${orderBy}
- </if>
- </select>
- <select id="countByRoleNew" parameterType="cn.com.goldenwater.dcproj.param.TacWorkerBParam" resultType="cn.com.goldenwater.dcproj.dto.TacCountDto">
- select count(*) count, a.VALUE CODE,
- (
- CASE WHEN a.VALUE = '20' THEN '专家组长'
- WHEN a.VALUE = '19' THEN '助理'
- WHEN a.VALUE = '11' THEN '前期专家'
- WHEN a.VALUE = '12' THEN '建管专家'
- WHEN a.VALUE = '13' THEN '计划专家'
- WHEN a.VALUE = '14' THEN '财务专家'
- WHEN a.VALUE = '15' THEN '质量专家'
- WHEN a.VALUE = '16' THEN '安全专家'
- WHEN a.VALUE = '21' THEN '特派员'
- end
- ) NAME FROM (
- select w.* from (
- select w.*,case when ba.count is null then 0 else ba.count end as count from
- TAC_WORKER_B w left join
- (
- select count(*) as count,b.pers_id from (
- select distinct p.year_batch_id,p.pers_id from
- TAC_INSP_YEAR_BATCH_GROUP_PERS p
- ) b group by b.pers_id
- ) ba
- on w.id = ba.pers_id
- ) w where 1 = 1
- and w.count <= #{newSize}
- ) t
- left join (select * from tac_worker_type where type = '1' ) a on t.id = a.workerId
- where a.id is not NULL
- <include refid="choseSql"/>
- group by a.VALUE
- </select>
- <select id="getNotDisPersList" resultType="cn.com.goldenwater.dcproj.model.TacWorkerB" parameterType="cn.com.goldenwater.dcproj.param.TacWorkerBParam">
- select distinct b.* from TAC_INSP_YEAR_BATCH_GROUP_PERS t left join TAC_WORKER_B b on t.pers_id = b.id
- where t.year_batch_id =#{yearBatchId}
- <if test="roleType != null and roleType != ''">
- AND t.role_type = #{roleType}
- </if>
- <if test="name != null and name != ''">
- AND b.name like '%${name}%'
- </if>
- <if test="groupId != null and groupId != ''">
- AND case when t.group_id is null then '0' else t.group_id end != #{groupId}
- </if>
- <if test="workerIds != null and workerIds != ''">
- AND t.pers_id not in (${workerIds})
- </if>
- <trim>
- <choose>
- <when test="province !=null and province !=''">
- AND b.PROVINCE=#{province}
- </when>
- <otherwise>
- AND b.PROVINCE is null
- </otherwise>
- </choose>
- </trim>
- and b.id is not null
- </select>
- <select id="getObjTacWorkerbList" resultType="cn.com.goldenwater.dcproj.model.TacWorkerB" parameterType="cn.com.goldenwater.dcproj.param.TacWorkerBParam">
- select b.* from TAC_INSP_YEAR_BATCH_GROUP_PERS t left join TAC_WORKER_B b on t.pers_id = b.id
- where 1=1
- and REGEXP_LIKE(
- t.group_id,'^('||
- ( case when(SELECT count(group_id) from TAC_INSP_YEAR_BATCH_GROUP_PERS WHERE PERS_ID =#{persId})>0 then
- (SELECT LISTAGG(group_id, '|') WITHIN GROUP(ORDER BY PERSID) as
- id FROM TAC_INSP_YEAR_BATCH_GROUP_PERS WHERE PERS_ID =#{persId})
- else (select 'non' from dual) end)
- ||')')
- <if test='isLevel != null and isLevel == "yearBatch"' >
- and t.group_id is null
- </if>
- <trim>
- <choose>
- <when test="province !=null and province !=''">
- AND b.PROVINCE=#{province}
- </when>
- <otherwise>
- AND b.PROVINCE is null
- </otherwise>
- </choose>
- </trim>
- <if test="year != null and year != ''">
- And t.year = #{year}
- </if>
- <if test="batch != null and batch != ''">
- ANd t.batch = #{batch}
- </if>
- <if test="yearBatchId != null and yearBatchId != ''">
- And t.year_batch_id = #{yearBatchId}
- </if>
- <if test="groupId != null and groupId != ''">
- AND t.group_id = #{groupId}
- </if>
- </select>
- <select id="countWorkerAudit" parameterType="cn.com.goldenwater.dcproj.param.TacWorkerBParam" resultType="cn.com.goldenwater.dcproj.dto.TacWorkerbAuditDto">
- select a.count,b.* from (
- select t.pers_id,count(t.GROUP_ID) count from tac_insp_year_batch_group_pers t,TAC_INSP_YEAR_BATCH j
- where t.year_batch_id=j.id and t.pers_id is not null and j.data_stat='0'
- <if test="years != null and years != ''">
- and t.year in (${years})
- </if>
- <if test="year != null">
- and t.year = #{year}
- </if>
- <if test="batch != null">
- and t.batch = #{batch}
- </if>
- <if test="batchs != null and batchs != ''">
- and t.batch in $(batchs)
- </if>
- <if test="roleType != null and roleType != ''">
- AND ROLE_TYPE in (${roleType})
- </if>
- group by t.pers_id
- ) a left join tac_worker_b b on a.pers_id = b.id
- where b.id is not null
- <if test="sttm != null and sttm != '' and entm != null and entm != ''">
- AND (b.IN_TM >to_date(#{sttm},'yyyy-MM-dd') and b.in_tm < to_date(#{entm}, 'yyyy-MM-dd')+1)
- </if>
- <if test="groupType != null and groupType != ''">
- AND b.GROUP_TYPE in (${groupType})
- </if>
- <trim>
- <choose>
- <when test="province !=null and province !=''">
- AND b.PROVINCE=#{province}
- </when>
- <otherwise>
- AND b.PROVINCE is null
- </otherwise>
- </choose>
- </trim>
- <if test="name != null and name != ''">
- and b.name like '%${name}%'
- </if>
- ORDER BY B.COUNT DESC
- </select>
- <select id="getWorkerNotJoinCountList" resultType="cn.com.goldenwater.dcproj.dto.TacWorkerBCountDto" parameterType="cn.com.goldenwater.dcproj.param.TacWorkerBParam">
- select a.timeoutCount ,a.refuseCount,a.year,b.* from (
- select t.year,t.pers_id2,count(*) as count,sum(case when t.nin_reason = '回复超时' then 1 else 0 end) as timeoutCount,sum(case when t.nin_reason = '回复不参加' then 1 else 0 end) as refuseCount from TAC_INSP_YEAR_BATCH_REASON t where t.nin_reason is not null and t.nin_reason != '其他原因'
- <if test="year != null">
- and t.year = #{year}
- </if>
- <if test="roleType != null and roleType != ''">
- and t.role_type in (${roleType})
- </if>
- group by t.year,t.pers_id2
- order by t.year DESC
- ) a left join tac_worker_b b on a.pers_id2 = b.id where b.id is not null
- <if test="name != null and name != ''">
- and b.name like '%${name}%'
- </if>
- <if test="groupType != null and groupType != ''">
- and b.group_type in (${groupType})
- </if>
- <trim>
- <choose>
- <when test="province !=null and province !=''">
- AND b.PROVINCE=#{province}
- </when>
- <otherwise>
- AND b.PROVINCE is null
- </otherwise>
- </choose>
- </trim>
- </select>
- <select id="listByMap" parameterType="java.util.Map" resultType="cn.com.goldenwater.dcproj.dto.TacWorkerPerDto">
- select DISTINCT
- P.ID,
- P.LOGIN_ID,
- P.NAME,
- P.SEX,
- P.AGE,
- P.BIRTHDATE,
- P.ID_NO,
- P.TELNUMB,
- P.MOBILENUMB,
- P.EMAIL,
- P.ROLE_TYPE,
- P.GROUP_TYPE,
- P.EDUCATION,
- P.IS_OFFICE,
- P.IS_EXTERNAL,
- P.IS_TRAINING,
- P.RECOMMENDED_UNITS,
- P.WORK_AD,
- P.WORK_AD_NM,
- P.WORK_DP_NM,
- P.WORK_TREND_AD,
- P.WORK_TREND_NM,
- P.UNIT_RANKS,
- P.TITLES,
- P.DUTY,
- P.PROFESSIONAL,
- P.ORG_CODE,
- P.ORG_NM,
- P.EMGC_CNTCT,
- P.EMGC_CNTCT_PHONE,
- P.BANK_ACCOUNT,
- P.BANK_NAME,
- P.OE,
- P.RESUME,
- P.IS_A,
- P.IS_B,
- P.IS_C,
- P.IS_D,
- P.IS_E,
- P.IS_NEW,
- P.PERS_ID,
- P.IN_TM,
- P.UP_TM,
- P.DATA_STAT
- FROM TAC_WORKER_B P
- JOIN TAC_INSP_YEAR_BATCH_OBJ L ON P.LOGIN_ID = L.PERS_ID
- JOIN TAC_INSP_YEAR_BATCH_AREA N ON N.GROUP_ID = L.GROUP_ID
- <where>
- <if test="province != null and province != ''">
- and N.PROVINCE = #{province}
- </if>
- <if test="name != null and name != ''">
- and P.NAME like '%' || #{name} || '%'
- </if>
- <if test="dataStat != null and dataStat != ''">
- and P.dataStat = 0
- </if>
- </where>
- </select>
- <select id="findListExist" resultType="cn.com.goldenwater.dcproj.model.TacWorkerB">
- select * from TAC_WORKER_B where (ID_NO = #{idNo} or MOBILENUMB = #{mobilenumb})
- <if test="id != null and id != ''">and ID <> #{id}</if>
- </select>
- </mapper>
|