| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126 |
- <?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="com.goafanti.common.dao.AdminMapper">
- <resultMap id="BaseResultMap" type="com.goafanti.common.model.Admin">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Fri Jun 22 14:12:55 CST 2018.
- -->
- <id column="id" jdbcType="VARCHAR" property="id" />
- <result column="mobile" jdbcType="VARCHAR" property="mobile" />
- <result column="name" jdbcType="VARCHAR" property="name" />
- <result column="password" jdbcType="VARCHAR" property="password" />
- <result column="email" jdbcType="VARCHAR" property="email" />
- <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
- <result column="number" jdbcType="INTEGER" property="number" />
- <result column="province" jdbcType="VARCHAR" property="province" />
- <result column="position" jdbcType="VARCHAR" property="position" />
- <result column="superior_id" jdbcType="VARCHAR" property="superiorId" />
- <result column="city" jdbcType="VARCHAR" property="city" />
- <result column="department_id" jdbcType="VARCHAR" property="departmentId" />
- <result column="status" jdbcType="VARCHAR" property="status" />
- <result column="user_no" jdbcType="VARCHAR" property="userNo" />
- <result column="duty" jdbcType="VARCHAR" property="duty" />
- <result column="district" jdbcType="VARCHAR" property="district" />
- <result column="head_portrait_url" jdbcType="VARCHAR" property="headPortraitUrl" />
- <result column="contact_mobile" jdbcType="VARCHAR" property="contactMobile" />
- <result column="last_login_time" jdbcType="TIMESTAMP" property="lastLoginTime" />
- </resultMap>
- <sql id="Example_Where_Clause">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Fri Jun 22 14:12:55 CST 2018.
- -->
- <where>
- <foreach collection="oredCriteria" item="criteria" separator="or">
- <if test="criteria.valid">
- <trim prefix="(" prefixOverrides="and" suffix=")">
- <foreach collection="criteria.criteria" item="criterion">
- <choose>
- <when test="criterion.noValue">
- and ${criterion.condition}
- </when>
- <when test="criterion.singleValue">
- and ${criterion.condition} #{criterion.value}
- </when>
- <when test="criterion.betweenValue">
- and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
- </when>
- <when test="criterion.listValue">
- and ${criterion.condition}
- <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
- #{listItem}
- </foreach>
- </when>
- </choose>
- </foreach>
- </trim>
- </if>
- </foreach>
- </where>
- </sql>
- <sql id="Update_By_Example_Where_Clause">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Fri Jun 22 14:12:55 CST 2018.
- -->
- <where>
- <foreach collection="example.oredCriteria" item="criteria" separator="or">
- <if test="criteria.valid">
- <trim prefix="(" prefixOverrides="and" suffix=")">
- <foreach collection="criteria.criteria" item="criterion">
- <choose>
- <when test="criterion.noValue">
- and ${criterion.condition}
- </when>
- <when test="criterion.singleValue">
- and ${criterion.condition} #{criterion.value}
- </when>
- <when test="criterion.betweenValue">
- and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
- </when>
- <when test="criterion.listValue">
- and ${criterion.condition}
- <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
- #{listItem}
- </foreach>
- </when>
- </choose>
- </foreach>
- </trim>
- </if>
- </foreach>
- </where>
- </sql>
- <sql id="Base_Column_List">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Fri Jun 22 14:12:55 CST 2018.
- -->
- id, mobile, name, password, email, create_time, number, province, position, superior_id,
- city, department_id, status, user_no, duty, district, head_portrait_url, contact_mobile,
- last_login_time
- </sql>
- <select id="selectByExample" parameterType="com.goafanti.common.model.AdminExample" resultMap="BaseResultMap">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Fri Jun 22 14:12:55 CST 2018.
- -->
- select
- <if test="distinct">
- distinct
- </if>
- <include refid="Base_Column_List" />
- from admin
- <if test="_parameter != null">
- <include refid="Example_Where_Clause" />
- </if>
- <if test="orderByClause != null">
- order by ${orderByClause}
- </if>
- </select>
- <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Fri Jun 22 14:12:55 CST 2018.
- -->
- select
- <include refid="Base_Column_List" />
- from admin
- where id = #{id,jdbcType=VARCHAR}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Fri Jun 22 14:12:55 CST 2018.
- -->
- delete from admin
- where id = #{id,jdbcType=VARCHAR}
- </delete>
- <delete id="deleteByExample" parameterType="com.goafanti.common.model.AdminExample">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Fri Jun 22 14:12:55 CST 2018.
- -->
- delete from admin
- <if test="_parameter != null">
- <include refid="Example_Where_Clause" />
- </if>
- </delete>
- <insert id="insert" parameterType="com.goafanti.common.model.Admin">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Fri Jun 22 14:12:55 CST 2018.
- -->
- insert into admin (id, mobile, name,
- password, email, create_time,
- number, province, position,
- superior_id, city, department_id,
- status, user_no, duty,
- district, head_portrait_url, contact_mobile,
- last_login_time)
- values (#{id,jdbcType=VARCHAR}, #{mobile,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
- #{password,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
- #{number,jdbcType=INTEGER}, #{province,jdbcType=VARCHAR}, #{position,jdbcType=VARCHAR},
- #{superiorId,jdbcType=VARCHAR}, #{city,jdbcType=VARCHAR}, #{departmentId,jdbcType=VARCHAR},
- #{status,jdbcType=VARCHAR}, #{userNo,jdbcType=VARCHAR}, #{duty,jdbcType=VARCHAR},
- #{district,jdbcType=VARCHAR}, #{headPortraitUrl,jdbcType=VARCHAR}, #{contactMobile,jdbcType=VARCHAR},
- #{lastLoginTime,jdbcType=TIMESTAMP})
- </insert>
- <insert id="insertSelective" parameterType="com.goafanti.common.model.Admin">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Fri Jun 22 14:12:55 CST 2018.
- -->
- insert into admin
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">
- id,
- </if>
- <if test="mobile != null">
- mobile,
- </if>
- <if test="name != null">
- name,
- </if>
- <if test="password != null">
- password,
- </if>
- <if test="email != null">
- email,
- </if>
- <if test="createTime != null">
- create_time,
- </if>
- <if test="number != null">
- number,
- </if>
- <if test="province != null">
- province,
- </if>
- <if test="position != null">
- position,
- </if>
- <if test="superiorId != null">
- superior_id,
- </if>
- <if test="city != null">
- city,
- </if>
- <if test="departmentId != null">
- department_id,
- </if>
- <if test="status != null">
- status,
- </if>
- <if test="userNo != null">
- user_no,
- </if>
- <if test="duty != null">
- duty,
- </if>
- <if test="district != null">
- district,
- </if>
- <if test="headPortraitUrl != null">
- head_portrait_url,
- </if>
- <if test="contactMobile != null">
- contact_mobile,
- </if>
- <if test="lastLoginTime != null">
- last_login_time,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null">
- #{id,jdbcType=VARCHAR},
- </if>
- <if test="mobile != null">
- #{mobile,jdbcType=VARCHAR},
- </if>
- <if test="name != null">
- #{name,jdbcType=VARCHAR},
- </if>
- <if test="password != null">
- #{password,jdbcType=VARCHAR},
- </if>
- <if test="email != null">
- #{email,jdbcType=VARCHAR},
- </if>
- <if test="createTime != null">
- #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="number != null">
- #{number,jdbcType=INTEGER},
- </if>
- <if test="province != null">
- #{province,jdbcType=VARCHAR},
- </if>
- <if test="position != null">
- #{position,jdbcType=VARCHAR},
- </if>
- <if test="superiorId != null">
- #{superiorId,jdbcType=VARCHAR},
- </if>
- <if test="city != null">
- #{city,jdbcType=VARCHAR},
- </if>
- <if test="departmentId != null">
- #{departmentId,jdbcType=VARCHAR},
- </if>
- <if test="status != null">
- #{status,jdbcType=VARCHAR},
- </if>
- <if test="userNo != null">
- #{userNo,jdbcType=VARCHAR},
- </if>
- <if test="duty != null">
- #{duty,jdbcType=VARCHAR},
- </if>
- <if test="district != null">
- #{district,jdbcType=VARCHAR},
- </if>
- <if test="headPortraitUrl != null">
- #{headPortraitUrl,jdbcType=VARCHAR},
- </if>
- <if test="contactMobile != null">
- #{contactMobile,jdbcType=VARCHAR},
- </if>
- <if test="lastLoginTime != null">
- #{lastLoginTime,jdbcType=TIMESTAMP},
- </if>
- </trim>
- </insert>
- <select id="countByExample" parameterType="com.goafanti.common.model.AdminExample" resultType="java.lang.Long">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Fri Jun 22 14:12:55 CST 2018.
- -->
- select count(*) from admin
- <if test="_parameter != null">
- <include refid="Example_Where_Clause" />
- </if>
- </select>
- <update id="updateByExampleSelective" parameterType="map">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Fri Jun 22 14:12:55 CST 2018.
- -->
- update admin
- <set>
- <if test="record.id != null">
- id = #{record.id,jdbcType=VARCHAR},
- </if>
- <if test="record.mobile != null">
- mobile = #{record.mobile,jdbcType=VARCHAR},
- </if>
- <if test="record.name != null">
- name = #{record.name,jdbcType=VARCHAR},
- </if>
- <if test="record.password != null">
- password = #{record.password,jdbcType=VARCHAR},
- </if>
- <if test="record.email != null">
- email = #{record.email,jdbcType=VARCHAR},
- </if>
- <if test="record.createTime != null">
- create_time = #{record.createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="record.number != null">
- number = #{record.number,jdbcType=INTEGER},
- </if>
- <if test="record.province != null">
- province = #{record.province,jdbcType=VARCHAR},
- </if>
- <if test="record.position != null">
- position = #{record.position,jdbcType=VARCHAR},
- </if>
- <if test="record.superiorId != null">
- superior_id = #{record.superiorId,jdbcType=VARCHAR},
- </if>
- <if test="record.city != null">
- city = #{record.city,jdbcType=VARCHAR},
- </if>
- <if test="record.departmentId != null">
- department_id = #{record.departmentId,jdbcType=VARCHAR},
- </if>
- <if test="record.status != null">
- status = #{record.status,jdbcType=VARCHAR},
- </if>
- <if test="record.userNo != null">
- user_no = #{record.userNo,jdbcType=VARCHAR},
- </if>
- <if test="record.duty != null">
- duty = #{record.duty,jdbcType=VARCHAR},
- </if>
- <if test="record.district != null">
- district = #{record.district,jdbcType=VARCHAR},
- </if>
- <if test="record.headPortraitUrl != null">
- head_portrait_url = #{record.headPortraitUrl,jdbcType=VARCHAR},
- </if>
- <if test="record.contactMobile != null">
- contact_mobile = #{record.contactMobile,jdbcType=VARCHAR},
- </if>
- <if test="record.lastLoginTime != null">
- last_login_time = #{record.lastLoginTime,jdbcType=TIMESTAMP},
- </if>
- </set>
- <if test="_parameter != null">
- <include refid="Update_By_Example_Where_Clause" />
- </if>
- </update>
- <update id="updateByExample" parameterType="map">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Fri Jun 22 14:12:55 CST 2018.
- -->
- update admin
- set id = #{record.id,jdbcType=VARCHAR},
- mobile = #{record.mobile,jdbcType=VARCHAR},
- name = #{record.name,jdbcType=VARCHAR},
- password = #{record.password,jdbcType=VARCHAR},
- email = #{record.email,jdbcType=VARCHAR},
- create_time = #{record.createTime,jdbcType=TIMESTAMP},
- number = #{record.number,jdbcType=INTEGER},
- province = #{record.province,jdbcType=VARCHAR},
- position = #{record.position,jdbcType=VARCHAR},
- superior_id = #{record.superiorId,jdbcType=VARCHAR},
- city = #{record.city,jdbcType=VARCHAR},
- department_id = #{record.departmentId,jdbcType=VARCHAR},
- status = #{record.status,jdbcType=VARCHAR},
- user_no = #{record.userNo,jdbcType=VARCHAR},
- duty = #{record.duty,jdbcType=VARCHAR},
- district = #{record.district,jdbcType=VARCHAR},
- head_portrait_url = #{record.headPortraitUrl,jdbcType=VARCHAR},
- contact_mobile = #{record.contactMobile,jdbcType=VARCHAR},
- last_login_time = #{record.lastLoginTime,jdbcType=TIMESTAMP}
- <if test="_parameter != null">
- <include refid="Update_By_Example_Where_Clause" />
- </if>
- </update>
- <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.Admin">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Fri Jun 22 14:12:55 CST 2018.
- -->
- update admin
- <set>
- <if test="mobile != null">
- mobile = #{mobile,jdbcType=VARCHAR},
- </if>
- <if test="name != null">
- name = #{name,jdbcType=VARCHAR},
- </if>
- <if test="password != null">
- password = #{password,jdbcType=VARCHAR},
- </if>
- <if test="email != null">
- email = #{email,jdbcType=VARCHAR},
- </if>
- <if test="createTime != null">
- create_time = #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="number != null">
- number = #{number,jdbcType=INTEGER},
- </if>
- <if test="province != null">
- province = #{province,jdbcType=VARCHAR},
- </if>
- <if test="position != null">
- position = #{position,jdbcType=VARCHAR},
- </if>
- <if test="superiorId != null">
- superior_id = #{superiorId,jdbcType=VARCHAR},
- </if>
- <if test="city != null">
- city = #{city,jdbcType=VARCHAR},
- </if>
- <if test="departmentId != null">
- department_id = #{departmentId,jdbcType=VARCHAR},
- </if>
- <if test="status != null">
- status = #{status,jdbcType=VARCHAR},
- </if>
- <if test="userNo != null">
- user_no = #{userNo,jdbcType=VARCHAR},
- </if>
- <if test="duty != null">
- duty = #{duty,jdbcType=VARCHAR},
- </if>
- <if test="district != null">
- district = #{district,jdbcType=VARCHAR},
- </if>
- <if test="headPortraitUrl != null">
- head_portrait_url = #{headPortraitUrl,jdbcType=VARCHAR},
- </if>
- <if test="contactMobile != null">
- contact_mobile = #{contactMobile,jdbcType=VARCHAR},
- </if>
- <if test="lastLoginTime != null">
- last_login_time = #{lastLoginTime,jdbcType=TIMESTAMP},
- </if>
- </set>
- where id = #{id,jdbcType=VARCHAR}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.Admin">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Fri Jun 22 14:12:55 CST 2018.
- -->
- update admin
- set mobile = #{mobile,jdbcType=VARCHAR},
- name = #{name,jdbcType=VARCHAR},
- password = #{password,jdbcType=VARCHAR},
- email = #{email,jdbcType=VARCHAR},
- create_time = #{createTime,jdbcType=TIMESTAMP},
- number = #{number,jdbcType=INTEGER},
- province = #{province,jdbcType=VARCHAR},
- position = #{position,jdbcType=VARCHAR},
- superior_id = #{superiorId,jdbcType=VARCHAR},
- city = #{city,jdbcType=VARCHAR},
- department_id = #{departmentId,jdbcType=VARCHAR},
- status = #{status,jdbcType=VARCHAR},
- user_no = #{userNo,jdbcType=VARCHAR},
- duty = #{duty,jdbcType=VARCHAR},
- district = #{district,jdbcType=VARCHAR},
- head_portrait_url = #{headPortraitUrl,jdbcType=VARCHAR},
- contact_mobile = #{contactMobile,jdbcType=VARCHAR},
- last_login_time = #{lastLoginTime,jdbcType=TIMESTAMP}
- where id = #{id,jdbcType=VARCHAR}
- </update>
-
-
- <select id="selectAllAdmin" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from admin
- where status !='锁定'
- <if test="depId != null">
- and department_id = #{depId,jdbcType=VARCHAR}
- </if>
- </select>
-
- <select id="selectByMobile" parameterType="java.lang.String" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from admin
- where mobile = #{mobile,jdbcType=VARCHAR}
- </select>
-
- <select id="selectRolesByPrimaryKey" parameterType="java.lang.String">
- select r.name, r.id, r.type
- from role r
- left join user_role ur on ur.rid=r.id
- where ur.uid = #{uid,jdbcType=VARCHAR}
- </select>
-
- <select id="selectCognizanceConsultant" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from admin
- where id <![CDATA[ <> ]]> '1'
- </select>
-
- <select id="selectCognizancePrincipal" resultMap="BaseResultMap">
- select a.id, a.name, a.position from admin a
- INNER JOIN user_role ur on a.id = ur.uid
- where ur.rid not in('1','2','3','4','5','6')
- group by a.id
- </select>
-
- <select id="selectPatentAuthor" resultMap="BaseResultMap">
- select a.id, a.name, a.position from admin a
- INNER JOIN user_role ur on a.id = ur.uid
- where ur.rid not in('1','2','3','4','5','6')
- group by a.id
- </select>
-
- <select id="selectPatentPrincipal" resultMap="BaseResultMap">
- select a.id, a.name, a.position from admin a
- INNER JOIN user_role ur on a.id = ur.uid
- where ur.rid not in('1','2','3','4','5','6')
- group by a.id
- </select>
-
- <select id="selectCopyrightConsultant" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from admin
- where id <![CDATA[ <> ]]> '1'
- </select>
-
- <select id="selectCopyrightPrincipal" resultMap="BaseResultMap">
- select a.id, a.name, a.position from admin a
- INNER JOIN user_role ur on a.id = ur.uid
- where ur.rid not in('1','2','3','4','5','6')
- group by a.id
- </select>
-
- <select id="selectTechprojectConsultant" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from admin
- where id <![CDATA[ <> ]]> '1'
- </select>
-
- <select id="selectTechprojectPrincipal" resultMap="BaseResultMap">
- select a.id, a.name, a.position from admin a
- INNER JOIN user_role ur on a.id = ur.uid
- where ur.rid not in('1','2','3','4','5','6')
- group by a.id
- </select>
-
- <select id="selectRoleByPrimaryKey" parameterType="java.lang.String" resultType="String">
- SELECT rid FROM user_role
- where uid = #{uid,jdbcType=VARCHAR}
- </select>
-
- <select id="selectAccoutManager" resultMap="BaseResultMap">
- select a.id, a.name, a.position from admin a
- INNER JOIN user_role ur on a.id = ur.uid
- where ur.rid = '4'
- </select>
-
- <select id="selectTechnician" resultMap="BaseResultMap">
- select a.id, a.name, a.position from admin a
- INNER JOIN user_role ur on a.id = ur.uid
- where ur.rid not in('1','2','3','4')
- group by a.id
- </select>
-
- <select id="selectSalesman" resultMap="BaseResultMap">
- select a.id, a.name, a.position from admin a
- INNER JOIN user_role ur on a.id = ur.uid
- where ur.rid in ('5', '6')
- </select>
-
- <select id="selectContractManager" resultMap="BaseResultMap">
- select a.id, a.name, a.position from admin a
- INNER JOIN user_role ur on a.id = ur.uid
- where ur.rid not in('1','2','3','4')
- group by a.id
- </select>
-
- <select id="selectTechBroder" resultMap="BaseResultMap">
- select
- u.rid as rolesId, a.name,a.id, a.position
- from user_role u
- left join admin a on a.id =u.uid
- left join role r on r.id =u.rid
- where
- r.role_name='技术经纪专员'
- </select>
-
- <select id="listAdminSelectBySuperAdmin" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from admin
- where id <![CDATA[ <> ]]> '1'
- </select>
-
- <select id="listAdminSelectByAreaAdmin" resultMap="BaseResultMap">
- select
- a.id, a.name, a.mobile,
- a.create_time as createTime, a.number, aa.name as superior
- from admin a
- left join admin_location al on al.admin_id = a.id
- left join admin aa on aa.id = a.superior_id
- where 1 = 1
- <if test="provinceList != null and provinceList.size > 0">
- and al.province in
- <foreach close=")" collection="provinceList" item="plist" open="(" separator=",">
- #{plist}
- </foreach>
- </if>
- <if test="cityList != null and cityList.size > 0">
- and al.city in
- <foreach close=")" collection="cityList" item="clist" open="(" separator=",">
- #{clist}
- </foreach>
- </if>
- </select>
-
- <select id="findAdminListByPage" parameterType="java.lang.String" resultType="com.goafanti.admin.bo.AdminListBo">
- select
- a.number, a.mobile, a.name,
- a.position, a.email, a.id,
- a.province,
- a.city,
- a.create_time as createTime,
- aa.name as superior,
- a.superior_id as superiorId,
- a.department_id as departmentId,
- date_format(a.last_login_time,'%Y-%m-%d %H:%i:%S') as lastLoginTime,
- dm.name as departmentName
- from admin a
- left join admin_location al on a.id = al.admin_id
- left join admin aa on aa.id = a.superior_id
- left join department dm on a.department_id = dm.id
- left join user_role x on x.uid=a.id
- left join `role` y on x.rid=y.id
- where a.id <![CDATA[ <> ]]> '1'
- <if test="roleName != null">
- where y.role_name= #{roleName,jdbcType=VARCHAR}
- </if>
- <if test="mobile != null">
- and a.mobile = #{mobile,jdbcType=VARCHAR}
- </if>
- <if test="name != null">
- and a.name = #{name,jdbcType=VARCHAR}
- </if>
- <if test="number != null">
- and a.number = #{number,jdbcType=INTEGER}
- </if>
- <if test="province != null">
- and a.province = #{province,jdbcType=VARCHAR}
- </if>
- order by a.last_login_time ,a.number
- <if test="page_sql!=null">
- ${page_sql}
- </if>
- </select>
-
- <select id="findAdminCount" parameterType="java.lang.String" resultType="java.lang.Integer">
- select count(1) from admin
- where id <![CDATA[ <> ]]> '1'
- left join `role` y on x.rid=y.id
- where a.id <![CDATA[ <> ]]> '1'
- <if test="roleName != null">
- where y.role_name= #{roleName,jdbcType=VARCHAR}
- </if>
- <if test="mobile != null">
- and mobile = #{mobile,jdbcType=VARCHAR}
- </if>
- <if test="name != null">
- and name = #{name,jdbcType=VARCHAR}
- </if>
- <if test="number != null">
- and number = #{number,jdbcType=INTEGER}
- </if>
- <if test="province != null">
- and a.province = #{province,jdbcType=VARCHAR}
- </if>
- </select>
-
- <select id="listAdminByName" parameterType="java.lang.String" resultMap="BaseResultMap">
- select id,name from admin where name like concat('%',#{name},'%')
- </select>
- <!--*************************************************************************-->
- <select id="selectAdminListByPage" parameterType="java.lang.String" resultType="com.goafanti.admin.bo.AdminListBo">
- select x.*,y.name as departmentName from(select
- <!-- a.user_no as userNo, -->
- a.mobile, a.name,
- a.position, a.email, a.id,
- a.province,
- a.city,
- a.create_time as createTime,
- aa.name as superior,
- a.superior_id as superiorId,
- a.department_id as departmentId,
- a.last_login_time as lastLoginTime,
- a.contact_mobile as contactMobile,
- a.duty,a.status
- from admin a
- left join admin_location al on a.id = al.admin_id
- left join admin aa on aa.id = a.superior_id
- left join user_role ur on a.id=ur.uid
- left join `role` y on ur.rid=y.id
- where a.id <![CDATA[ <> ]]> '1'
- and (a.status != '注销' or a.status is null)
- <if test="roleName != null">
- and y.role_name= #{roleName,jdbcType=VARCHAR}
- </if>
- <if test="name != null">
- and a.name like concat('%',#{name,jdbcType=VARCHAR},'%')
- </if>
- <if test="departmentId != null">
- and a.department_id = #{departmentId,jdbcType=VARCHAR}
- </if>
- <if test="rid != null">
- and ur.rid = #{rid,jdbcType=VARCHAR}
- </if>
- <if test="duty != null">
- and a.duty = #{duty,jdbcType=VARCHAR}
- </if>
- <if test="position != null">
- and a.position = #{position,jdbcType=VARCHAR}
- </if>
- <if test="status != null">
- and a.status = #{status,jdbcType=VARCHAR}
- </if>
- <if test="mobile != null">
- and a.mobile = #{mobile,jdbcType=VARCHAR}
- </if>
- <if test="superiorId != null">
- and a.superior_id = #{superiorId,jdbcType=VARCHAR}
- </if>
- group by a.id
- order by a.last_login_time,a.number )x left join department y on x.departmentId = y.id
- <if test="page_sql!=null">
- ${page_sql}
- </if>
- </select>
- <select id="selectAdminCount" parameterType="java.lang.String" resultType="java.lang.Integer">
- select count(t.counts)
- from(select a.id counts from (select a.id from admin a
- left join user_role ur on a.id=ur.uid
- left join `role` y on ur.rid=y.id
- where a.id <![CDATA[ <> ]]> '1'
- and (a.status != '注销' or a.status is null)
- <if test="roleName != null">
- and y.role_name= #{roleName,jdbcType=VARCHAR}
- </if>
- <if test="name != null">
- and a.name like concat('%',#{name,jdbcType=VARCHAR},'%')
- </if>
- <if test="departmentId != null">
- and a.department_id = #{departmentId,jdbcType=VARCHAR}
- </if>
- <if test="rid != null">
- and ur.rid = #{rid,jdbcType=VARCHAR}
- </if>
- <if test="duty != null">
- and a.duty = #{duty,jdbcType=VARCHAR}
- </if>
- <if test="position != null">
- and a.position = #{position,jdbcType=VARCHAR}
- </if>
- <if test="status != null">
- and a.status = #{status,jdbcType=VARCHAR}
- </if>
- <if test="mobile != null">
- and a.mobile = #{mobile,jdbcType=VARCHAR}
- </if>
- <if test="superiorId != null">
- and a.superior_id = #{superiorId,jdbcType=VARCHAR}
- </if>
- )a
- group by a.id)t
- </select>
- <insert id="insertn" parameterType="com.goafanti.common.model.Admin">
- insert into admin (id, mobile, name,
- password, email, create_time,
- number, province, position, superior_id, city,department_id,status,user_no,duty,district,head_portrait_url,contact_mobile)
- values (#{id,jdbcType=VARCHAR}, #{mobile,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
- #{password,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
- #{number,jdbcType=INTEGER}, #{province,jdbcType=INTEGER}, #{position,jdbcType=VARCHAR},
- #{superiorId,jdbcType=VARCHAR}, #{city,jdbcType=INTEGER},#{departmentId,jdbcType=VARCHAR},
- #{status,jdbcType=VARCHAR},#{userNo,jdbcType=VARCHAR},#{duty,jdbcType=VARCHAR},#{district,jdbcType=VARCHAR},#{headPortraitUrl,jdbcType=VARCHAR},#{contactMobile,jdbcType=VARCHAR}
- )
- </insert>
- <select id="selectUserNoBySuperiorId" parameterType="java.lang.String" resultType="java.lang.String">
- select
- user_no as userNo
- from admin
- where
- id=#{superiorId,jdbcType=VARCHAR}
- </select>
- <select id="selectCountBySuperiorId" parameterType="java.lang.String" resultType="java.lang.Integer">
- select
- count(1)
- from admin
- where
- superior_id=#{superiorId,jdbcType=VARCHAR}
- </select>
- <select id="selectIdByUserNo" parameterType="java.lang.String" resultType="java.lang.String">
- select
- id
- from admin
- where
- user_no=#{UserNo,jdbcType=VARCHAR}
- </select>
- <select id="selectAllByid" parameterType="java.lang.String" resultType="com.goafanti.common.model.Admin">
- select
- id, mobile, name,
- password, email, create_time as createTime,
- province, position,
- superior_id as superiorId,department_id as departmentId,
- status,user_no as userNo,duty,district,head_portrait_url as headPortraitUrl,
- contact_mobile as contactMobile
- from admin
- where
- id=#{id,jdbcType=VARCHAR}
- </select>
- <select id="selectNameByid" parameterType="java.lang.String" resultType="java.lang.String">
- select
- name
- from admin
- where
- id=#{id,jdbcType=VARCHAR}
- </select>
- <select id="selectRolesByUid" parameterType="java.lang.String" resultType="java.lang.String">
- select
- r.role_name as roles
- from user_role ur
- left join role r on r.id = ur.rid
- where
- uid=#{id,jdbcType=VARCHAR}
- </select>
- <select id="selectRolesIdByUid" parameterType="java.lang.String" resultType="java.lang.String">
- select
- rid as rolesId
- from user_role
- where
- uid=#{id,jdbcType=VARCHAR}
- </select>
- <select id="selectStatusByMobile" parameterType="java.lang.String" resultType="java.lang.String">
- select
- status
- from admin
- where
- mobile= #{mobile,jdbcType=VARCHAR}
- </select>
- <delete id="deleteById" parameterType="java.lang.String">
- delete from admin
- where id = #{id,jdbcType=VARCHAR}
- </delete>
-
- <select id="selectIDNBySuperiorId" parameterType="java.lang.String" resultType="com.goafanti.common.model.Admin">
- select id, mobile, name,
- password, email, create_time as createTime,
- province, position,
- superior_id as superiorId,department_id as departmentId,
- status,user_no as userNo,duty,district,head_portrait_url as headPortraitUrl
- from admin
- where
- superior_id=#{superiorId,jdbcType=VARCHAR}
- </select>
- <select id="selectUserNoById" resultType="java.lang.String">
- select user_no as userNo
- from admin
- where
- id=#{superiorId,jdbcType=VARCHAR}
- </select>
- <update id="updateByUserNo" parameterType="com.goafanti.common.model.Admin">
- update admin
- set user_no = #{userNo,jdbcType=VARCHAR}
- where
- id=#{id,jdbcType=VARCHAR}
- </update>
- <select id="selectIdBySuperiorId" parameterType="java.lang.String" resultType="java.lang.String">
- select id
- from admin
- where
- superior_id=#{superiorId,jdbcType=VARCHAR}
- </select>
-
- <select id="selectSubList" parameterType="java.lang.String" resultType="com.goafanti.admin.bo.AdminListBo">
- select
- a.id,
- a.user_no as userNo,
- a.mobile,
- a.name,
- a.position,
- b.name as departmentName
- from
- admin a left join department b on
- a.department_id = b.id
- where
- a.department_id =(
- select
- department_id
- from
- admin
- where
- id = #{adminId,jdbcType=VARCHAR}
- )
- and a.id <![CDATA[ <> ]]> #{adminId,jdbcType=VARCHAR}
- </select>
-
- <select id="selectAdminByRoleId" parameterType="java.lang.String" resultMap="BaseResultMap">
- select a.id,a.name from admin a left join user_role b on a.id = b.uid left join role c on b.rid = c.id where c.id = #{roleId,jdbcType=VARCHAR} limit 1
- </select>
-
- <select id="selectDepartmentStaff" parameterType="java.lang.String" resultType="com.goafanti.admin.bo.AdminListBo">
- select a.id ,a.name,a.password,a.department_id,b.name
- from admin a left join department b
- on a.department_id= b.id
- where 1=1
- <if test="departmentId != null and departmentId !='' ">
- and a.department_id = #{departmentId,jdbcType=VARCHAR}
- </if>
- <if test="name != null">
- and a.name like concat('%',#{name,jdbcType=VARCHAR},'%')
- </if>
-
- </select>
- <select id="selectAdminName" parameterType="java.lang.String" resultMap="BaseResultMap">
- select a.id, a.name from admin a left join user_role b on a.id=b.uid
- left join `role` c on b.rid=c.id
- where c.role_name = #{name,jdbcType=VARCHAR}
- </select>
- <update id="updateLockIds" parameterType="java.lang.String">
- update admin set status = '锁定' where id in (${lockIds})
- </update>
-
- <!-- 用户是为正常的 -->
- <select id="getCountById" parameterType="java.lang.String" resultType="java.lang.Integer">
- select count(a.id) from admin a
- inner join user_role ur on a.id=ur.uid
- where a.id= #{_parameter,jdbcType=VARCHAR} and ( a.status != '注销' or a.status is null)
- </select>
- <select id="getAdminRoleList" parameterType="java.lang.String" resultMap="BaseResultMap">
- select a.id, a.name from admin a left join user_role b on a.id=b.uid
- left join `role` c on b.rid=c.id
- where c.role_name = #{name,jdbcType=VARCHAR}
- </select>
- <!-- 获得当前登录人的名字和部门名 -->
- <select id="getDeptNameByAid" parameterType="java.lang.String" resultType="com.goafanti.admin.bo.AdminListBo">
- select a.name, d.name as departmentName from admin a
- left join department d on a.department_id = d.id
- where a.id = #{_parameter,jdbcType=VARCHAR}
- </select>
-
- <insert id="addAdminContacts" parameterType="com.goafanti.admin.bo.AdminContacts">
- insert into admin_contacts (id,aid,contacts_id)values
- (#{id,jdbcType=VARCHAR},#{aid,jdbcType=VARCHAR},#{contactsId,jdbcType=VARCHAR})
- </insert>
-
- <select id="frequentContactsList" parameterType="java.lang.String" resultType="com.goafanti.admin.bo.AdminListBo">
- select a.id,b.id as contactId,b.name,b.position,b.contact_mobile as contactMobile,c.name as departmentName,y.role_name as roleName
- from admin_contacts a left join admin b
- on a.contacts_id=b.id left join department c
- on c.id=b.department_id left join user_role x on x.uid=b.id
- left join `role` y on x.rid=y.id
- where b.status ='正常'
- <if test="roleName != null">
- and y.role_name= #{roleName,jdbcType=VARCHAR}
- </if>
- <if test="aid != null">
- and a.aid= #{aid,jdbcType=VARCHAR}
- </if>
- <if test="name != null">
- and b.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
- </if>
- <if test="depId != null">
- and b.department_id= #{depId,jdbcType=VARCHAR}
- </if>
- <if test="page_sql!=null">
- ${page_sql}
- </if>
- </select>
-
- <select id="frequentContactsCount" parameterType="java.lang.String" resultType="java.lang.Integer">
- select count(*)
- from admin_contacts a left join admin b
- on a.contacts_id=b.id
- left join user_role x on x.uid=b.id
- left join `role` y on x.rid=y.id
- where b.status ='正常'
- <if test="roleName != null">
- and y.role_name= #{roleName,jdbcType=VARCHAR}
- </if>
- <if test="aid != null">
- and a.aid= #{aid,jdbcType=VARCHAR}
- </if>
- <if test="name != null">
- and b.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
- </if>
- <if test="depId != null">
- and b.department_id= #{depId,jdbcType=VARCHAR}
- </if>
- </select>
-
- <delete id="deleteFrequentContacts" parameterType="java.lang.String">
- delete from admin_contacts
- where id = #{id,jdbcType=VARCHAR}
- </delete>
- <select id="getaidFrequentContacts" resultType="java.lang.String">
- select b.id from admin_contacts a left join admin b on a.contacts_id = b.id
- where b.status = '正常' and a.aid= #{id,jdbcType=VARCHAR}
- </select>
-
-
- <select id="selectAdminCustomerList" parameterType="java.lang.String" resultType="com.goafanti.admin.bo.AdminCustomerBo">
- select a.id as aid,a.name as aName,d.name as depName,ifnull(b.userCount,0) as userCount,ifnull(c.timeCount,0) as timeCount from admin a
- left join (select aid,count(aid) as userCount from user where aid is not null
- and share_type=0 and source !=0
- group by aid) b on a.id=b.aid
- left join (select aid,count(aid) as timeCount from user where aid is not null
- and share_type=0 and source=1
- <if test="startTime != null and endTime != null">
- and create_time between #{startTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
- </if>
- group by aid) c on a.id=c.aid
- left join department d on a.department_id=d.id
- where a.status='正常'
- and b.userCount !=0
- <if test="depId != null">
- and a.department_id = #{depId,jdbcType=VARCHAR}
- </if>
- <if test="page_sql!=null">
- ${page_sql}
- </if>
- </select>
-
- <select id="selectAdminCustomerCount" parameterType="java.lang.String" resultType="java.lang.Integer">
- select count(*) from admin a
- left join (select aid,count(aid) as userCount from user where aid is not null
- and share_type=0 and source !=0
- group by aid) b on a.id=b.aid
- left join (select aid,count(aid) as timeCount from user where aid is not null
- and share_type=0 and source=1
- <if test="startTime != null and endTime != null">
- and create_time between #{startTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
- </if>
- group by aid) c on a.id=c.aid
- where a.status='正常'
- and b.userCount !=0
- <if test="depId != null">
- and a.department_id = #{depId,jdbcType=VARCHAR}
- </if>
- </select>
-
- <select id="selectAdminCustomerDetailList" parameterType="java.lang.String" resultType="com.goafanti.admin.bo.AdminCustomerDetailBo">
- select a.id,a.nickname as name,c.contacts,c.contact_mobile as contactMobile,
- a.create_time as createTime,b.time_stamp as followTime
- from user a
- left join (select uid,max(time_stamp) as time_stamp from user_follow group by uid) b on a.id=b.uid
- left join organization_identity c on a.id=c.uid
- where a.aid is not null
- <if test="aid != null">
- and a.aid= #{aid,jdbcType=VARCHAR}
- </if>
- and a.share_type=0 and a.source=1
- <if test="startTime != null and endTime != null">
- and a.create_time between #{startTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
- </if>
- <if test="page_sql!=null">
- ${page_sql}
- </if>
- </select>
-
- <select id="selectAdminCustomerDetailCount" parameterType="java.lang.String" resultType="java.lang.Integer">
- select count(*) from user a
- left join (select uid,max(time_stamp) as time_stamp from user_follow group by uid) b on a.id=b.uid
- left join organization_identity c on a.id=c.uid
- where a.aid is not null
- <if test="aid != null">
- and a.aid= #{aid,jdbcType=VARCHAR}
- </if>
- and a.share_type=0 and a.source=1
- <if test="startTime != null and endTime != null">
- and a.create_time between #{startTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
- </if>
- </select>
- </mapper>
|