Browse Source

外呼系统开发

anderx 1 year ago
parent
commit
5657b84471

+ 4 - 4
src/main/java/com/goafanti/admin/service/impl/AdminServiceImpl.java

@@ -81,7 +81,7 @@ public class AdminServiceImpl extends BaseMybatisDao<AdminMapper> implements Adm
 
 	@Override
 	public Admin selectByPrimaryKey(String key) {
-		return adminMapper.selectByPrimaryKey(key);
+		return adminMapper.queryById(key);
 	}
 
 	@SuppressWarnings("unchecked")
@@ -119,17 +119,17 @@ public class AdminServiceImpl extends BaseMybatisDao<AdminMapper> implements Adm
 			}
 			TokenManager.clearUserAuthByUserId(ad.getId());
 		}
-		return adminMapper.updateByPrimaryKeySelective(ad);
+		return adminMapper.update(ad);
 	}
 
 	@Override
 	public int updateByPrimaryKey(Admin a) {
-		return adminMapper.updateByPrimaryKeySelective(a);
+		return adminMapper.update(a);
 	}
 
 	@Override
 	public AdminDetail selectAdminDetail(String id) {
-		Admin a = adminMapper.selectByPrimaryKey(id);
+		Admin a = adminMapper.queryById(id);
 		if (null == a) {
 			return null;
 		}

+ 5 - 5
src/main/java/com/goafanti/admin/service/impl/NewAdminServiceImpl.java

@@ -95,7 +95,7 @@ public class NewAdminServiceImpl extends BaseMybatisDao<AdminMapper> implements
 
 	@Override
 	public Admin selectByPrimaryKey(String key) {
-		return adminMapper.selectByPrimaryKey(key);
+		return adminMapper.queryById(key);
 	}
 
 	@Override
@@ -119,7 +119,7 @@ public class NewAdminServiceImpl extends BaseMybatisDao<AdminMapper> implements
 		}
 		ad.setType(sumType(roleIds));
 		if (ad.getExpenseSuperExamine()==null)ad.setExpenseSuperExamine(0);
-		int count=adminMapper.updateByPrimaryKey(ad);
+		int count=adminMapper.update(ad);
 		//
 		asyncUtils.pushRoleUpdateExamine(ad,useAdmin,roleIds,useRole);
 		//修改公出审核人
@@ -195,12 +195,12 @@ public class NewAdminServiceImpl extends BaseMybatisDao<AdminMapper> implements
 
 	@Override
 	public int updateByPrimaryKey(Admin a) {
-		return adminMapper.updateByPrimaryKeySelective(a);
+		return adminMapper.update(a);
 	}
 
 	@Override
 	public AdminDetail selectAdminDetail(String id) {
-		Admin a = adminMapper.selectByPrimaryKey(id);
+		Admin a = adminMapper.queryById(id);
 		if (null == a) {
 			return null;
 		}
@@ -320,7 +320,7 @@ public class NewAdminServiceImpl extends BaseMybatisDao<AdminMapper> implements
 		if (ad.getId()!=null){
 			ad.setAmbRole("7");
 		}else {
-			Admin use = adminMapper.selectByPrimaryKey(ad.getId());
+			Admin use = adminMapper.queryById(ad.getId());
 			AmbSystem ambSystem = ambSystemMapper.selectByPrimaryKey(Long.valueOf(ad.getAmbId()));
 			if (ambSystem.getLvl() == 5 || ambSystem.getLvl() == 6) {
 				if (use.getAmbRole() == null) {

+ 5 - 2
src/main/java/com/goafanti/ambSystem/service/Impl/AmbServiceImpl.java

@@ -4,7 +4,10 @@ import com.goafanti.ambSystem.bo.AmbAll;
 import com.goafanti.ambSystem.bo.InputAmb;
 import com.goafanti.ambSystem.bo.OutAmb;
 import com.goafanti.ambSystem.service.AmbService;
-import com.goafanti.common.dao.*;
+import com.goafanti.common.dao.AdminMapper;
+import com.goafanti.common.dao.AmbSystemMapper;
+import com.goafanti.common.dao.RoleMapper;
+import com.goafanti.common.dao.UserRoleMapper;
 import com.goafanti.common.error.BusinessException;
 import com.goafanti.common.model.Admin;
 import com.goafanti.common.model.AmbSystem;
@@ -116,7 +119,7 @@ public class AmbServiceImpl extends BaseMybatisDao<AmbSystemMapper> implements A
         a.setId(leader);
         if (StringUtils.isNotBlank(str)) a.setAmbRole(str.substring(0,str.length()-1));
         if (a.getAmbRole()!=null){
-            adminMapper.updateByPrimaryKeySelective(a);
+            adminMapper.update(a);
         }
     }
 

+ 74 - 13
src/main/java/com/goafanti/common/dao/AdminMapper.java

@@ -7,28 +7,86 @@ import com.goafanti.common.model.AdminUserCount;
 import com.goafanti.common.model.Department;
 import com.goafanti.common.model.Role;
 import org.apache.ibatis.annotations.Param;
+import org.springframework.data.domain.Pageable;
 
 import java.math.BigDecimal;
 import java.util.List;
+
 /**
-* @author Administrator
-* @description 针对表【admin】的数据库操作Mapper
-* @createDate 2024-06-12 08:51:13
-* @Entity com.goafanti.common.model.Admin
-*/
+ * (Admin)表数据库访问层
+ *
+ * @author makejava
+ * @since 2024-11-19 11:09:35
+ */
 public interface AdminMapper {
 
-    int deleteByPrimaryKey(String id);
+    /**
+     * 通过ID查询单条数据
+     *
+     * @param id 主键
+     * @return 实例对象
+     */
+    Admin queryById(String id);
 
-    int insert(Admin record);
 
-    int insertSelective(Admin record);
+    /**
+     * 查询指定行数据
+     *
+     * @param admin    查询条件
+     * @param pageable 分页对象
+     * @return 对象列表
+     */
+    List<Admin> findAdminList(Admin admin, @Param("pageable") Pageable pageable);
+
+    /**
+     * 统计总行数
+     *
+     * @param admin 查询条件
+     * @return 总行数
+     */
+    int findAdminCount(Admin admin);
 
-    Admin selectByPrimaryKey(String id);
+    /**
+     * 新增数据
+     *
+     * @param admin 实例对象
+     * @return 影响行数
+     */
+    int insert(Admin admin);
 
-    int updateByPrimaryKeySelective(Admin record);
+    /**
+     * 批量新增数据(MyBatis原生foreach方法)
+     *
+     * @param entities List<Admin> 实例对象列表
+     * @return 影响行数
+     */
+    int insertBatch(@Param("entities") List<Admin> entities);
+
+    /**
+     * 批量新增或按主键更新数据(MyBatis原生foreach方法)
+     *
+     * @param entities List<Admin> 实例对象列表
+     * @return 影响行数
+     * @throws org.springframework.jdbc.BadSqlGrammarException 入参是空List的时候会抛SQL语句错误的异常,请自行校验入参
+     */
+    int insertOrUpdateBatch(@Param("entities") List<Admin> entities);
+
+    /**
+     * 修改数据
+     *
+     * @param admin 实例对象
+     * @return 影响行数
+     */
+    int update(Admin admin);
+
+    /**
+     * 通过主键删除数据
+     *
+     * @param id 主键
+     * @return 影响行数
+     */
+    int deleteById(String id);
 
-    int updateByPrimaryKey(Admin record);
     Admin selectByMobile(String mobile);
 
     List<Role> selectRolesByPrimaryKey(String uid);
@@ -86,7 +144,6 @@ public interface AdminMapper {
 
     String selectStatusByMobile(@Param("mobile")String mobile);
 
-    int deleteById(String id);
 
     List<Admin> selectIDNBySuperiorId(String superiorId);
 
@@ -183,7 +240,7 @@ public interface AdminMapper {
     AdminStatisticsBo adminStatisticsInfoByTime(@Param("aid") String aid, @Param("startTime") String startTime, @Param("endTime") String endTime);
 
     List<AdminUserCount> thisMonthUser( @Param("firstDay")String firstDay, @Param("endDay")String endDay,
-                                    @Param("aid")String aid);
+                                        @Param("aid")String aid);
 
 
 
@@ -218,3 +275,7 @@ public interface AdminMapper {
 
     void updateDepExpenseFinance(@Param("id") String id, @Param("expenseFinanceId") String expenseFinanceId);
 }
+
+
+
+

+ 258 - 315
src/main/java/com/goafanti/common/mapper/AdminMapper.xml

@@ -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>
+

+ 25 - 222
src/main/java/com/goafanti/common/model/Admin.java

@@ -5,174 +5,150 @@ import org.apache.commons.lang3.time.DateFormatUtils;
 
 import java.util.Date;
 
+
 /**
- * admin
- * @author
+ * (Admin)实体类
+ *
+ * @author makejava
+ * @since 2024-11-19 11:09:35
  */
-public class Admin extends BaseModel implements AftUser {
-    private String id;
+public class Admin extends BaseModel implements AftUser{
 
+    private String id;
     /**
      * 手机号(登录帐号)
      */
     private String mobile;
-
     /**
      * 用户名
      */
     private String name;
-
     /**
      * 密码
      */
     private String password;
-
     /**
      * 邮箱
      */
     private String email;
-
     /**
      * 创建时间
      */
     private Date createTime;
 
-    /**
-     *
-     */
     private Integer number;
-
     /**
      * 所在省份
      */
     private String province;
-
     /**
-     * 职位
+     * 职位 0=咨询,1=营销,2=外联,3=财务,4=助理,5=管理,6=工程师,7=人事,8=行政,9=内勤,10=业务
      */
     private String position;
-
     /**
      * 上级管理用户ID
      */
     private String superiorId;
-
     /**
      * 所在市
      */
     private String city;
-
     /**
      * 部门ID
      */
     private String departmentId;
-
     /**
      * 用户状态
      */
     private String status;
-
     /**
      * 用户编号
      */
     private String userNo;
-
     /**
      * 职务
      */
     private String duty;
-
     /**
      * 地区
      */
     private String district;
-
     /**
      * 用户头像地址
      */
     private String headPortraitUrl;
-
     /**
      * 联系电话
      */
     private String contactMobile;
-
     /**
      * 最后登录时间
      */
     private Date lastLoginTime;
-
     /**
      * 打卡小程序微信公共编号
      */
     private String openId;
-
     /**
      * 0普通 1营销 2财务 3咨询
      */
     private Integer type;
-
     /**
      * 公出审核人
      */
     private String reviewer;
-
     /**
      * 阿米巴编号
      */
     private String ambId;
-
     /**
      * 阿米巴权限
      */
     private String ambRole;
-
     /**
      * 阿米巴管理者 0巴员 1巴主
      */
     private Integer ambManage;
-
     /**
      * 经理审核人员
      */
     private String managerId;
-
     /**
      * 员工分类 0新员工 1老员工
      */
     private Integer seniorStaff;
-
     /**
      * 公出权限 0正常 1全部
      */
     private Integer publicPurview;
-
     /**
      * 报销小程序微信公共编号
      */
     private String expenseOpenId;
-
     /**
      * 报销上级审核 0-不需要 ,1-需要
      */
     private Integer expenseSuperExamine;
-
     /**
      * 公出抄送人
      */
     private String publicCarbonCopy;
 
-    private static final long serialVersionUID = 1L;
+
 
     /**
-     * 
+     * 外呼号码
      */
+    private String callNo;
+
     private String	superior;
     private String reviewerName;
 
     private  String managerName;
     private  String publicCarbonCopyName;
 
+    private static final long serialVersionUID = 1L;
+
     public String getPublicCarbonCopyName() {
         return publicCarbonCopyName;
     }
@@ -223,430 +199,257 @@ public class Admin extends BaseModel implements AftUser {
         return id;
     }
 
-    /**
-     * 
-     */
     public void setId(String id) {
         this.id = id;
     }
 
-    /**
-     * 手机号(登录帐号)
-     */
     public String getMobile() {
         return mobile;
     }
 
-    /**
-     * 手机号(登录帐号)
-     */
     public void setMobile(String mobile) {
         this.mobile = mobile;
     }
 
-    /**
-     * 用户名
-     */
     public String getName() {
         return name;
     }
 
-    /**
-     * 用户名
-     */
     public void setName(String name) {
         this.name = name;
     }
 
-    /**
-     * 密码
-     */
     public String getPassword() {
         return password;
     }
 
-    /**
-     * 密码
-     */
     public void setPassword(String password) {
         this.password = password;
     }
 
-    /**
-     * 邮箱
-     */
     public String getEmail() {
         return email;
     }
 
-    /**
-     * 邮箱
-     */
     public void setEmail(String email) {
         this.email = email;
     }
 
-    /**
-     * 创建时间
-     */
     public Date getCreateTime() {
         return createTime;
     }
 
-    /**
-     * 创建时间
-     */
     public void setCreateTime(Date createTime) {
         this.createTime = createTime;
     }
 
-    /**
-     * 
-     */
     public Integer getNumber() {
         return number;
     }
 
-    /**
-     * 
-     */
     public void setNumber(Integer number) {
         this.number = number;
     }
 
-    /**
-     * 所在省份
-     */
     public String getProvince() {
         return province;
     }
 
-    /**
-     * 所在省份
-     */
     public void setProvince(String province) {
         this.province = province;
     }
 
-    /**
-     * 职位
-     */
     public String getPosition() {
         return position;
     }
 
-    /**
-     * 职位
-     */
     public void setPosition(String position) {
         this.position = position;
     }
 
-    /**
-     * 上级管理用户ID
-     */
     public String getSuperiorId() {
         return superiorId;
     }
 
-    /**
-     * 上级管理用户ID
-     */
     public void setSuperiorId(String superiorId) {
         this.superiorId = superiorId;
     }
 
-    /**
-     * 所在市
-     */
     public String getCity() {
         return city;
     }
 
-    /**
-     * 所在市
-     */
     public void setCity(String city) {
         this.city = city;
     }
 
-    /**
-     * 部门ID
-     */
     public String getDepartmentId() {
         return departmentId;
     }
 
-    /**
-     * 部门ID
-     */
     public void setDepartmentId(String departmentId) {
         this.departmentId = departmentId;
     }
 
-    /**
-     * 用户状态
-     */
     public String getStatus() {
         return status;
     }
 
-    /**
-     * 用户状态
-     */
     public void setStatus(String status) {
         this.status = status;
     }
 
-    /**
-     * 用户编号
-     */
     public String getUserNo() {
         return userNo;
     }
 
-    /**
-     * 用户编号
-     */
     public void setUserNo(String userNo) {
         this.userNo = userNo;
     }
 
-    /**
-     * 职务
-     */
     public String getDuty() {
         return duty;
     }
 
-    /**
-     * 职务
-     */
     public void setDuty(String duty) {
         this.duty = duty;
     }
 
-    /**
-     * 地区
-     */
     public String getDistrict() {
         return district;
     }
 
-    /**
-     * 地区
-     */
     public void setDistrict(String district) {
         this.district = district;
     }
 
-    /**
-     * 用户头像地址
-     */
     public String getHeadPortraitUrl() {
         return headPortraitUrl;
     }
 
-    /**
-     * 用户头像地址
-     */
     public void setHeadPortraitUrl(String headPortraitUrl) {
         this.headPortraitUrl = headPortraitUrl;
     }
 
-    /**
-     * 联系电话
-     */
     public String getContactMobile() {
         return contactMobile;
     }
 
-    /**
-     * 联系电话
-     */
     public void setContactMobile(String contactMobile) {
         this.contactMobile = contactMobile;
     }
 
-    /**
-     * 最后登录时间
-     */
     public Date getLastLoginTime() {
         return lastLoginTime;
     }
 
-    /**
-     * 最后登录时间
-     */
     public void setLastLoginTime(Date lastLoginTime) {
         this.lastLoginTime = lastLoginTime;
     }
 
-    /**
-     * 打卡小程序微信公共编号
-     */
     public String getOpenId() {
         return openId;
     }
 
-    /**
-     * 打卡小程序微信公共编号
-     */
     public void setOpenId(String openId) {
         this.openId = openId;
     }
 
-    /**
-     * 0普通 1营销 2财务 3咨询
-     */
     public Integer getType() {
         return type;
     }
 
-    /**
-     * 0普通 1营销 2财务 3咨询
-     */
     public void setType(Integer type) {
         this.type = type;
     }
 
-    /**
-     * 公出审核人
-     */
     public String getReviewer() {
         return reviewer;
     }
 
-    /**
-     * 公出审核人
-     */
     public void setReviewer(String reviewer) {
         this.reviewer = reviewer;
     }
 
-    /**
-     * 阿米巴编号
-     */
     public String getAmbId() {
         return ambId;
     }
 
-    /**
-     * 阿米巴编号
-     */
     public void setAmbId(String ambId) {
         this.ambId = ambId;
     }
 
-    /**
-     * 阿米巴权限
-     */
     public String getAmbRole() {
         return ambRole;
     }
 
-    /**
-     * 阿米巴权限
-     */
     public void setAmbRole(String ambRole) {
         this.ambRole = ambRole;
     }
 
-    /**
-     * 阿米巴管理者 0巴员 1巴主
-     */
     public Integer getAmbManage() {
         return ambManage;
     }
 
-    /**
-     * 阿米巴管理者 0巴员 1巴主
-     */
     public void setAmbManage(Integer ambManage) {
         this.ambManage = ambManage;
     }
 
-    /**
-     * 经理审核人员
-     */
     public String getManagerId() {
         return managerId;
     }
 
-    /**
-     * 经理审核人员
-     */
     public void setManagerId(String managerId) {
         this.managerId = managerId;
     }
 
-    /**
-     * 员工分类 0新员工 1老员工
-     */
     public Integer getSeniorStaff() {
         return seniorStaff;
     }
 
-    /**
-     * 员工分类 0新员工 1老员工
-     */
     public void setSeniorStaff(Integer seniorStaff) {
         this.seniorStaff = seniorStaff;
     }
 
-    /**
-     * 公出权限 0正常 1全部
-     */
     public Integer getPublicPurview() {
         return publicPurview;
     }
 
-    /**
-     * 公出权限 0正常 1全部
-     */
     public void setPublicPurview(Integer publicPurview) {
         this.publicPurview = publicPurview;
     }
 
-    /**
-     * 报销小程序微信公共编号
-     */
     public String getExpenseOpenId() {
         return expenseOpenId;
     }
 
-    /**
-     * 报销小程序微信公共编号
-     */
     public void setExpenseOpenId(String expenseOpenId) {
         this.expenseOpenId = expenseOpenId;
     }
 
-    /**
-     * 报销上级审核 0-不需要 ,1-需要
-     */
     public Integer getExpenseSuperExamine() {
         return expenseSuperExamine;
     }
 
-    /**
-     * 报销上级审核 0-不需要 ,1-需要
-     */
     public void setExpenseSuperExamine(Integer expenseSuperExamine) {
         this.expenseSuperExamine = expenseSuperExamine;
     }
 
-    /**
-     * 公出抄送人
-     */
     public String getPublicCarbonCopy() {
         return publicCarbonCopy;
     }
 
-    /**
-     * 公出抄送人
-     */
     public void setPublicCarbonCopy(String publicCarbonCopy) {
         this.publicCarbonCopy = publicCarbonCopy;
     }
-}
+
+    public String getCallNo() {
+        return callNo;
+    }
+
+    public void setCallNo(String callNo) {
+        this.callNo = callNo;
+    }
+
+}
+

+ 1 - 1
src/main/java/com/goafanti/common/utils/WeChatUtils.java

@@ -369,7 +369,7 @@ public class WeChatUtils {
 				a.setOpenId(openid);
 			}
 			a.setId(TokenManager.getAdminId());
-			adminMapper.updateByPrimaryKeySelective(a);
+			adminMapper.update(a);
 			return 1;
 		}else {
 			return -1;

+ 1 - 1
src/main/java/com/goafanti/user/controller/UserLoginController.java

@@ -119,7 +119,7 @@ public class UserLoginController extends BaseController {
 			Admin updateDate =new Admin();
 			updateDate.setId(a.getId());
 			updateDate.setLastLoginTime(new Date());
-			adminMapper.updateByPrimaryKeySelective(updateDate);
+			adminMapper.update(updateDate);
 		}
 		return res;
 	}

+ 15 - 16
src/main/java/com/goafanti/weChat/service/impl/PublicReleaseServiceImpl.java

@@ -32,7 +32,6 @@ import org.springframework.web.socket.TextMessage;
 
 import java.math.BigDecimal;
 import java.text.ParseException;
-import java.time.LocalDate;
 import java.util.*;
 import java.util.concurrent.atomic.AtomicReference;
 import java.util.stream.Collectors;
@@ -222,7 +221,7 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 
 
 	private void addPublicExamine(Integer id, String aid) {
-		Admin admin = adminMapper.selectByPrimaryKey(aid);
+		Admin admin = adminMapper.queryById(aid);
 		addPublicExamine(id,admin);
 	}
 
@@ -267,7 +266,7 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 			Map<String, Object>map=new HashMap<String, Object>();
 			//无需订单负责人审核
 		if (in.getTechStartProcess()==0){
-//			Admin a=adminMapper.selectByPrimaryKey(my.getReviewer());
+//			Admin a=adminMapper.queryById(my.getReviewer());
 			//订单审核换成多人
 			List<AdminPublicReviewerBo> adminPublicReviewerBos = adminPublicReviewerMapper.selectByAid(in.getAid());
 			String str="["+my.getName()+"]发起["+nickname+"]的外出申请,请及时审核。";
@@ -283,7 +282,7 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
                         if (!u.getAid().equals(my.getId())) {
 							List<RestrictProject> list = restrictProjectMapper.selectListByParam(new InputRestrictProject(u.getId(), my.getId()));
 							StringBuilder str2 = new StringBuilder();
-							Admin admin = adminMapper.selectByPrimaryKey(u.getAid());
+							Admin admin = adminMapper.queryById(u.getAid());
 							if (!list.isEmpty()){
 								String start = DateUtils.formatDate(in.getReleaseStart(), AFTConstants.MMDDHHMM);
 								String end = DateUtils.formatDate(in.getReleaseEnd(), AFTConstants.MMDDHHMM);
@@ -318,7 +317,7 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 			}
 			if (status.get()==1){
 				for (AdminPublicReviewerBo adminPublicReviewerBo : adminPublicReviewerBos) {
-					Admin admin = adminMapper.selectByPrimaryKey(adminPublicReviewerBo.getReviewerId());
+					Admin admin = adminMapper.queryById(adminPublicReviewerBo.getReviewerId());
 					pushNoticeAndSoucketAndEmail(my, in, date, admin, str, map);
 				}
 
@@ -327,7 +326,7 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 		}else {
 			TOrderNew tOrderNew = tOrderNewMapper.queryById(in.getOrderNo());
 			String salesmanId = tOrderNew.getSalesmanId();
-			Admin a = adminMapper.selectByPrimaryKey(salesmanId);
+			Admin a = adminMapper.queryById(salesmanId);
 			addPublicExamine(in.getId(),a);
 			CheckOrderNoOut data = (CheckOrderNoOut) checkOrderNo.get("data");
 			String format = getString(my, data,tOrderNew);
@@ -381,7 +380,7 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 		String [] ss=assistAid.split(",");
 		StringBuffer sb=new StringBuffer();
 		for (String s : ss) {
-			Admin a=adminMapper.selectByPrimaryKey(s);
+			Admin a=adminMapper.queryById(s);
 			if (a!=null&&a.getName()!=null)sb=sb.append(a.getName()).append(",");
 		}
 		if (sb.length()<1)return "";
@@ -390,7 +389,7 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 
 	private void sendEmailAndNoticeAndSoucket(String id,Integer type,String content){
 		sendNoticeAndSoucket(id,type,content);
-		Admin admin = adminMapper.selectByPrimaryKey(id);
+		Admin admin = adminMapper.queryById(id);
 		String title="暂无标题";
 		if (type==3)title=NoticeStatus.PUBLIC_OTHERS_USER.getDesc();
 		EmailBo emailBo=new EmailBo(title,admin.getEmail(),content);
@@ -915,10 +914,10 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 
 		}
 		//当前审核人员
-		Admin ad=adminMapper.selectByPrimaryKey(aid);
+		Admin ad=adminMapper.queryById(aid);
 		//公出负责人
 		Admin a;
-		Admin publicAdmin =adminMapper.selectByPrimaryKey(use.getAid());
+		Admin publicAdmin =adminMapper.queryById(use.getAid());
 		a=publicAdmin;
 		StringBuffer str=new StringBuffer();
 		str=str.append("(").append(ad.getName()).append(")");
@@ -1410,7 +1409,7 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 		addOrderPublicReleaseLog(orderNo,status,process,remarks,null,null);
 	}
 	private void addOrderPublicReleaseLog(String orderNo, Integer status, Integer process, String remarks,Double useDuration,Double newDuration) {
-		Admin admin = adminMapper.selectByPrimaryKey(TokenManager.getAdminId());
+		Admin admin = adminMapper.queryById(TokenManager.getAdminId());
 		OrderPublicReleaseLog log = new OrderPublicReleaseLog();
 		log.setOrderNo(orderNo);
 		log.setProcessStatus(process);
@@ -1472,7 +1471,7 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 		Integer status=0;
 		PublicRelease use=publicReleaseMapper.queryById(id);
 		PublicRelease mainPublic= publicReleaseMapper.queryById(use.getMainId());
-		Admin ad=adminMapper.selectByPrimaryKey(TokenManager.getAdminId());
+		Admin ad=adminMapper.queryById(TokenManager.getAdminId());
 		StringBuffer str=new StringBuffer();
 		if (use.getAssist()!=2){
 			throw  new BusinessException("只有技术公出能发起技术驳回");
@@ -1505,7 +1504,7 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 	 */
 	private Integer addNoticeAndWeChat(Integer id,String aid, String remarks,  Integer status) {
 		AdminListBo my = adminMapper.getDeptNameByAid(aid);
-		Admin a = adminMapper.selectByPrimaryKey(TokenManager.getAdminId());
+		Admin a = adminMapper.queryById(TokenManager.getAdminId());
 		if (my.getOpenId()!=null) {
 			if (remarks.length()>19) {
 				remarks=remarks.substring(0, 15)+"...";
@@ -1664,7 +1663,7 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 		List<AdminPublicReviewerBo> adminPublicReviewerBos = adminPublicReviewerMapper.selectByAid(s);
 		int res=0;
 		//协单人
-		Admin admin = adminMapper.selectByPrimaryKey(s);
+		Admin admin = adminMapper.queryById(s);
 		List<AdminPublicReviewerBo> collect = adminPublicReviewerBos.stream().filter(e -> e.getType() == 1).collect(Collectors.toList());
 		if (!collect.isEmpty()){
 			//公出发起人
@@ -2555,7 +2554,7 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 	 * @param prid 公出编号
 	 */
 	private void addWeChatNotice(String aid,Integer type,String str,Integer prid){
-		Admin recipient = adminMapper.selectByPrimaryKey(aid);
+		Admin recipient = adminMapper.queryById(aid);
 		addWeChatNotice(  recipient, type, str, prid);
 	}
 
@@ -2622,7 +2621,7 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 			}
 		}
 		for (String s : list) {
-			sb.append(adminMapper.selectByPrimaryKey(s).getName()).append(",");
+			sb.append(adminMapper.queryById(s).getName()).append(",");
 		}
 		return sb.length()>0?sb.substring(0,sb.length()-1):sb.toString();
 	}