| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203 |
- <?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, '|') as
- id FROM TAC_INSP_YEAR_BATCH_GROUP_PERS WHERE PERS_ID =#{persId} GROUP BY 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 ORDER BY B.COUNT DESC
- <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>
- </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>
|