|
|
@@ -1,302 +1,248 @@
|
|
|
<?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">
|
|
|
+<!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">
|
|
|
- <id property="id" column="id" jdbcType="VARCHAR"/>
|
|
|
- <result property="mobile" column="mobile" jdbcType="VARCHAR"/>
|
|
|
- <result property="name" column="name" jdbcType="VARCHAR"/>
|
|
|
- <result property="password" column="password" jdbcType="VARCHAR"/>
|
|
|
- <result property="email" column="email" jdbcType="VARCHAR"/>
|
|
|
- <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
|
|
- <result property="number" column="number" jdbcType="INTEGER"/>
|
|
|
- <result property="province" column="province" jdbcType="VARCHAR"/>
|
|
|
- <result property="position" column="position" jdbcType="VARCHAR"/>
|
|
|
- <result property="superiorId" column="superior_id" jdbcType="VARCHAR"/>
|
|
|
- <result property="city" column="city" jdbcType="VARCHAR"/>
|
|
|
- <result property="departmentId" column="department_id" jdbcType="VARCHAR"/>
|
|
|
- <result property="status" column="status" jdbcType="VARCHAR"/>
|
|
|
- <result property="userNo" column="user_no" jdbcType="VARCHAR"/>
|
|
|
- <result property="duty" column="duty" jdbcType="VARCHAR"/>
|
|
|
- <result property="district" column="district" jdbcType="VARCHAR"/>
|
|
|
- <result property="headPortraitUrl" column="head_portrait_url" jdbcType="VARCHAR"/>
|
|
|
- <result property="contactMobile" column="contact_mobile" jdbcType="VARCHAR"/>
|
|
|
- <result property="lastLoginTime" column="last_login_time" jdbcType="TIMESTAMP"/>
|
|
|
- <result property="openId" column="open_id" jdbcType="VARCHAR"/>
|
|
|
- <result property="type" column="type" jdbcType="INTEGER"/>
|
|
|
- <result property="reviewer" column="reviewer" jdbcType="VARCHAR"/>
|
|
|
- <result property="ambId" column="amb_id" jdbcType="VARCHAR"/>
|
|
|
- <result property="ambRole" column="amb_role" jdbcType="VARCHAR"/>
|
|
|
- <result property="ambManage" column="amb_manage" jdbcType="INTEGER"/>
|
|
|
- <result property="managerId" column="manager_id" jdbcType="VARCHAR"/>
|
|
|
- <result property="seniorStaff" column="senior_staff" jdbcType="INTEGER"/>
|
|
|
- <result property="publicPurview" column="public_purview" jdbcType="INTEGER"/>
|
|
|
- <result property="expenseOpenId" column="expense_open_id" jdbcType="VARCHAR"/>
|
|
|
- <result property="expenseSuperExamine" column="expense_super_examine" jdbcType="INTEGER"/>
|
|
|
- <result property="publicCarbonCopy" column="public_carbon_copy" jdbcType="VARCHAR"/>
|
|
|
+ <resultMap type="com.goafanti.common.model.Admin" id="AdminMap">
|
|
|
+ <result property="id" column="id" jdbcType="VARCHAR"/>
|
|
|
+ <result property="mobile" column="mobile" jdbcType="VARCHAR"/>
|
|
|
+ <result property="name" column="name" jdbcType="VARCHAR"/>
|
|
|
+ <result property="password" column="password" jdbcType="VARCHAR"/>
|
|
|
+ <result property="email" column="email" jdbcType="VARCHAR"/>
|
|
|
+ <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
|
|
+ <result property="number" column="number" jdbcType="INTEGER"/>
|
|
|
+ <result property="province" column="province" jdbcType="VARCHAR"/>
|
|
|
+ <result property="position" column="position" jdbcType="VARCHAR"/>
|
|
|
+ <result property="superiorId" column="superior_id" jdbcType="VARCHAR"/>
|
|
|
+ <result property="city" column="city" jdbcType="VARCHAR"/>
|
|
|
+ <result property="departmentId" column="department_id" jdbcType="VARCHAR"/>
|
|
|
+ <result property="status" column="status" jdbcType="VARCHAR"/>
|
|
|
+ <result property="userNo" column="user_no" jdbcType="VARCHAR"/>
|
|
|
+ <result property="duty" column="duty" jdbcType="VARCHAR"/>
|
|
|
+ <result property="district" column="district" jdbcType="VARCHAR"/>
|
|
|
+ <result property="headPortraitUrl" column="head_portrait_url" jdbcType="VARCHAR"/>
|
|
|
+ <result property="contactMobile" column="contact_mobile" jdbcType="VARCHAR"/>
|
|
|
+ <result property="lastLoginTime" column="last_login_time" jdbcType="TIMESTAMP"/>
|
|
|
+ <result property="openId" column="open_id" jdbcType="VARCHAR"/>
|
|
|
+ <result property="type" column="type" jdbcType="INTEGER"/>
|
|
|
+ <result property="reviewer" column="reviewer" jdbcType="VARCHAR"/>
|
|
|
+ <result property="ambId" column="amb_id" jdbcType="VARCHAR"/>
|
|
|
+ <result property="ambRole" column="amb_role" jdbcType="VARCHAR"/>
|
|
|
+ <result property="ambManage" column="amb_manage" jdbcType="INTEGER"/>
|
|
|
+ <result property="managerId" column="manager_id" jdbcType="VARCHAR"/>
|
|
|
+ <result property="seniorStaff" column="senior_staff" jdbcType="INTEGER"/>
|
|
|
+ <result property="publicPurview" column="public_purview" jdbcType="INTEGER"/>
|
|
|
+ <result property="expenseOpenId" column="expense_open_id" jdbcType="VARCHAR"/>
|
|
|
+ <result property="expenseSuperExamine" column="expense_super_examine" jdbcType="INTEGER"/>
|
|
|
+ <result property="publicCarbonCopy" column="public_carbon_copy" jdbcType="VARCHAR"/>
|
|
|
+ <result property="callNo" column="call_no" jdbcType="VARCHAR"/>
|
|
|
</resultMap>
|
|
|
|
|
|
- <sql id="Base_Column_List">
|
|
|
- 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,open_id,type,
|
|
|
- reviewer,amb_id,amb_role,
|
|
|
- amb_manage,manager_id,senior_staff,
|
|
|
- public_purview,expense_open_id,expense_super_examine,
|
|
|
- public_carbon_copy
|
|
|
+ <sql id="AdminAllSql">
|
|
|
+ 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, open_id, type, reviewer, amb_id, amb_role, amb_manage, manager_id, senior_staff, public_purview, expense_open_id, expense_super_examine, public_carbon_copy, call_no
|
|
|
</sql>
|
|
|
|
|
|
- <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
|
|
|
+ <!--查询单个-->
|
|
|
+ <select id="queryById" resultMap="AdminMap">
|
|
|
select
|
|
|
- <include refid="Base_Column_List" />
|
|
|
+ <include refid="AdminAllSql"/>
|
|
|
from admin
|
|
|
- where id = #{id,jdbcType=VARCHAR}
|
|
|
- </select>
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!--新增所有列-->
|
|
|
+ <insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
|
|
+ insert into admin(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, open_id, type, reviewer, amb_id, amb_role, amb_manage, manager_id,
|
|
|
+ senior_staff, public_purview, expense_open_id, expense_super_examine, public_carbon_copy,
|
|
|
+ call_no)
|
|
|
+ values (#{mobile}, #{name}, #{password}, #{email}, #{createTime}, #{number}, #{province}, #{position},
|
|
|
+ #{superiorId}, #{city}, #{departmentId}, #{status}, #{userNo}, #{duty}, #{district}, #{headPortraitUrl},
|
|
|
+ #{contactMobile}, #{lastLoginTime}, #{openId}, #{type}, #{reviewer}, #{ambId}, #{ambRole}, #{ambManage},
|
|
|
+ #{managerId}, #{seniorStaff}, #{publicPurview}, #{expenseOpenId}, #{expenseSuperExamine},
|
|
|
+ #{publicCarbonCopy}, #{callNo})
|
|
|
+ </insert>
|
|
|
|
|
|
- <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
|
|
|
- delete from admin
|
|
|
- where id = #{id,jdbcType=VARCHAR}
|
|
|
- </delete>
|
|
|
- <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.Admin" useGeneratedKeys="true">
|
|
|
- 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,open_id,type
|
|
|
- ,reviewer,amb_id,amb_role
|
|
|
- ,amb_manage,manager_id,senior_staff
|
|
|
- ,public_purview,expense_open_id,expense_super_examine
|
|
|
- ,public_carbon_copy)
|
|
|
- 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},#{openId,jdbcType=VARCHAR},#{type,jdbcType=INTEGER}
|
|
|
- ,#{reviewer,jdbcType=VARCHAR},#{ambId,jdbcType=VARCHAR},#{ambRole,jdbcType=VARCHAR}
|
|
|
- ,#{ambManage,jdbcType=INTEGER},#{managerId,jdbcType=VARCHAR},#{seniorStaff,jdbcType=INTEGER}
|
|
|
- ,#{publicPurview,jdbcType=INTEGER},#{expenseOpenId,jdbcType=VARCHAR},#{expenseSuperExamine,jdbcType=INTEGER}
|
|
|
- ,#{publicCarbonCopy,jdbcType=VARCHAR})
|
|
|
+ <insert id="insertBatch">
|
|
|
+ insert into admin(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, open_id,
|
|
|
+ type, reviewer, amb_id, amb_role, amb_manage, manager_id, senior_staff, public_purview, expense_open_id,
|
|
|
+ expense_super_examine, public_carbon_copy, call_no)
|
|
|
+ values
|
|
|
+ <foreach collection="entities" item="entity" separator=",">
|
|
|
+ (#{entity.mobile}, #{entity.name}, #{entity.password}, #{entity.email}, #{entity.createTime},
|
|
|
+ #{entity.number}, #{entity.province}, #{entity.position}, #{entity.superiorId}, #{entity.city},
|
|
|
+ #{entity.departmentId}, #{entity.status}, #{entity.userNo}, #{entity.duty}, #{entity.district},
|
|
|
+ #{entity.headPortraitUrl}, #{entity.contactMobile}, #{entity.lastLoginTime}, #{entity.openId},
|
|
|
+ #{entity.type}, #{entity.reviewer}, #{entity.ambId}, #{entity.ambRole}, #{entity.ambManage},
|
|
|
+ #{entity.managerId}, #{entity.seniorStaff}, #{entity.publicPurview}, #{entity.expenseOpenId},
|
|
|
+ #{entity.expenseSuperExamine}, #{entity.publicCarbonCopy}, #{entity.callNo})
|
|
|
+ </foreach>
|
|
|
</insert>
|
|
|
- <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.Admin" useGeneratedKeys="true">
|
|
|
- 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>
|
|
|
- <if test="openId != null">open_id,</if>
|
|
|
- <if test="type != null">type,</if>
|
|
|
- <if test="reviewer != null">reviewer,</if>
|
|
|
- <if test="ambId != null">amb_id,</if>
|
|
|
- <if test="ambRole != null">amb_role,</if>
|
|
|
- <if test="ambManage != null">amb_manage,</if>
|
|
|
- <if test="managerId != null">manager_id,</if>
|
|
|
- <if test="seniorStaff != null">senior_staff,</if>
|
|
|
- <if test="publicPurview != null">public_purview,</if>
|
|
|
- <if test="expenseOpenId != null">expense_open_id,</if>
|
|
|
- <if test="expenseSuperExamine != null">expense_super_examine,</if>
|
|
|
- <if test="publicCarbonCopy != null">public_carbon_copy,</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>
|
|
|
- <if test="openId != null">#{openId,jdbcType=VARCHAR},</if>
|
|
|
- <if test="type != null">#{type,jdbcType=INTEGER},</if>
|
|
|
- <if test="reviewer != null">#{reviewer,jdbcType=VARCHAR},</if>
|
|
|
- <if test="ambId != null">#{ambId,jdbcType=VARCHAR},</if>
|
|
|
- <if test="ambRole != null">#{ambRole,jdbcType=VARCHAR},</if>
|
|
|
- <if test="ambManage != null">#{ambManage,jdbcType=INTEGER},</if>
|
|
|
- <if test="managerId != null">#{managerId,jdbcType=VARCHAR},</if>
|
|
|
- <if test="seniorStaff != null">#{seniorStaff,jdbcType=INTEGER},</if>
|
|
|
- <if test="publicPurview != null">#{publicPurview,jdbcType=INTEGER},</if>
|
|
|
- <if test="expenseOpenId != null">#{expenseOpenId,jdbcType=VARCHAR},</if>
|
|
|
- <if test="expenseSuperExamine != null">#{expenseSuperExamine,jdbcType=INTEGER},</if>
|
|
|
- <if test="publicCarbonCopy != null">#{publicCarbonCopy,jdbcType=VARCHAR},</if>
|
|
|
- </trim>
|
|
|
+
|
|
|
+ <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
|
|
+ insert into admin(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, open_id,
|
|
|
+ type, reviewer, amb_id, amb_role, amb_manage, manager_id, senior_staff, public_purview, expense_open_id,
|
|
|
+ expense_super_examine, public_carbon_copy, call_no)
|
|
|
+ values
|
|
|
+ <foreach collection="entities" item="entity" separator=",">
|
|
|
+ (#{entity.mobile}, #{entity.name}, #{entity.password}, #{entity.email}, #{entity.createTime},
|
|
|
+ #{entity.number}, #{entity.province}, #{entity.position}, #{entity.superiorId}, #{entity.city},
|
|
|
+ #{entity.departmentId}, #{entity.status}, #{entity.userNo}, #{entity.duty}, #{entity.district},
|
|
|
+ #{entity.headPortraitUrl}, #{entity.contactMobile}, #{entity.lastLoginTime}, #{entity.openId},
|
|
|
+ #{entity.type}, #{entity.reviewer}, #{entity.ambId}, #{entity.ambRole}, #{entity.ambManage},
|
|
|
+ #{entity.managerId}, #{entity.seniorStaff}, #{entity.publicPurview}, #{entity.expenseOpenId},
|
|
|
+ #{entity.expenseSuperExamine}, #{entity.publicCarbonCopy}, #{entity.callNo})
|
|
|
+ </foreach>
|
|
|
+ on duplicate key update
|
|
|
+ mobile = values(mobile),
|
|
|
+ name = values(name),
|
|
|
+ password = values(password),
|
|
|
+ email = values(email),
|
|
|
+ create_time = values(create_time),
|
|
|
+ number = values(number),
|
|
|
+ province = values(province),
|
|
|
+ position = values(position),
|
|
|
+ superior_id = values(superior_id),
|
|
|
+ city = values(city),
|
|
|
+ department_id = values(department_id),
|
|
|
+ status = values(status),
|
|
|
+ user_no = values(user_no),
|
|
|
+ duty = values(duty),
|
|
|
+ district = values(district),
|
|
|
+ head_portrait_url = values(head_portrait_url),
|
|
|
+ contact_mobile = values(contact_mobile),
|
|
|
+ last_login_time = values(last_login_time),
|
|
|
+ open_id = values(open_id),
|
|
|
+ type = values(type),
|
|
|
+ reviewer = values(reviewer),
|
|
|
+ amb_id = values(amb_id),
|
|
|
+ amb_role = values(amb_role),
|
|
|
+ amb_manage = values(amb_manage),
|
|
|
+ manager_id = values(manager_id),
|
|
|
+ senior_staff = values(senior_staff),
|
|
|
+ public_purview = values(public_purview),
|
|
|
+ expense_open_id = values(expense_open_id),
|
|
|
+ expense_super_examine = values(expense_super_examine),
|
|
|
+ public_carbon_copy = values(public_carbon_copy),
|
|
|
+ call_no = values(call_no)
|
|
|
</insert>
|
|
|
- <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.Admin">
|
|
|
+
|
|
|
+ <!--通过主键修改数据-->
|
|
|
+ <update id="update">
|
|
|
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>
|
|
|
- <if test="openId != null">
|
|
|
- open_id = #{openId,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="type != null">
|
|
|
- type = #{type,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="reviewer != null">
|
|
|
- reviewer = #{reviewer,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="ambId != null">
|
|
|
- amb_id = #{ambId,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="ambRole != null">
|
|
|
- amb_role = #{ambRole,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="ambManage != null">
|
|
|
- amb_manage = #{ambManage,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="managerId != null">
|
|
|
- manager_id = #{managerId,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="seniorStaff != null">
|
|
|
- senior_staff = #{seniorStaff,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="publicPurview != null">
|
|
|
- public_purview = #{publicPurview,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="expenseOpenId != null">
|
|
|
- expense_open_id = #{expenseOpenId,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="expenseSuperExamine != null">
|
|
|
- expense_super_examine = #{expenseSuperExamine,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="publicCarbonCopy != null">
|
|
|
- public_carbon_copy = #{publicCarbonCopy,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
+ <if test="mobile != null and mobile != ''">
|
|
|
+ mobile = #{mobile},
|
|
|
+ </if>
|
|
|
+ <if test="name != null and name != ''">
|
|
|
+ name = #{name},
|
|
|
+ </if>
|
|
|
+ <if test="password != null and password != ''">
|
|
|
+ password = #{password},
|
|
|
+ </if>
|
|
|
+ <if test="email != null and email != ''">
|
|
|
+ email = #{email},
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">
|
|
|
+ create_time = #{createTime},
|
|
|
+ </if>
|
|
|
+ <if test="number != null">
|
|
|
+ number = #{number},
|
|
|
+ </if>
|
|
|
+ <if test="province != null and province != ''">
|
|
|
+ province = #{province},
|
|
|
+ </if>
|
|
|
+ <if test="position != null and position != ''">
|
|
|
+ position = #{position},
|
|
|
+ </if>
|
|
|
+ <if test="superiorId != null and superiorId != ''">
|
|
|
+ superior_id = #{superiorId},
|
|
|
+ </if>
|
|
|
+ <if test="city != null and city != ''">
|
|
|
+ city = #{city},
|
|
|
+ </if>
|
|
|
+ <if test="departmentId != null and departmentId != ''">
|
|
|
+ department_id = #{departmentId},
|
|
|
+ </if>
|
|
|
+ <if test="status != null and status != ''">
|
|
|
+ status = #{status},
|
|
|
+ </if>
|
|
|
+ <if test="userNo != null and userNo != ''">
|
|
|
+ user_no = #{userNo},
|
|
|
+ </if>
|
|
|
+ <if test="duty != null and duty != ''">
|
|
|
+ duty = #{duty},
|
|
|
+ </if>
|
|
|
+ <if test="district != null and district != ''">
|
|
|
+ district = #{district},
|
|
|
+ </if>
|
|
|
+ <if test="headPortraitUrl != null and headPortraitUrl != ''">
|
|
|
+ head_portrait_url = #{headPortraitUrl},
|
|
|
+ </if>
|
|
|
+ <if test="contactMobile != null and contactMobile != ''">
|
|
|
+ contact_mobile = #{contactMobile},
|
|
|
+ </if>
|
|
|
+ <if test="lastLoginTime != null">
|
|
|
+ last_login_time = #{lastLoginTime},
|
|
|
+ </if>
|
|
|
+ <if test="openId != null and openId != ''">
|
|
|
+ open_id = #{openId},
|
|
|
+ </if>
|
|
|
+ <if test="type != null">
|
|
|
+ type = #{type},
|
|
|
+ </if>
|
|
|
+ <if test="reviewer != null and reviewer != ''">
|
|
|
+ reviewer = #{reviewer},
|
|
|
+ </if>
|
|
|
+ <if test="ambId != null and ambId != ''">
|
|
|
+ amb_id = #{ambId},
|
|
|
+ </if>
|
|
|
+ <if test="ambRole != null and ambRole != ''">
|
|
|
+ amb_role = #{ambRole},
|
|
|
+ </if>
|
|
|
+ <if test="ambManage != null">
|
|
|
+ amb_manage = #{ambManage},
|
|
|
+ </if>
|
|
|
+ <if test="managerId != null and managerId != ''">
|
|
|
+ manager_id = #{managerId},
|
|
|
+ </if>
|
|
|
+ <if test="seniorStaff != null">
|
|
|
+ senior_staff = #{seniorStaff},
|
|
|
+ </if>
|
|
|
+ <if test="publicPurview != null">
|
|
|
+ public_purview = #{publicPurview},
|
|
|
+ </if>
|
|
|
+ <if test="expenseOpenId != null and expenseOpenId != ''">
|
|
|
+ expense_open_id = #{expenseOpenId},
|
|
|
+ </if>
|
|
|
+ <if test="expenseSuperExamine != null">
|
|
|
+ expense_super_examine = #{expenseSuperExamine},
|
|
|
+ </if>
|
|
|
+ <if test="publicCarbonCopy != null and publicCarbonCopy != ''">
|
|
|
+ public_carbon_copy = #{publicCarbonCopy},
|
|
|
+ </if>
|
|
|
+ <if test="callNo != null and callNo != ''">
|
|
|
+ call_no = #{callNo},
|
|
|
+ </if>
|
|
|
</set>
|
|
|
- where id = #{id,jdbcType=VARCHAR}
|
|
|
- </update>
|
|
|
- <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.Admin">
|
|
|
- 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},
|
|
|
- open_id = #{openId,jdbcType=VARCHAR},
|
|
|
- type = #{type,jdbcType=INTEGER},
|
|
|
- reviewer = #{reviewer,jdbcType=VARCHAR},
|
|
|
- amb_id = #{ambId,jdbcType=VARCHAR},
|
|
|
- amb_role = #{ambRole,jdbcType=VARCHAR},
|
|
|
- amb_manage = #{ambManage,jdbcType=INTEGER},
|
|
|
- manager_id = #{managerId,jdbcType=VARCHAR},
|
|
|
- senior_staff = #{seniorStaff,jdbcType=INTEGER},
|
|
|
- public_purview = #{publicPurview,jdbcType=INTEGER},
|
|
|
- expense_open_id = #{expenseOpenId,jdbcType=VARCHAR},
|
|
|
- expense_super_examine = #{expenseSuperExamine,jdbcType=INTEGER},
|
|
|
- public_carbon_copy = #{publicCarbonCopy,jdbcType=VARCHAR}
|
|
|
- where id = #{id,jdbcType=VARCHAR}
|
|
|
+ where id = #{id}
|
|
|
</update>
|
|
|
|
|
|
+ <!--通过主键删除-->
|
|
|
+ <delete id="deleteById">
|
|
|
+ delete
|
|
|
+ from admin
|
|
|
+ where id = #{id}
|
|
|
+ </delete>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
- <select id="selectAllAdmin" resultMap="BaseResultMap">
|
|
|
+ <select id="selectAllAdmin" resultMap="AdminMap">
|
|
|
select
|
|
|
- <include refid="Base_Column_List" />
|
|
|
+ <include refid="AdminAllSql" />
|
|
|
from admin
|
|
|
where status ='0'
|
|
|
<if test="depId != null">
|
|
|
@@ -304,7 +250,7 @@
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
|
- <select id="selectByMobile" parameterType="java.lang.String" resultMap="BaseResultMap">
|
|
|
+ <select id="selectByMobile" parameterType="java.lang.String" resultMap="AdminMap">
|
|
|
select
|
|
|
a.id,a.mobile,a.name,
|
|
|
a.password,a.email,a.create_time,
|
|
|
@@ -317,7 +263,7 @@
|
|
|
a.amb_manage,a.manager_id,a.senior_staff,
|
|
|
a.public_purview,a.expense_open_id,a.expense_super_examine
|
|
|
from admin a left join department b on a.department_id=b.id
|
|
|
- left join district_glossory c on b.province=c.id
|
|
|
+ left join district_glossory c on b.province=c.id
|
|
|
where a.mobile = #{mobile,jdbcType=VARCHAR}
|
|
|
</select>
|
|
|
|
|
|
@@ -328,56 +274,56 @@
|
|
|
where ur.uid = #{uid,jdbcType=VARCHAR}
|
|
|
</select>
|
|
|
|
|
|
- <select id="selectCognizanceConsultant" resultMap="BaseResultMap">
|
|
|
+ <select id="selectCognizanceConsultant" resultMap="AdminMap">
|
|
|
select
|
|
|
- <include refid="Base_Column_List" />
|
|
|
+ <include refid="AdminAllSql" />
|
|
|
from admin
|
|
|
where id <![CDATA[ <> ]]> '1'
|
|
|
</select>
|
|
|
|
|
|
- <select id="selectCognizancePrincipal" resultMap="BaseResultMap">
|
|
|
+ <select id="selectCognizancePrincipal" resultMap="AdminMap">
|
|
|
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 id="selectPatentAuthor" resultMap="AdminMap">
|
|
|
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 id="selectPatentPrincipal" resultMap="AdminMap">
|
|
|
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 id="selectCopyrightConsultant" resultMap="AdminMap">
|
|
|
select
|
|
|
- <include refid="Base_Column_List" />
|
|
|
+ <include refid="AdminAllSql" />
|
|
|
from admin
|
|
|
where id <![CDATA[ <> ]]> '1'
|
|
|
</select>
|
|
|
|
|
|
- <select id="selectCopyrightPrincipal" resultMap="BaseResultMap">
|
|
|
+ <select id="selectCopyrightPrincipal" resultMap="AdminMap">
|
|
|
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 id="selectTechprojectConsultant" resultMap="AdminMap">
|
|
|
select
|
|
|
- <include refid="Base_Column_List" />
|
|
|
+ <include refid="AdminAllSql" />
|
|
|
from admin
|
|
|
where id <![CDATA[ <> ]]> '1'
|
|
|
</select>
|
|
|
|
|
|
- <select id="selectTechprojectPrincipal" resultMap="BaseResultMap">
|
|
|
+ <select id="selectTechprojectPrincipal" resultMap="AdminMap">
|
|
|
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')
|
|
|
@@ -389,33 +335,33 @@
|
|
|
where uid = #{uid,jdbcType=VARCHAR}
|
|
|
</select>
|
|
|
|
|
|
- <select id="selectAccoutManager" resultMap="BaseResultMap">
|
|
|
+ <select id="selectAccoutManager" resultMap="AdminMap">
|
|
|
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 id="selectTechnician" resultMap="AdminMap">
|
|
|
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 id="selectSalesman" resultMap="AdminMap">
|
|
|
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 id="selectContractManager" resultMap="AdminMap">
|
|
|
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 id="selectTechBroder" resultMap="AdminMap">
|
|
|
select
|
|
|
u.rid as rolesId, a.name,a.id, a.position
|
|
|
from user_role u
|
|
|
@@ -425,14 +371,14 @@
|
|
|
r.role_name='技术经纪专员'
|
|
|
</select>
|
|
|
|
|
|
- <select id="listAdminSelectBySuperAdmin" resultMap="BaseResultMap">
|
|
|
+ <select id="listAdminSelectBySuperAdmin" resultMap="AdminMap">
|
|
|
select
|
|
|
- <include refid="Base_Column_List" />
|
|
|
+ <include refid="AdminAllSql" />
|
|
|
from admin
|
|
|
where id <![CDATA[ <> ]]> '1'
|
|
|
</select>
|
|
|
|
|
|
- <select id="listAdminSelectByAreaAdmin" resultMap="BaseResultMap">
|
|
|
+ <select id="listAdminSelectByAreaAdmin" resultMap="AdminMap">
|
|
|
select
|
|
|
a.id, a.name, a.mobile,
|
|
|
a.create_time as createTime, a.number, aa.name as superior
|
|
|
@@ -523,7 +469,7 @@
|
|
|
</select>
|
|
|
|
|
|
|
|
|
- <select id="listAdminByName" parameterType="java.lang.String" resultMap="BaseResultMap">
|
|
|
+ <select id="listAdminByName" parameterType="java.lang.String" resultMap="AdminMap">
|
|
|
select id,name from admin where name like concat('%',#{name},'%')
|
|
|
<if test="status==0">
|
|
|
and status= '0'
|
|
|
@@ -712,10 +658,7 @@
|
|
|
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,
|
|
|
@@ -771,7 +714,7 @@
|
|
|
and a.id <![CDATA[ <> ]]> #{adminId,jdbcType=VARCHAR}
|
|
|
</select>
|
|
|
|
|
|
- <select id="selectAdminByRoleId" parameterType="java.lang.String" resultMap="BaseResultMap">
|
|
|
+ <select id="selectAdminByRoleId" parameterType="java.lang.String" resultMap="AdminMap">
|
|
|
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>
|
|
|
|
|
|
@@ -788,7 +731,7 @@
|
|
|
</if>
|
|
|
|
|
|
</select>
|
|
|
- <select id="selectAdminName" parameterType="java.lang.String" resultMap="BaseResultMap">
|
|
|
+ <select id="selectAdminName" parameterType="java.lang.String" resultMap="AdminMap">
|
|
|
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}
|
|
|
@@ -805,13 +748,13 @@
|
|
|
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="getAdminRoleNameList" parameterType="java.lang.String" resultMap="BaseResultMap">
|
|
|
+ <select id="getAdminRoleNameList" parameterType="java.lang.String" resultMap="AdminMap">
|
|
|
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} and a.status= 0
|
|
|
</select>
|
|
|
|
|
|
- <select id="getAdminRoleNamesList" parameterType="java.lang.String" resultMap="BaseResultMap">
|
|
|
+ <select id="getAdminRoleNamesList" parameterType="java.lang.String" resultMap="AdminMap">
|
|
|
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 a.status= 0
|
|
|
@@ -821,13 +764,13 @@
|
|
|
</foreach>
|
|
|
</select>
|
|
|
|
|
|
- <select id="getAdminRoleTypeList" parameterType="java.lang.String" resultMap="BaseResultMap">
|
|
|
+ <select id="getAdminRoleTypeList" parameterType="java.lang.String" resultMap="AdminMap">
|
|
|
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_type = #{roleType} and a.status= 0
|
|
|
</select>
|
|
|
|
|
|
- <select id="getAdminRoleTypesList" parameterType="java.lang.String" resultMap="BaseResultMap">
|
|
|
+ <select id="getAdminRoleTypesList" parameterType="java.lang.String" resultMap="AdminMap">
|
|
|
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 a.status= 0
|
|
|
@@ -1030,7 +973,7 @@
|
|
|
)e on a.id=e.uid
|
|
|
</if>
|
|
|
where a.type=1 and a.new_channel=0
|
|
|
- <include refid="AdminCustomerDetailSql"/>
|
|
|
+ <include refid="AdminCustomerDetailSql"/>
|
|
|
</select>
|
|
|
|
|
|
|
|
|
@@ -1080,9 +1023,9 @@
|
|
|
where a.id= #{id}
|
|
|
</select>
|
|
|
|
|
|
- <select id="selectByOpeid" parameterType="java.lang.String" resultMap="BaseResultMap">
|
|
|
+ <select id="selectByOpeid" parameterType="java.lang.String" resultMap="AdminMap">
|
|
|
select
|
|
|
- <include refid="Base_Column_List" />
|
|
|
+ <include refid="AdminAllSql" />
|
|
|
from admin
|
|
|
where open_id= #{openid}
|
|
|
</select>
|
|
|
@@ -1345,10 +1288,10 @@
|
|
|
|
|
|
<update id="updateDepExpenseFinance">
|
|
|
update expense_account a left join expense_account_examine b on a.id=b.eaid
|
|
|
- left join admin c on c.id= #{expenseFinanceId}
|
|
|
+ left join admin c on c.id= #{expenseFinanceId}
|
|
|
set b.auditor =c.id ,b.auditorName =c.name
|
|
|
where a.process_status in (0,1,2,3) and a.status =1 and b.process_status =3 and b.status =0
|
|
|
- and a.apply_dep = #{id}
|
|
|
+ and a.apply_dep = #{id}
|
|
|
</update>
|
|
|
-
|
|
|
</mapper>
|
|
|
+
|