| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529 |
- <?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.AttPersBaseDao">
- <resultMap type="cn.com.goldenwater.dcproj.model.AttPersBase" id="attPersBaseResultMap">
- <result property="toDate" column="TO_DATE"/>
- <result property="note" column="NOTE"/>
- <result property="admDuty" column="ADM_DUTY"/>
- <result property="nodeCode" column="NODE_CODE"/>
- <result property="guid" column="GUID"/>
- <result property="persName" column="PERS_NAME"/>
- <result property="persCode" column="PERS_CODE"/>
- <result property="orgGuid" column="ORG_GUID"/>
- <result property="persType" column="PERS_TYPE"/>
- <result property="sex" column="SEX"/>
- <result property="telnumb" column="TELNUMB"/>
- <result property="faxnumb" column="FAXNUMB"/>
- <result property="mobilenumb" column="MOBILENUMB"/>
- <result property="email" column="EMAIL"/>
- <result property="bornPlac" column="BORN_PLAC"/>
- <result property="bornDate" column="BORN_DATE"/>
- <result property="nation" column="NATION"/>
- <result property="title" column="TITLE"/>
- <result property="school" column="SCHOOL"/>
- <result property="majob" column="MAJOB"/>
- <result property="highDegr" column="HIGH_DEGR"/>
- <result property="wdatetime" column="WDATETIME"/>
- <result property="status" column="STATUS"/>
- <result property="modifier" column="MODIFIER"/>
- <result property="fromDate" column="FROM_DATE"/>
- </resultMap>
- <sql id="table_columns">
- TO_DATE,
- NOTE,
- ADM_DUTY,
- NODE_CODE,
- GUID,
- PERS_NAME,
- PERS_CODE,
- ORG_GUID,
- PERS_TYPE,
- SEX,
- TELNUMB,
- FAXNUMB,
- MOBILENUMB,
- EMAIL,
- BORN_PLAC,
- BORN_DATE,
- NATION,
- TITLE,
- SCHOOL,
- MAJOB,
- HIGH_DEGR,
- WDATETIME,
- STATUS,
- MODIFIER,
- FROM_DATE
- </sql>
- <sql id="entity_properties">
- #{toDate},
- #{note},
- #{admDuty},
- #{nodeCode},
- #{guid},
- #{persName},
- #{persCode},
- #{orgGuid},
- #{persType},
- #{sex},
- #{telnumb},
- #{faxnumb},
- #{mobilenumb},
- #{email},
- #{bornPlac},
- #{bornDate},
- #{nation},
- #{title},
- #{school},
- #{majob},
- #{highDegr},
- #{wdatetime},
- #{status},
- #{modifier},
- #{fromDate}
- </sql>
- <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
- <sql id="page_where">
- <trim prefix="where" prefixOverrides="and | or ">
- <if test="note != null and note != ''">and NOTE = #{note}</if>
- <if test="admDuty != null and admDuty != ''">and ADM_DUTY = #{admDuty}</if>
- <if test="nodeCode != null and nodeCode != ''">and NODE_CODE = #{nodeCode}</if>
- <if test="guid != null and guid != ''">and ORG_GUID = #{guid}</if>
- <if test="persName != null and persName != ''">and PERS_NAME = #{persName}</if>
- <if test="persCode != null and persCode != ''">and PERS_CODE = #{persCode}</if>
- <if test="orgGuid != null and orgGuid != ''">and ORG_GUID = #{orgGuid}</if>
- <if test="persType != null and persType != ''">and PERS_TYPE = #{persType}</if>
- <if test="sex != null and sex != ''">and SEX = #{sex}</if>
- <if test="telnumb != null and telnumb != ''">and TELNUMB = #{telnumb}</if>
- <if test="faxnumb != null and faxnumb != ''">and FAXNUMB = #{faxnumb}</if>
- <if test="mobilenumb != null and mobilenumb != ''">and MOBILENUMB = #{mobilenumb}</if>
- <if test="email != null and email != ''">and EMAIL = #{email}</if>
- <if test="bornPlac != null and bornPlac != ''">and BORN_PLAC = #{bornPlac}</if>
- <if test="bornDate != null">and BORN_DATE = #{bornDate}</if>
- <if test="nation != null and nation != ''">and NATION = #{nation}</if>
- <if test="title != null and title != ''">and TITLE = #{title}</if>
- <if test="school != null and school != ''">and SCHOOL = #{school}</if>
- <if test="majob != null and majob != ''">and MAJOB = #{majob}</if>
- <if test="highDegr != null and highDegr != ''">and HIGH_DEGR = #{highDegr}</if>
- <if test="wdatetime != null">and WDATETIME = #{wdatetime}</if>
- <if test="status != null and status != ''">and STATUS = #{status}</if>
- <if test="modifier != null and modifier != ''">and MODIFIER = #{modifier}</if>
- <if test="fromDate != null">and FROM_DATE = #{fromDate}</if>
- </trim>
- </sql>
- <select id="get" resultMap="attPersBaseResultMap" parameterType="String">
- select
- <include refid="table_columns"/>
- from att_pers_base where GUID = #{id}
- </select>
- <select id="getPers" resultMap="attPersBaseResultMap" parameterType="String">
- select
- t1.TO_DATE,
- t1.NOTE,
- t1.ADM_DUTY,
- t1.NODE_CODE,
- t1.GUID,
- t1.PERS_NAME,
- t1.PERS_CODE,
- t2.ORG_NAME ORG_GUID,
- t1.PERS_TYPE,
- t1.SEX,
- t1.TELNUMB,
- t1.FAXNUMB,
- t1.MOBILENUMB,
- t1.EMAIL,
- t1.BORN_PLAC,
- t1.BORN_DATE,
- t1.NATION,
- t1.TITLE,
- t1.SCHOOL,
- t1.MAJOB,
- t1.HIGH_DEGR,
- t1.WDATETIME,
- t1.STATUS,
- t1.MODIFIER,
- t1.FROM_DATE
- from att_pers_base t1
- left join ATT_ORG_BASE t2 on t1.ORG_GUID=t2.GUID
- where t1.GUID = #{persId}
- </select>
- <select id="getBy" resultMap="attPersBaseResultMap">
- select
- <include refid="table_columns"/>
- from att_pers_base
- <include refid="page_where"/>
- </select>
- <select id="findAll" resultMap="attPersBaseResultMap">
- select
- <include refid="table_columns"/>
- from att_pers_base
- </select>
- <select id="findList" resultMap="attPersBaseResultMap">
- select * from BIS_INSP_ALL_RLATION_PERS WHERE ORG_ID = #{orgGuid}
- <if test="persName != null and persName != ''">and replace(PERS_NAME,' ','') LIKE '%${persName}%'</if>
- </select>
- <select id="selectCount" resultType="int">
- select count(GUID) from att_pers_base
- <include refid="page_where"/>
- </select>
- <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.AttPersBase">
- insert into att_pers_base(
- <include refid="table_columns"/>
- )
- values (
- <include refid="entity_properties"/>
- )
- </insert>
- <delete id="delete" parameterType="java.lang.String">
- delete from att_pers_base where GUID = #{id}
- </delete>
- <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.AttPersBase">
- delete from att_pers_base
- <include refid="page_where"/>
- </delete>
- <update id="deleteInFlag" parameterType="java.lang.String">
- update att_pers_base set flag_valid = 0 where GUID = #{id}
- </update>
- <update id="update" parameterType="cn.com.goldenwater.dcproj.model.AttPersBase">
- update att_pers_base
- <trim prefix="set" suffixOverrides=",">
- <if test="note != null and note != ''">NOTE = #{note},</if>
- <if test="admDuty != null and admDuty != ''">ADM_DUTY = #{admDuty},</if>
- <if test="nodeCode != null and nodeCode != ''">NODE_CODE = #{nodeCode},</if>
- <if test="guid != null and guid != ''">GUID = #{guid},</if>
- <if test="persName != null and persName != ''">PERS_NAME = #{persName},</if>
- <if test="persCode != null and persCode != ''">PERS_CODE = #{persCode},</if>
- <if test="orgGuid != null and orgGuid != ''">ORG_GUID = #{orgGuid},</if>
- <if test="persType != null and persType != ''">PERS_TYPE = #{persType},</if>
- <if test="sex != null and sex != ''">SEX = #{sex},</if>
- <if test="telnumb != null and telnumb != ''">TELNUMB = #{telnumb},</if>
- <if test="faxnumb != null and faxnumb != ''">FAXNUMB = #{faxnumb},</if>
- <if test="mobilenumb != null and mobilenumb != ''">MOBILENUMB = #{mobilenumb},</if>
- <if test="email != null and email != ''">EMAIL = #{email},</if>
- <if test="bornPlac != null and bornPlac != ''">BORN_PLAC = #{bornPlac},</if>
- <if test="bornDate != null">BORN_DATE = #{bornDate},</if>
- <if test="nation != null and nation != ''">NATION = #{nation},</if>
- <if test="title != null and title != ''">TITLE = #{title},</if>
- <if test="school != null and school != ''">SCHOOL = #{school},</if>
- <if test="majob != null and majob != ''">MAJOB = #{majob},</if>
- <if test="highDegr != null and highDegr != ''">HIGH_DEGR = #{highDegr},</if>
- <if test="wdatetime != null">WDATETIME = #{wdatetime},</if>
- <if test="status != null and status != ''">STATUS = #{status},</if>
- <if test="modifier != null and modifier != ''">MODIFIER = #{modifier},</if>
- <if test="fromDate != null">FROM_DATE = #{fromDate},</if>
- </trim>
- <where>GUID = #{id}</where>
- </update>
- <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.AttPersBase">
- update att_pers_base
- <trim prefix="set" suffixOverrides=",">
- <if test="note != null and note != ''">NOTE = #{note},</if>
- <if test="admDuty != null and admDuty != ''">ADM_DUTY = #{admDuty},</if>
- <if test="nodeCode != null and nodeCode != ''">NODE_CODE = #{nodeCode},</if>
- <if test="guid != null and guid != ''">GUID = #{guid},</if>
- <if test="persName != null and persName != ''">PERS_NAME = #{persName},</if>
- <if test="persCode != null and persCode != ''">PERS_CODE = #{persCode},</if>
- <if test="orgGuid != null and orgGuid != ''">ORG_GUID = #{orgGuid},</if>
- <if test="persType != null and persType != ''">PERS_TYPE = #{persType},</if>
- <if test="sex != null and sex != ''">SEX = #{sex},</if>
- <if test="telnumb != null and telnumb != ''">TELNUMB = #{telnumb},</if>
- <if test="faxnumb != null and faxnumb != ''">FAXNUMB = #{faxnumb},</if>
- <if test="mobilenumb != null and mobilenumb != ''">MOBILENUMB = #{mobilenumb},</if>
- <if test="email != null and email != ''">EMAIL = #{email},</if>
- <if test="bornPlac != null and bornPlac != ''">BORN_PLAC = #{bornPlac},</if>
- <if test="bornDate != null">BORN_DATE = #{bornDate},</if>
- <if test="nation != null and nation != ''">NATION = #{nation},</if>
- <if test="title != null and title != ''">TITLE = #{title},</if>
- <if test="school != null and school != ''">SCHOOL = #{school},</if>
- <if test="majob != null and majob != ''">MAJOB = #{majob},</if>
- <if test="highDegr != null and highDegr != ''">HIGH_DEGR = #{highDegr},</if>
- <if test="wdatetime != null">WDATETIME = #{wdatetime},</if>
- <if test="status != null and status != ''">STATUS = #{status},</if>
- <if test="modifier != null and modifier != ''">MODIFIER = #{modifier},</if>
- <if test="fromDate != null">FROM_DATE = #{fromDate},</if>
- </trim>
- <include refid="page_where"/>
- </update>
- <!-- 提取督察组下人员列表 -->
- <select id="findPerInGroup" resultType="cn.com.goldenwater.dcproj.dto.AttPersGroupDto" parameterType="string">
- select
- A.INSP_GROUP_ID,
- D.INSP_GROUP_NAME,
- TO_CHAR(C.TO_DATE,'YYYY-MM-DD HH24:MI:SS') TO_DATE,
- C.NOTE,
- C.ADM_DUTY,
- C.NODE_CODE,
- C.GUID,
- C.PERS_NAME,
- C.PERS_CODE,
- C.ORG_GUID,
- C.PERS_TYPE,
- C.SEX,
- C.TELNUMB,
- C.FAXNUMB,
- C.MOBILENUMB,
- C.EMAIL,
- C.BORN_PLAC,
- TO_CHAR(C.BORN_DATE,'YYYY-MM-DD') BORN_DATE,
- C.NATION,
- C.TITLE,
- C.SCHOOL,
- C.MAJOB,
- C.HIGH_DEGR,
- TO_CHAR(C.WDATETIME,'YYYY-MM-DD HH24:MI:SS') WDATETIME,
- C.STATUS,
- C.MODIFIER,
- TO_CHAR(C.FROM_DATE,'YYYY-MM-DD HH24:MI:SS') FROM_DATE
- from REL_PERS_INSPGROUP A LEFT JOIN REL_PERS_INSPGROUP B ON A.INSP_GROUP_ID=B.INSP_GROUP_ID
- LEFT JOIN BIS_INSP_GROUP D ON A.INSP_GROUP_ID=D.INSP_GROUP_ID
- LEFT JOIN ATT_PERS_BASE C ON A.PERS_ID=C.GUID
- WHERE B.PERS_ID=#{id}
- </select>
- <select id="findPerDetailInGroup" resultType="cn.com.goldenwater.dcproj.dto.AttPersGroupDto" parameterType="string">
- select
- A.INSP_GROUP_ID,
- A.INSP_GROUP_NAME,
- TO_CHAR(C.TO_DATE,'YYYY-MM-DD HH24:MI:SS') TO_DATE,
- C.NOTE,
- C.ADM_DUTY,
- C.NODE_CODE,
- C.GUID,
- C.PERS_NAME,
- C.PERS_CODE,
- C.ORG_GUID,
- C.PERS_TYPE,
- C.SEX,
- C.TELNUMB,
- C.FAXNUMB,
- C.MOBILENUMB,
- C.EMAIL,
- C.BORN_PLAC,
- TO_CHAR(C.BORN_DATE,'YYYY-MM-DD') BORN_DATE,
- C.NATION,
- C.TITLE,
- C.SCHOOL,
- C.MAJOB,
- C.HIGH_DEGR,
- TO_CHAR(C.WDATETIME,'YYYY-MM-DD HH24:MI:SS') WDATETIME,
- C.STATUS,
- C.MODIFIER,
- TO_CHAR(C.FROM_DATE,'YYYY-MM-DD HH24:MI:SS') FROM_DATE
- FROM
- ATT_PERS_BASE C
- LEFT JOIN REL_PERS_INSPGROUP B ON C.GUID=B.PERS_ID
- LEFT JOIN BIS_INSP_GROUP A ON B.INSP_GROUP_ID=A.INSP_GROUP_ID
- WHERE C.GUID=#{id}
- </select>
- <!--根据组id查询人员表 参数示例 jwW2Wihf5E9X3UC9t45fmSHyffUs2rzI-->
- <select id="getListByInspGroupId" resultType="cn.com.goldenwater.dcproj.model.AttPersBase">
- SELECT A.GUID,
- A.PERS_NAME,
- A.PWD,
- A.SEX,
- A.TELNUMB,
- A.FAXNUMB,
- A.MOBILENUMB,
- A.EMAIL,
- A.BORN_DATE,
- A.ORG_ID,
- A.ORG_NM org_name,
- A.ADM_DUTY,
- A.COLL_TIME,
- A.REMARK,
- A.DPNM,
- A.DPPOST,
- A.IDNM,
- A.PLST,
- A.SCHOOL,
- A.SPECIALTY,
- A.IMGURL,
- A.AGE,
- A.W_UNIT,
- A.IS_WORK,
- A.ID_NUMBER,
- A.BANK,
- A.BANK_NUM,
- A.MOHURD,B.PERTYPE,C.PNM,C.ID FROM BIS_INSP_ALL_RLATION_PERS A LEFT JOIN BIS_INSP_ALL_RLATION B ON A.GUID = B.PERSID
- LEFT JOIN BIS_INSP_ALL C ON B.ID = C.ID
- WHERE B.ID LIKE '${inspGroupId}%' ORDER BY B.ID
- </select>
- <select id="getByInspGroupId" resultType="cn.com.goldenwater.dcproj.model.AttPersBase">
- SELECT A.GUID,
- A.PERS_NAME,
- A.PWD,
- A.SEX,
- A.TELNUMB,
- A.FAXNUMB,
- A.MOBILENUMB,
- A.EMAIL,
- A.BORN_DATE,
- A.ORG_ID,
- A.ORG_NM org_name,
- A.ADM_DUTY,
- A.COLL_TIME,
- A.REMARK,
- A.DPNM,
- A.DPPOST,
- A.IDNM,
- A.PLST,
- A.SCHOOL,
- A.SPECIALTY,
- A.IMGURL,
- A.AGE,
- A.W_UNIT,
- A.IS_WORK,
- A.ID_NUMBER,
- A.BANK,
- A.BANK_NUM,
- A.MOHURD,B.PERTYPE,C.PNM,C.ID FROM BIS_INSP_ALL_RLATION_PERS A LEFT JOIN BIS_INSP_ALL_RLATION B ON A.GUID =
- B.PERSID
- LEFT JOIN BIS_INSP_ALL C ON B.ID = C.ID
- WHERE 1 = 1
- <if test="persName != null and persName != ''">and A.PERS_NAME LIKE concat('%',concat(#{persName},'%'))</if>
- <include refid="choseSql"/>
- <if test='isAll == "0"'>and B.ID = #{inspGroupId}</if>
- <if test='isAll == "1"'>and B.ID LIKE concat(#{inspGroupId},'%')</if>
- ORDER BY B.ID,A.GUID
- </select>
- <select id="getExpertListByInspGroupId" resultType="cn.com.goldenwater.dcproj.model.AttPersBase">
- SELECT A.GUID,
- A.PERS_NAME,
- A.PWD,
- A.SEX,
- A.TELNUMB,
- A.FAXNUMB,
- A.MOBILENUMB,
- A.EMAIL,
- A.BORN_DATE,
- A.ORG_ID,
- A.ORG_NM org_name,
- A.ADM_DUTY,
- A.COLL_TIME,
- A.REMARK,
- A.DPNM,
- A.DPPOST,
- A.IDNM,
- A.PLST,
- A.SCHOOL,
- A.SPECIALTY,
- A.IMGURL,
- A.AGE,
- A.W_UNIT,
- A.IS_WORK,
- A.ID_NUMBER,
- A.BANK,
- A.BANK_NUM,
- A.MOHURD,B.PERTYPE,C.PNM,C.ID FROM BIS_INSP_ALL_RLATION_PERS A LEFT JOIN BIS_INSP_ALL_RLATION B ON A.GUID =
- B.PERSID
- LEFT JOIN BIS_INSP_ALL C ON B.ID = C.ID
- WHERE 1 = 1
- <include refid="choseSql"/>
- and B.ID LIKE concat(#{inspGroupId},'%')
- and B.PERTYPE = '4'
- ORDER BY B.ID,A.GUID
- </select>
- <sql id="choseSql">
- <choose>
- <when test="province !=null and province !=''">
- and B.ad_code=#{province}
- </when>
- <otherwise>
- and B.ad_code is null
- </otherwise>
- </choose>
- </sql>
- <!--根据机构id,组id,name查询列表-->
- <select id="getListByGuidInspGroupIdName" resultType="cn.com.goldenwater.dcproj.model.AttPersBase">
- select GUID
- PERS_NAME,
- PWD,
- SEX,
- TELNUMB,
- FAXNUMB,
- MOBILENUMB,
- EMAIL,
- BORN_DATE,
- ORG_ID,
- ORG_NM org_name,
- ADM_DUTY,
- COLL_TIME,
- REMARK,
- DPNM,
- DPPOST,
- IDNM,
- PLST,
- SCHOOL,
- SPECIALTY,
- IMGURL from BIS_INSP_ALL_RLATION_PERS where guid in (select persid from BIS_INSP_ALL_RLATION where id like concat(#{inspGroupId},'%'))
- </select>
- <!--根据组id,机构id查询不在这个范围内的人员列表-->
- <select id="getListByGuidNotInspGroupId" resultType="cn.com.goldenwater.dcproj.model.AttPersBase">
- select guid,
- pers_name,
- pwd,
- sex,
- telnumb,
- faxnumb,
- mobilenumb,
- email,
- born_date,
- g.org_id,
- org_nm org_name,
- adm_duty,
- coll_time,
- remark,
- dpnm,
- dppost,
- idnm,
- plst,
- school,
- specialty,
- imgurl,
- age,
- w_unit,
- is_work,
- id_number,
- bank,
- bank_num,
- mohurd
- from
- BIS_INSP_ALL_RLATION_PERS s,
- (
- select *
- from bis_insp_pers_org g
- ) g
- where s.guid=g.pers_id
- <if test="orgName != null and orgName != ''">
- AND (org_nm like CONCAT('%', CONCAT(#{orgName}, '%')) or DPNM like CONCAT('%', CONCAT(#{orgName}, '%')) )
- </if>
- and
- guid not in (select persid from BIS_INSP_ALL_RLATION where id=#{inspGroupId} and persid is not null)
- <if test="province != null and province != ''">
- AND S.PROVINCE like CONCAT(#{province}, '%')
- </if>
- AND SUBSTR(S.PROVINCE,5,2)='00'
- <if test="name != null and name != ''">and PERS_NAME LIKE '%${name}%'</if>
- <if test="numb != null and numb != ''">and (IDNM LIKE '%${numb}%' OR MOBILENUMB LIKE '%${numb}%')</if>
- </select>
- </mapper>
|