YgglMainEmpMapper.xml 30.4 KB
Newer Older
东州 翁 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
<?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.timer.api.dao.yggl.YgglMainEmpMapper">

    <resultMap id="BaseResultMap" type="cn.timer.api.bean.yggl.YgglMainEmp" >
        	<id column="id" property="id" />
                <result column="emp_num" property="empNum" />
                <result column="phone" property="phone" />
                <result column="password" property="password" />
                <result column="head_url" property="headUrl" />
                <result column="name" property="name" />
                <result column="english_name" property="englishName" />
                <result column="sex" property="sex" />
                <result column="zj_type" property="zjType" />
                <result column="zj_num" property="zjNum" />
                <result column="sfzyx_time" property="sfzyxTime" />
                <result column="birthday" property="birthday" />
                <result column="age" property="age" />
                <result column="is_married" property="isMarried" />
                <result column="is_pregnant" property="isPregnant" />
                <result column="area" property="area" />
                <result column="mz" property="mz" />
                <result column="zzmm" property="zzmm" />
                <result column="jg" property="jg" />
                <result column="city" property="city" />
                <result column="hk_type" property="hkType" />
                <result column="hk_address" property="hkAddress" />
                <result column="qq" property="qq" />
                <result column="wechat" property="wechat" />
                <result column="email" property="email" />
                <result column="blood_type" property="bloodType" />
                <result column="language" property="language" />
                <result column="edu" property="edu" />
                <result column="zy" property="zy" />
                <result column="zz_remark" property="zzRemark" />
                <result column="job_type" property="jobType" />
                <result column="job_status" property="jobStatus" />
                <result column="rz_time" property="rzTime" />
                <result column="syq" property="syq" />
                <result column="zz_time" property="zzTime" />
                <result column="sjzz_time" property="sjzzTime" />
                <result column="is_jrkq" property="isJrkq" />
                <result column="job_num" property="jobNum" />
                <result column="work_address" property="workAddress" />
                <result column="work_phone" property="workPhone" />
                <result column="work_email" property="workEmail" />
                <result column="zpqd" property="zpqd" />
                <result column="bmgw_id" property="bmgwId" />
50 51
                <result column="bmgw_name" property="bmgwName" />
                
东州 翁 committed
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121
                <result column="org_code" property="orgCode" />
                <result column="unionid" property="unionid" />
                <result column="openid" property="openid" />
                <result column="mpopenid" property="mpopenid" />
                <result column="appopenid" property="appopenid" />
    </resultMap>
    
   <resultMap id="Bintu" type="cn.timer.api.dto.yggl.YgbintuDto" >
   		<id column="id" property="id" />
   			<result column="age" property="age" />
   			<result column="bmgwId" property="bmgwId" />
   			<result column="gw" property="gw" />
   			<result column="bm" property="bm" />
   			<result column="proname" property="proname" />
   			<result column="eduname" property="eduname" />
   			<result column="jobStatus" property="jobStatus" />
   			<result column="workage" property="workage" />
   </resultMap>

    <sql id="Base_Column_List">
                id,
                emp_num,
                phone,
                password,
                head_url,
                name,
                english_name,
                sex,
                zj_type,
                zj_num,
                sfzyx_time,
                birthday,
                age,
                is_married,
                is_pregnant,
                area,
                mz,
                zzmm,
                jg,
                city,
                hk_type,
                hk_address,
                qq,
                wechat,
                email,
                blood_type,
                language,
                edu,
                zy,
                zz_remark,
                job_type,
                job_status,
                rz_time,
                syq,
                zz_time,
                sjzz_time,
                is_jrkq,
                job_num,
                work_address,
                work_phone,
                work_email,
                zpqd,
                bmgw_id,
                org_code,
                unionid,
                openid,
                mpopenid,
                appopenid
    </sql>
    
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138
    <sql id="Base_Column_List_a">
                a.id,
                a.emp_num,
                a.phone,
                a.head_url,
                a.name,
                a.english_name,
                a.sex,
                a.birthday,
                a.jg,
                a.job_type,
                a.job_status,
                a.rz_time,
                a.bmgw_id,
                a.org_code
    </sql>
    
东州 翁 committed
139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190
    <sql id="Base_Column_List_Alias">
                id YgglMainEmp_id,
                emp_num YgglMainEmp_emp_num,
                phone YgglMainEmp_phone,
                password YgglMainEmp_password,
                head_url YgglMainEmp_head_url,
                name YgglMainEmp_name,
                english_name YgglMainEmp_english_name,
                sex YgglMainEmp_sex,
                zj_type YgglMainEmp_zj_type,
                zj_num YgglMainEmp_zj_num,
                sfzyx_time YgglMainEmp_sfzyx_time,
                birthday YgglMainEmp_birthday,
                age YgglMainEmp_age,
                is_married YgglMainEmp_is_married,
                is_pregnant YgglMainEmp_is_pregnant,
                area YgglMainEmp_area,
                mz YgglMainEmp_mz,
                zzmm YgglMainEmp_zzmm,
                jg YgglMainEmp_jg,
                city YgglMainEmp_city,
                hk_type YgglMainEmp_hk_type,
                hk_address YgglMainEmp_hk_address,
                qq YgglMainEmp_qq,
                wechat YgglMainEmp_wechat,
                email YgglMainEmp_email,
                blood_type YgglMainEmp_blood_type,
                language YgglMainEmp_language,
                edu YgglMainEmp_edu,
                zy YgglMainEmp_zy,
                zz_remark YgglMainEmp_zz_remark,
                job_type YgglMainEmp_job_type,
                job_status YgglMainEmp_job_status,
                rz_time YgglMainEmp_rz_time,
                syq YgglMainEmp_syq,
                zz_time YgglMainEmp_zz_time,
                sjzz_time YgglMainEmp_sjzz_time,
                is_jrkq YgglMainEmp_is_jrkq,
                job_num YgglMainEmp_job_num,
                work_address YgglMainEmp_work_address,
                work_phone YgglMainEmp_work_phone,
                work_email YgglMainEmp_work_email,
                zpqd YgglMainEmp_zpqd,
                bmgw_id YgglMainEmp_bmgw_id,
                org_code YgglMainEmp_org_code,
                unionid YgglMainEmp_unionid,
                openid YgglMainEmp_openid,
                mpopenid YgglMainEmp_mpopenid,
                appopenid YgglMainEmp_appopenid
    </sql>
     <!-- rsybp人事仪表盘 -->
    <select id="rsybp" resultMap="Bintu">
191 192 193
    	SELECT e.id AS id,IFNULL(e.age,0) AS age,IFNULL(e.bmgw_id,0) AS bmgwId,IFNULL(b.`name`,'null') AS gw,
    	IFNULL(bb.`name`,'null') AS bm,IFNULL( p.`name`,'null') AS proname,IFNULL(d.`name` ,'null')AS eduname,
    	IFNULL(e.job_status,0) AS jobStatus,IFNULL(datediff(CURDATE(),e.rz_time),0)AS workage
东州 翁 committed
194 195 196 197 198
		FROM yggl_main_emp e 
		LEFT JOIN zzgl_bmgw_m b ON b.id = e.bmgw_id 
		LEFT JOIN zzgl_bmgw_m bb ON bb.id = b.up_id
		LEFT JOIN province_class p ON  left (e.`jg`,2) = p.province
		LEFT JOIN education_class d ON d.number = e.edu
199
		WHERE e.org_code = #{orgCode}
东州 翁 committed
200
    </select>
201
    
202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239
    
    <select id="selectME" resultMap="BaseResultMap">
        SELECT 
        	<include refid="Base_Column_List_a" />,
        	(SELECT name FROM zzgl_bmgw_m WHERE id = (SELECT up_id FROM zzgl_bmgw_m WHERE id = a.bmgw_id limit 1) limit 1) as bmgw_name
        FROM yggl_main_emp a
        <where>
        	AND a.org_code = #{param.orgCode}
        	<if test="param.jobType != null">
        		AND a.job_type = #{param.jobType}
        	</if>
        	<if test="param.jobStatus != null">
        		AND a.job_status = #{param.jobStatus}
        	</if>
        	<if test="param.query != null and param.query != ''">
        		AND (
        			a.name like CONCAT('%',#{param.query},'%') or
        			a.phone like CONCAT('%',#{param.query},'%')
        		)
        	</if>
        	<if test="param.empNums != null and param.empNums.size() > 0">
        		<choose>
					<when test="param.empNums.size() > 1">
						AND a.emp_num IN
						(
						<foreach item="it" index="index" collection="param.empNums" separator="," close="" >
				        	#{it}
						</foreach>
						) 
					</when>
					<otherwise>
						AND a.emp_num = #{param.empNums[0]}
					</otherwise>
				</choose>
        	</if>
        </where>
    </select>
    
240 241 242 243 244 245 246 247 248 249
    <!-- benyueLz本月离职人数 -->
    <select id="benyueLz" resultType="Integer">
		SELECT COUNT(datediff(CURDATE(),l.sjlz_time)) FROM yggl_main_lzb l WHERE datediff(CURDATE(),l.sjlz_time) <![CDATA[ <= ]]> 30 AND org_code = #{orgCode};
    </select>
    
     <!-- benyueZz本月转正人数 -->
    <select id="benyueZz" resultType="Integer">
    	SELECT COUNT(datediff(CURDATE(),e.sjzz_time)) FROM yggl_main_emp e WHERE datediff(CURDATE(),e.sjzz_time) <![CDATA[ <= ]]> 30 AND org_code = #{orgCode};
    </select>
    
东州 翁 committed
250 251 252
    <!-- 查询员工信息 搜索 分页 -->
	<select id="queryEmpMessage" resultType="cn.timer.api.dto.yggl.YgQueryDto">
    	SELECT
253
			a.name empName,
东州 翁 committed
254
			a.emp_num empNum,
255
			b.name deptName,
东州 翁 committed
256 257 258
			a.rz_time rzTime,
			a.job_type jobType,
			a.phone phone,
259 260
			a.job_status jobStatus,
			a.head_url headUrl
东州 翁 committed
261 262 263 264 265 266
		FROM
			yggl_main_emp a
		LEFT JOIN zzgl_bmgw_m b ON a.bmgw_id = b.id
		WHERE
			a.org_code = #{orgCode}
		AND
267
			a.job_status in (0,1,2)
东州 翁 committed
268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386
		ORDER BY
			emp_num DESC
    </select>
    
	<!-- 查询在职员工(试用员工人数+正式员工人数) -->
	<select id="queryInservice" resultType="cn.timer.api.dto.yggl.YgglCartogramDto">
    	SELECT
			SUM(job_status=1) AS probation,
			SUM(job_status=2) AS regular
		FROM 
			yggl_main_emp
		WHERE
			org_code=#{orgCode}
    </select>
    
    <!-- 查询当月入职人数 -->
    <select id="queryInduction" resultType="cn.timer.api.dto.yggl.YgglCartogramDto">
    	SELECT
			EXTRACT(MONTH FROM rz_time) AS month,
			COUNT(emp_num) induction
		FROM 
			yggl_main_emp
		WHERE
			org_code=#{orgCode}
    </select>
    
    
    <!-- 查询本月转正人数  -->
    <select id="queryPositive" resultType="cn.timer.api.dto.yggl.YgglCartogramDto">
		SELECT
			EXTRACT(MONTH FROM sjzz_time) AS month,
			COUNT(emp_num) positive 
		FROM 
			yggl_main_emp
		WHERE
			org_code=#{orgCode}
	</select>
	
	<!-- 查询员工平均年龄  -->
    <select id="queryAvgAge" resultType="cn.timer.api.dto.yggl.YgglCartogramDto">
		SELECT
			avg(age) avgAge
		FROM
			yggl_main_emp
		WHERE
			org_code=#{orgCode}
	</select>
	
	<!-- 查询岗位上级部门id及名称及人数  -->
    <select id="queryDepartmentNum" resultType="cn.timer.api.dto.yggl.YgglCartogramDto">
		SELECT
			IFNULL(c.name,'null') updeptname,
			IFNULL(b.up_id,0) updeptid,
			count(1) updeptnum
		FROM
			yggl_main_emp y
		LEFT JOIN zzgl_bmgw_m b ON y.bmgw_id = b.id
		LEFT JOIN zzgl_bmgw_m c ON c.id = b.up_id
		WHERE
			y.org_code = #{orgCode}
		GROUP BY
			c.name,
			b.up_id
	</select>
	
	<!-- 查询岗位名称及人数 -->
	<select id="queryJobsNum" resultType="cn.timer.api.dto.yggl.YgglCartogramDto">
		SELECT
			IFNULL(b.name,'null') jobname,
			IFNULL(y.bmgw_id,0) jobid,
			count(1) jobnum
		FROM
			yggl_main_emp y
		LEFT JOIN zzgl_bmgw_m b ON y.bmgw_id = b.id
		WHERE
			y.org_code = #{orgCode}
		GROUP BY
			y.bmgw_id,
			b.name;
	</select>
	
	<!-- 学历及人数查询 -->
	<select id="queryEducation" resultType="cn.timer.api.dto.yggl.YgglCartogramDto">
		SELECT
			IFNULL(e.name,'null') education,count(y.edu) educationNum
		FROM
			yggl_main_emp y
		LEFT JOIN
			education_class e
		ON
			y.edu = e.id
		WHERE
			org_code = #{orgCode}
		GROUP BY
			e.name
		ORDER BY
			e.id ASC
	</select>
	
	<!-- 员工年龄分布查询 -->
	<select id="queryEmpAge" resultType="cn.timer.api.dto.yggl.YgglCartogramDto">
		<![CDATA[
		SELECT 
			SUM((CASE WHEN age < 0.5 THEN 1 ELSE 0 END)) AS lowerEighteen,
			SUM((CASE WHEN age >= 18 AND age < 25 THEN 1 ELSE 0 END)) AS eighteenToTwentyfive,
			SUM((CASE WHEN age >= 25 AND age < 32 THEN 1 ELSE 0 END)) AS twentyfiveToThirtytwo,
			SUM((CASE WHEN age >= 32 AND age < 38 THEN 1 ELSE 0 END)) AS thirtytwoToThirtyeight,
			SUM((CASE WHEN age >= 38 AND age < 45 THEN 1 ELSE 0 END)) AS thirtyeightToFortyfive,
			SUM((CASE WHEN age >=45 THEN 1 ELSE 0 END)) AS higherFortyfive
		FROM 
			yggl_main_emp
		WHERE
			org_code = #{orgCode}
			]]>
	</select>
	
	<!-- 籍贯统计(省份)查询 -->
	<select id="queryNativeplace" resultType="cn.timer.api.dto.yggl.YgglCartogramDto">
		SELECT
387
			IFNULL(c.city_name,'null') province,count(y.jg_id) provinceNum
东州 翁 committed
388 389 390
		FROM
			yggl_main_emp y
		LEFT JOIN
391
			common_area c
东州 翁 committed
392
		ON
393
			y.jg_id = c.code_id
东州 翁 committed
394 395 396
		WHERE
			org_code = #{orgCode}
		GROUP BY
397
			c.city_name
东州 翁 committed
398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787
	</select>
	
	<!-- 员工工龄分布查询 -->
	<select id="queryWorkingAge" resultType="cn.timer.api.dto.yggl.YgglCartogramDto">
	<![CDATA[
		SELECT 
			SUM((CASE WHEN TIMESTAMPDIFF(day, rz_time,now())/365 < 0.5 THEN 1 ELSE 0 END)) AS lowerHalfyear,
			SUM((CASE WHEN TIMESTAMPDIFF(day, rz_time,now())/365 >= 0.5 AND TIMESTAMPDIFF(day, rz_time,now())/365 < 1 THEN 1 ELSE 0 END)) AS halfYear,
			SUM((CASE WHEN TIMESTAMPDIFF(day, rz_time,now())/365 >= 1 AND TIMESTAMPDIFF(day, rz_time,now())/365 < 1.5 THEN 1 ELSE 0 END)) AS oneYear,
			SUM((CASE WHEN TIMESTAMPDIFF(day, rz_time,now())/365 >= 1.5 AND TIMESTAMPDIFF(day, rz_time,now())/365 < 2 THEN 1 ELSE 0 END)) AS onehalfYear,
			SUM((CASE WHEN TIMESTAMPDIFF(day, rz_time,now())/365 >= 2 AND TIMESTAMPDIFF(day, rz_time,now())/365 < 2.5 THEN 1 ELSE 0 END)) AS twoYear,
			SUM((CASE WHEN TIMESTAMPDIFF(day, rz_time,now())/365 >=2.5 THEN 1 ELSE 0 END)) AS higherTwohalfYear
		FROM 
			yggl_main_emp
		WHERE
			org_code = #{orgCode}
			]]>
	</select>
	
	<!-- 

    <insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.yggl.YgglMainEmp">
        INSERT INTO yggl_main_emp
        <trim prefix="(" suffix=")" suffixOverrides=",">
                        <if test ='null != empNum'>
                        emp_num,
                        </if>
                        <if test ='null != phone'>
                        phone,
                        </if>
                        <if test ='null != password'>
                        password,
                        </if>
                        <if test ='null != headUrl'>
                        head_url,
                        </if>
                        <if test ='null != name'>
                        name,
                        </if>
                        <if test ='null != englishName'>
                        english_name,
                        </if>
                        <if test ='null != sex'>
                        sex,
                        </if>
                        <if test ='null != zjType'>
                        zj_type,
                        </if>
                        <if test ='null != zjNum'>
                        zj_num,
                        </if>
                        <if test ='null != sfzyxTime'>
                        sfzyx_time,
                        </if>
                        <if test ='null != birthday'>
                        birthday,
                        </if>
                        <if test ='null != age'>
                        age,
                        </if>
                        <if test ='null != isMarried'>
                        is_married,
                        </if>
                        <if test ='null != isPregnant'>
                        is_pregnant,
                        </if>
                        <if test ='null != area'>
                        area,
                        </if>
                        <if test ='null != mz'>
                        mz,
                        </if>
                        <if test ='null != zzmm'>
                        zzmm,
                        </if>
                        <if test ='null != jg'>
                        jg,
                        </if>
                        <if test ='null != city'>
                        city,
                        </if>
                        <if test ='null != hkType'>
                        hk_type,
                        </if>
                        <if test ='null != hkAddress'>
                        hk_address,
                        </if>
                        <if test ='null != qq'>
                        qq,
                        </if>
                        <if test ='null != wechat'>
                        wechat,
                        </if>
                        <if test ='null != email'>
                        email,
                        </if>
                        <if test ='null != bloodType'>
                        blood_type,
                        </if>
                        <if test ='null != language'>
                        language,
                        </if>
                        <if test ='null != edu'>
                        edu,
                        </if>
                        <if test ='null != zy'>
                        zy,
                        </if>
                        <if test ='null != zzRemark'>
                        zz_remark,
                        </if>
                        <if test ='null != jobType'>
                        job_type,
                        </if>
                        <if test ='null != jobStatus'>
                        job_status,
                        </if>
                        <if test ='null != rzTime'>
                        rz_time,
                        </if>
                        <if test ='null != syq'>
                        syq,
                        </if>
                        <if test ='null != zzTime'>
                        zz_time,
                        </if>
                        <if test ='null != sjzzTime'>
                        sjzz_time,
                        </if>
                        <if test ='null != isJrkq'>
                        is_jrkq,
                        </if>
                        <if test ='null != jobNum'>
                        job_num,
                        </if>
                        <if test ='null != workAddress'>
                        work_address,
                        </if>
                        <if test ='null != workPhone'>
                        work_phone,
                        </if>
                        <if test ='null != workEmail'>
                        work_email,
                        </if>
                        <if test ='null != zpqd'>
                        zpqd,
                        </if>
                        <if test ='null != bmgwId'>
                        bmgw_id,
                        </if>
                        <if test ='null != orgCode'>
                        org_code,
                        </if>
                        <if test ='null != unionid'>
                        unionid,
                        </if>
                        <if test ='null != openid'>
                        openid,
                        </if>
                        <if test ='null != mpopenid'>
                        mpopenid,
                        </if>
                        <if test ='null != appopenid'>
                        appopenid
                        </if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
                        <if test ='null != empNum'>
                        #{empNum},
                        </if>
                        <if test ='null != phone'>
                        #{phone},
                        </if>
                        <if test ='null != password'>
                        #{password},
                        </if>
                        <if test ='null != headUrl'>
                        #{headUrl},
                        </if>
                        <if test ='null != name'>
                        #{name},
                        </if>
                        <if test ='null != englishName'>
                        #{englishName},
                        </if>
                        <if test ='null != sex'>
                        #{sex},
                        </if>
                        <if test ='null != zjType'>
                        #{zjType},
                        </if>
                        <if test ='null != zjNum'>
                        #{zjNum},
                        </if>
                        <if test ='null != sfzyxTime'>
                        #{sfzyxTime},
                        </if>
                        <if test ='null != birthday'>
                        #{birthday},
                        </if>
                        <if test ='null != age'>
                        #{age},
                        </if>
                        <if test ='null != isMarried'>
                        #{isMarried},
                        </if>
                        <if test ='null != isPregnant'>
                        #{isPregnant},
                        </if>
                        <if test ='null != area'>
                        #{area},
                        </if>
                        <if test ='null != mz'>
                        #{mz},
                        </if>
                        <if test ='null != zzmm'>
                        #{zzmm},
                        </if>
                        <if test ='null != jg'>
                        #{jg},
                        </if>
                        <if test ='null != city'>
                        #{city},
                        </if>
                        <if test ='null != hkType'>
                        #{hkType},
                        </if>
                        <if test ='null != hkAddress'>
                        #{hkAddress},
                        </if>
                        <if test ='null != qq'>
                        #{qq},
                        </if>
                        <if test ='null != wechat'>
                        #{wechat},
                        </if>
                        <if test ='null != email'>
                        #{email},
                        </if>
                        <if test ='null != bloodType'>
                        #{bloodType},
                        </if>
                        <if test ='null != language'>
                        #{language},
                        </if>
                        <if test ='null != edu'>
                        #{edu},
                        </if>
                        <if test ='null != zy'>
                        #{zy},
                        </if>
                        <if test ='null != zzRemark'>
                        #{zzRemark},
                        </if>
                        <if test ='null != jobType'>
                        #{jobType},
                        </if>
                        <if test ='null != jobStatus'>
                        #{jobStatus},
                        </if>
                        <if test ='null != rzTime'>
                        #{rzTime},
                        </if>
                        <if test ='null != syq'>
                        #{syq},
                        </if>
                        <if test ='null != zzTime'>
                        #{zzTime},
                        </if>
                        <if test ='null != sjzzTime'>
                        #{sjzzTime},
                        </if>
                        <if test ='null != isJrkq'>
                        #{isJrkq},
                        </if>
                        <if test ='null != jobNum'>
                        #{jobNum},
                        </if>
                        <if test ='null != workAddress'>
                        #{workAddress},
                        </if>
                        <if test ='null != workPhone'>
                        #{workPhone},
                        </if>
                        <if test ='null != workEmail'>
                        #{workEmail},
                        </if>
                        <if test ='null != zpqd'>
                        #{zpqd},
                        </if>
                        <if test ='null != bmgwId'>
                        #{bmgwId},
                        </if>
                        <if test ='null != orgCode'>
                        #{orgCode},
                        </if>
                        <if test ='null != unionid'>
                        #{unionid},
                        </if>
                        <if test ='null != openid'>
                        #{openid},
                        </if>
                        <if test ='null != mpopenid'>
                        #{mpopenid},
                        </if>
                        <if test ='null != appopenid'>
                        #{appopenid}
                        </if>
        </trim>
    </insert>

    <delete id="delete" >
        DELETE FROM yggl_main_emp
        WHERE id = #{id}
    </delete>

    <update id="update" parameterType="cn.timer.api.bean.yggl.YgglMainEmp">
        UPDATE yggl_main_emp
        <set>
                    <if test ='null != empNum'>emp_num = #{empNum},</if>
                    <if test ='null != phone'>phone = #{phone},</if>
                    <if test ='null != password'>password = #{password},</if>
                    <if test ='null != headUrl'>head_url = #{headUrl},</if>
                    <if test ='null != name'>name = #{name},</if>
                    <if test ='null != englishName'>english_name = #{englishName},</if>
                    <if test ='null != sex'>sex = #{sex},</if>
                    <if test ='null != zjType'>zj_type = #{zjType},</if>
                    <if test ='null != zjNum'>zj_num = #{zjNum},</if>
                    <if test ='null != sfzyxTime'>sfzyx_time = #{sfzyxTime},</if>
                    <if test ='null != birthday'>birthday = #{birthday},</if>
                    <if test ='null != age'>age = #{age},</if>
                    <if test ='null != isMarried'>is_married = #{isMarried},</if>
                    <if test ='null != isPregnant'>is_pregnant = #{isPregnant},</if>
                    <if test ='null != area'>area = #{area},</if>
                    <if test ='null != mz'>mz = #{mz},</if>
                    <if test ='null != zzmm'>zzmm = #{zzmm},</if>
                    <if test ='null != jg'>jg = #{jg},</if>
                    <if test ='null != city'>city = #{city},</if>
                    <if test ='null != hkType'>hk_type = #{hkType},</if>
                    <if test ='null != hkAddress'>hk_address = #{hkAddress},</if>
                    <if test ='null != qq'>qq = #{qq},</if>
                    <if test ='null != wechat'>wechat = #{wechat},</if>
                    <if test ='null != email'>email = #{email},</if>
                    <if test ='null != bloodType'>blood_type = #{bloodType},</if>
                    <if test ='null != language'>language = #{language},</if>
                    <if test ='null != edu'>edu = #{edu},</if>
                    <if test ='null != zy'>zy = #{zy},</if>
                    <if test ='null != zzRemark'>zz_remark = #{zzRemark},</if>
                    <if test ='null != jobType'>job_type = #{jobType},</if>
                    <if test ='null != jobStatus'>job_status = #{jobStatus},</if>
                    <if test ='null != rzTime'>rz_time = #{rzTime},</if>
                    <if test ='null != syq'>syq = #{syq},</if>
                    <if test ='null != zzTime'>zz_time = #{zzTime},</if>
                    <if test ='null != sjzzTime'>sjzz_time = #{sjzzTime},</if>
                    <if test ='null != isJrkq'>is_jrkq = #{isJrkq},</if>
                    <if test ='null != jobNum'>job_num = #{jobNum},</if>
                    <if test ='null != workAddress'>work_address = #{workAddress},</if>
                    <if test ='null != workPhone'>work_phone = #{workPhone},</if>
                    <if test ='null != workEmail'>work_email = #{workEmail},</if>
                    <if test ='null != zpqd'>zpqd = #{zpqd},</if>
                    <if test ='null != bmgwId'>bmgw_id = #{bmgwId},</if>
                    <if test ='null != orgCode'>org_code = #{orgCode},</if>
                    <if test ='null != unionid'>unionid = #{unionid},</if>
                    <if test ='null != openid'>openid = #{openid},</if>
                    <if test ='null != mpopenid'>mpopenid = #{mpopenid},</if>
                    <if test ='null != appopenid'>appopenid = #{appopenid}</if>
        </set>
        WHERE id = #{id}
    </update>


    <select id="load" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List" />
        FROM yggl_main_emp
        WHERE id = #{id}
    </select>

    <select id="pageList" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List" />
        FROM yggl_main_emp
        LIMIT #{offset}, #{pageSize}
    </select>

    <select id="pageListCount" resultType="java.lang.Integer">
        SELECT count(1)
        FROM yggl_main_emp
    </select>

	 -->

yuquan.zhu committed
788
</mapper>