客户资源后台企业类型更新

master
river 4 years ago
parent 4242aade43
commit c20898fe81
  1. 1
      dq-financial-api/src/main/java/com/daqing/financial/config/SwaggerConfig.java
  2. 11
      dq-financial-api/src/main/java/com/daqing/financial/crms/CustomerControllerApi.java
  3. BIN
      dq-financial-api/target/classes/com/daqing/financial/config/SwaggerConfig.class
  4. BIN
      dq-financial-api/target/classes/com/daqing/financial/crms/CustomerControllerApi.class
  5. BIN
      dq-financial-api/target/classes/com/daqing/financial/hrms/DeptControllerApi.class
  6. BIN
      dq-financial-api/target/classes/com/daqing/financial/hrms/EmployeeControllerApi.class
  7. BIN
      dq-financial-api/target/classes/com/daqing/financial/hrms/PermissionControllerApi.class
  8. BIN
      dq-financial-api/target/classes/com/daqing/financial/hrms/PositionControllerApi.class
  9. 10
      dq-financial-crms/src/main/java/com/daqing/financial/crms/controller/CustomerController.java
  10. 3
      dq-financial-crms/src/main/java/com/daqing/financial/crms/dao/CompanyCustomerDao.java
  11. 1
      dq-financial-crms/src/main/java/com/daqing/financial/crms/dao/CustomerDao.java
  12. 2
      dq-financial-crms/src/main/java/com/daqing/financial/crms/service/CustomerService.java
  13. 15
      dq-financial-crms/src/main/java/com/daqing/financial/crms/service/impl/CustomerServiceImpl.java
  14. 8
      dq-financial-crms/src/main/resources/mapper/crms/CompanyCustomerDao.xml
  15. 2
      dq-financial-crms/src/main/resources/mapper/crms/PersonalCustomerDao.xml
  16. 18
      dq-financial-crms/target/classes/bootstrap.properties
  17. BIN
      dq-financial-crms/target/classes/com/daqing/financial/crms/DqFinancialCrmsApplication.class
  18. BIN
      dq-financial-crms/target/classes/com/daqing/financial/crms/config/IPageConfig.class
  19. BIN
      dq-financial-crms/target/classes/com/daqing/financial/crms/controller/CustomerController.class
  20. BIN
      dq-financial-crms/target/classes/com/daqing/financial/crms/dao/CompanyCustomerDao.class
  21. BIN
      dq-financial-crms/target/classes/com/daqing/financial/crms/dao/CustomerDao.class
  22. BIN
      dq-financial-crms/target/classes/com/daqing/financial/crms/dao/PersonalCustomerDao.class
  23. BIN
      dq-financial-crms/target/classes/com/daqing/financial/crms/feign/HrmsFeignService.class
  24. BIN
      dq-financial-crms/target/classes/com/daqing/financial/crms/service/CustomerService.class
  25. BIN
      dq-financial-crms/target/classes/com/daqing/financial/crms/service/impl/CustomerServiceImpl.class
  26. 47
      dq-financial-crms/target/classes/logback-spring.xml
  27. 44
      dq-financial-crms/target/classes/mapper/crms/CompanyCustomerDao.xml
  28. 86
      dq-financial-crms/target/classes/mapper/crms/CustomerDao.xml
  29. 57
      dq-financial-crms/target/classes/mapper/crms/PersonalCustomerDao.xml
  30. BIN
      dq-financial-crms/target/test-classes/com/daqing/financial/crms/DqFinancialCrmsApplicationTests.class
  31. 5
      dq-financial-hrms/src/main/java/com/daqing/financial/hrms/dao/DeptDao.java
  32. 18
      dq-financial-hrms/target/classes/bootstrap.properties
  33. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/DqFinancialHrmsApplication.class
  34. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/config/IPageConfig.class
  35. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/controller/DeptController.class
  36. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/controller/EmployeeController.class
  37. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/controller/PermissionController.class
  38. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/controller/PositionController.class
  39. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/controller/RoleController.class
  40. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/controller/UserController.class
  41. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/dao/DeptDao.class
  42. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/dao/DeptPositionDao.class
  43. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/dao/EmployeeDao.class
  44. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/dao/EmployeeDeptDao.class
  45. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/dao/EmployeePositionDao.class
  46. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/dao/EmployeeRoleDao.class
  47. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/dao/PermissionDao.class
  48. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/dao/PositionDao.class
  49. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/dao/RoleDao.class
  50. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/dao/RolePermissionDao.class
  51. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/dao/UserDao.class
  52. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/feign/CrmsFeignService.class
  53. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/service/DeptService.class
  54. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/service/EmployeeService.class
  55. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/service/PermissionService.class
  56. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/service/PositionService.class
  57. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/service/RoleService.class
  58. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/service/UserService.class
  59. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/service/impl/DeptServiceImpl.class
  60. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/service/impl/EmployeeServiceImpl.class
  61. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/service/impl/PermissionServiceImpl.class
  62. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/service/impl/PositionServiceImpl.class
  63. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/service/impl/RoleServiceImpl.class
  64. BIN
      dq-financial-hrms/target/classes/com/daqing/financial/hrms/service/impl/UserServiceImpl.class
  65. 47
      dq-financial-hrms/target/classes/logback-spring.xml
  66. 39
      dq-financial-hrms/target/classes/mapper/hrms/DeptDao.xml
  67. 28
      dq-financial-hrms/target/classes/mapper/hrms/DeptPositionDao.xml
  68. 60
      dq-financial-hrms/target/classes/mapper/hrms/EmployeeDao.xml
  69. 14
      dq-financial-hrms/target/classes/mapper/hrms/EmployeeDeptDao.xml
  70. 14
      dq-financial-hrms/target/classes/mapper/hrms/EmployeePositionDao.xml
  71. 14
      dq-financial-hrms/target/classes/mapper/hrms/EmployeeRoleDao.xml
  72. 23
      dq-financial-hrms/target/classes/mapper/hrms/PermissionDao.xml
  73. 83
      dq-financial-hrms/target/classes/mapper/hrms/PositionDao.xml
  74. 16
      dq-financial-hrms/target/classes/mapper/hrms/RoleDao.xml
  75. 14
      dq-financial-hrms/target/classes/mapper/hrms/RolePermissionDao.xml
  76. 25
      dq-financial-hrms/target/classes/mapper/hrms/UserDao.xml
  77. BIN
      dq-financial-hrms/target/test-classes/com/daqing/financial/hrms/DqFinancialHrmsApplicationTests.class
  78. BIN
      dq-framework-common/target/classes/com/daqing/framework/client/DqFinancialList.class
  79. BIN
      dq-framework-common/target/classes/com/daqing/framework/exception/CustomException.class
  80. BIN
      dq-framework-common/target/classes/com/daqing/framework/exception/ExceptionCast.class
  81. BIN
      dq-framework-common/target/classes/com/daqing/framework/exception/ExceptionCatch.class
  82. BIN
      dq-framework-common/target/classes/com/daqing/framework/model/Constant$CloudService.class
  83. BIN
      dq-framework-common/target/classes/com/daqing/framework/model/Constant$MenuType.class
  84. BIN
      dq-framework-common/target/classes/com/daqing/framework/model/Constant$ScheduleStatus.class
  85. BIN
      dq-framework-common/target/classes/com/daqing/framework/model/Constant.class
  86. BIN
      dq-framework-common/target/classes/com/daqing/framework/model/request/RequestData.class
  87. BIN
      dq-framework-common/target/classes/com/daqing/framework/model/response/CommonCode.class
  88. BIN
      dq-framework-common/target/classes/com/daqing/framework/model/response/ResponseResult.class
  89. BIN
      dq-framework-common/target/classes/com/daqing/framework/model/response/ResultCode.class
  90. BIN
      dq-framework-common/target/classes/com/daqing/framework/web/BaseController.class
  91. BIN
      dq-framework-common/target/classes/com/daqing/framework/xss/SQLFilter.class
  92. BIN
      dq-framework-model/target/classes/com/daqing/framework/domain/crms/CompanyCustomerEntity.class
  93. BIN
      dq-framework-model/target/classes/com/daqing/framework/domain/crms/CustomerEntity.class
  94. BIN
      dq-framework-model/target/classes/com/daqing/framework/domain/crms/PersonalCustomerEntity.class
  95. BIN
      dq-framework-model/target/classes/com/daqing/framework/domain/crms/ext/CrmsConstant$CustomerType.class
  96. BIN
      dq-framework-model/target/classes/com/daqing/framework/domain/crms/ext/CrmsConstant.class
  97. BIN
      dq-framework-model/target/classes/com/daqing/framework/domain/crms/ext/CustomerCompanyTO.class
  98. BIN
      dq-framework-model/target/classes/com/daqing/framework/domain/crms/ext/CustomerCompanyVO.class
  99. BIN
      dq-framework-model/target/classes/com/daqing/framework/domain/crms/ext/CustomerPersonalTO.class
  100. BIN
      dq-framework-model/target/classes/com/daqing/framework/domain/crms/ext/CustomerPersonalVO.class
  101. Some files were not shown because too many files have changed in this diff Show More

@ -37,5 +37,4 @@ public class SwaggerConfig {
return new ApiInfoBuilder().title("大庆智慧金融平台api文档").description("大庆智慧金融平台api文档")
.version("1.0").build();
}
}

@ -1,15 +1,12 @@
package com.daqing.financial.crms;
import com.daqing.framework.domain.crms.CustomerEntity;
import com.daqing.framework.domain.crms.PersonalCustomerEntity;
import com.daqing.framework.domain.crms.ext.CustomerCompanyTO;
import com.daqing.framework.domain.crms.ext.CustomerPersonalTO;
import com.daqing.framework.domain.crms.request.CustomerRequest;
import com.daqing.framework.model.response.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
import java.util.Map;
@ -58,4 +55,10 @@ public interface CustomerControllerApi {
*/
@ApiOperation(value = "更新个人类型客户信息", notes = "更新个人类型客户信息")
ResponseResult updatePersonal(CustomerPersonalTO customerPersonalTO);
/**
* 更新企业类型客户信息
*/
@ApiOperation(value = "更新企业类型客户信息", notes = "更新企业类型客户信息")
ResponseResult updateCompany(CustomerCompanyTO customerCompanyTO);
}

@ -97,4 +97,14 @@ public class CustomerController implements CustomerControllerApi {
boolean result = customerService.updateCustomerPersonal(customerPersonalTO.getCustomerEntity(), customerPersonalTO.getPersonalCustomerEntity());
return result ? ResponseResult.SUCCESS() : ResponseResult.FAIL();
}
/**
* 更新企业类型客户信息
*/
@PostMapping("/updateCompany")
@Override
public ResponseResult updateCompany(@RequestBody CustomerCompanyTO customerCompanyTO) {
boolean result = customerService.updateCustomerCompany(customerCompanyTO.getCustomerEntity(), customerCompanyTO.getCompanyCustomerEntity());
return result ? ResponseResult.SUCCESS() : ResponseResult.FAIL();
}
}

@ -17,4 +17,7 @@ public interface CompanyCustomerDao extends BaseMapper<CompanyCustomerEntity> {
CompanyCustomerEntity queryCompanyCustomerById(Long id);
boolean saveCompanyCustomer(CompanyCustomerEntity companyCustomerEntity);
boolean updateCompanyCustomer(CompanyCustomerEntity companyCustomerEntity);
}

@ -32,4 +32,5 @@ public interface CustomerDao extends BaseMapper<CustomerEntity> {
boolean saveCustomer(CustomerEntity customerEntity);
boolean updateCustomer(CustomerEntity customerEntity);
}

@ -31,5 +31,7 @@ public interface CustomerService extends IService<CustomerEntity> {
boolean saveCustomerCompany(CustomerEntity customerEntity, CompanyCustomerEntity companyCustomerEntity);
boolean updateCustomerPersonal(CustomerEntity customerEntity, PersonalCustomerEntity personalCustomerEntity);
boolean updateCustomerCompany(CustomerEntity customerEntity, CompanyCustomerEntity companyCustomerEntity);
}

@ -180,6 +180,7 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerDao, CustomerEntity
* @param personalCustomerEntity 企业类型信息
* @return
*/
@Transactional
@Override
public boolean updateCustomerPersonal(CustomerEntity customerEntity, PersonalCustomerEntity personalCustomerEntity) {
customerEntity.setMotifyTime(new Date());
@ -187,6 +188,20 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerDao, CustomerEntity
return customerDao.updateCustomer(customerEntity) && personalCustomerDao.updatePersonalCustomer(personalCustomerEntity);
}
/**
* 更新企业类型客户信息
* @param customerEntity 客户基本信息
* @param companyCustomerEntity 企业类型信息
* @return
*/
@Transactional
@Override
public boolean updateCustomerCompany(CustomerEntity customerEntity, CompanyCustomerEntity companyCustomerEntity) {
customerEntity.setMotifyTime(new Date());
companyCustomerEntity.setCustomerId(customerEntity.getId());
return customerDao.updateCustomer(customerEntity) && companyCustomerDao.updateCompanyCustomer(companyCustomerEntity);
}
/**
* 选择某段时间内客户信息的时间参数校验
*

@ -33,4 +33,12 @@
#{businessSource},#{customerId});
</insert>
<!-- 更新企业类型客户信息 -->
<update id="updateCompanyCustomer" parameterType="com.daqing.framework.domain.crms.CompanyCustomerEntity">
UPDATE crms_company_customer
SET registered_capital=#{registeredCapital},industry=#{industry},years=#{years},region=#{region},shareholder=#{shareholder},
affiliated_company=#{affiliatedCompany},emp_num=#{empNum},linkman=#{linkman},business_source=#{businessSource}
WHERE customer_id = #{customerId}
</update>
</mapper>

@ -51,7 +51,7 @@
living_situation=#{livingSituation},residence_addr=#{residenceAddr},business_source=#{businessSource},
emergency_linkman=#{emergencyLinkman},emergency_linkman_relationship=#{emergencyLinkmanRelationship},
emergency_linkman_phone=#{emergencyLinkmanPhone}
WHERE customer_id = #{customer_id}
WHERE customer_id = #{customerId}
</update>
</mapper>

@ -0,0 +1,18 @@
#服务名称
spring.application.name=dq-financial-crms
#配置中心地址
spring.cloud.nacos.config.server-addr=192.168.31.142:8848
spring.cloud.nacos.config.namespace=1f69d47e-0aeb-4a1e-8ab4-0e84dfb86354
#spring.cloud.nacos.config.group=prod
spring.cloud.nacos.config.ext-config[0].data-id=datasource.yml
spring.cloud.nacos.config.ext-config[0].group=dev
spring.cloud.nacos.config.ext-config[0].refresh=true
spring.cloud.nacos.config.ext-config[1].data-id=mybatis.yml
spring.cloud.nacos.config.ext-config[1].group=dev
spring.cloud.nacos.config.ext-config[1].refresh=true
spring.cloud.nacos.config.ext-config[2].data-id=other.yml
spring.cloud.nacos.config.ext-config[2].group=dev
spring.cloud.nacos.config.ext-config[2].refresh=true

@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<!--定义日志文件的存储地址,使用绝对路径-->
<property name="LOG_HOME" value="d:/logs/daqing/crms"/>
<!-- Console 输出设置 -->
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
<charset>utf8</charset>
</encoder>
</appender>
<!-- 按照每天生成日志文件 -->
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!--日志文件输出的文件名-->
<fileNamePattern>${LOG_HOME}/crms.%d{yyyy-MM-dd}.log</fileNamePattern>
</rollingPolicy>
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<!-- 异步输出 -->
<appender name="ASYNC" class="ch.qos.logback.classic.AsyncAppender">
<!-- 不丢失日志.默认的,如果队列的80%已满,则会丢弃TRACT、DEBUG、INFO级别的日志 -->
<discardingThreshold>0</discardingThreshold>
<!-- 更改默认的队列的深度,该值会影响性能.默认值为256 -->
<queueSize>512</queueSize>
<!-- 添加附加的appender,最多只能添加一个 -->
<appender-ref ref="FILE"/>
</appender>
<logger name="org.apache.ibatis.cache.decorators.LoggingCache" level="DEBUG" additivity="false">
<appender-ref ref="CONSOLE"/>
</logger>
<logger name="org.springframework.boot" level="DEBUG"/>
<root level="info">
<!--<appender-ref ref="ASYNC"/>-->
<appender-ref ref="FILE"/>
<appender-ref ref="CONSOLE"/>
</root>
</configuration>

@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.daqing.financial.crms.dao.CompanyCustomerDao">
<!-- 可根据自己的需求,是否要使用 -->
<resultMap type="com.daqing.framework.domain.crms.CompanyCustomerEntity" id="companyCustomerMap">
<result property="id" column="id"/>
<result property="registeredCapital" column="registered_capital"/>
<result property="industry" column="industry"/>
<result property="years" column="years"/>
<result property="region" column="region"/>
<result property="shareholder" column="shareholder"/>
<result property="affiliatedCompany" column="affiliated_company"/>
<result property="empNum" column="emp_num"/>
<result property="linkman" column="linkman"/>
<result property="businessSource" column="business_source"/>
<result property="customerId" column="customer_id"/>
</resultMap>
<!-- 根据客户基本信息id查询企业类型客户的信息 -->
<select id="queryCompanyCustomerById" parameterType="long" resultType="com.daqing.framework.domain.crms.CompanyCustomerEntity">
SELECT registered_capital,industry,years,region,shareholder,affiliated_company,emp_num,linkman,business_source
FROM crms_company_customer
WHERE customer_id = #{id}
</select>
<!-- 插入企业类型客户信息 -->
<insert id="saveCompanyCustomer" parameterType="com.daqing.framework.domain.crms.CompanyCustomerEntity">
INSERT INTO crms_company_customer
(id,registered_capital,industry,years,region,shareholder,affiliated_company,emp_num,linkman,business_source,customer_id)
values (#{id},#{registeredCapital},#{industry},#{years},#{region},#{shareholder},#{affiliatedCompany},#{empNum},#{linkman},
#{businessSource},#{customerId});
</insert>
<!-- 更新企业类型客户信息 -->
<update id="updateCompanyCustomer" parameterType="com.daqing.framework.domain.crms.CompanyCustomerEntity">
UPDATE crms_company_customer
SET registered_capital=#{registeredCapital},industry=#{industry},years=#{years},region=#{region},shareholder=#{shareholder},
affiliated_company=#{affiliatedCompany},emp_num=#{empNum},linkman=#{linkman},business_source=#{businessSource}
WHERE customer_id = #{customerId}
</update>
</mapper>

@ -0,0 +1,86 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.daqing.financial.crms.dao.CustomerDao">
<!-- 可根据自己的需求,是否要使用 -->
<resultMap type="com.daqing.framework.domain.crms.CustomerEntity" id="customerMap">
<result property="id" column="id"/>
<result property="code" column="code"/>
<result property="type" column="type"/>
<result property="manager" column="manager"/>
<result property="name" column="name"/>
<result property="addr" column="addr"/>
<result property="phone" column="phone"/>
<result property="password" column="password"/>
<result property="wechatId" column="wechat_id"/>
<result property="delOrNot" column="del_or_not"/>
<result property="status" column="status"/>
<result property="createTime" column="create_time"/>
<result property="motifyTime" column="motify_time"/>
</resultMap>
<!-- 查询客户列表(所有)、根据创建时间筛选、根据客户类型筛选、根据客户编号或者名称搜索 -->
<select id="queryList" parameterType="com.daqing.framework.domain.crms.request.CustomerRequest" resultType="com.daqing.framework.domain.crms.CustomerEntity">
SELECT id,code,type,name,phone,manager
FROM crms_customer
WHERE del_or_not = 0
<if test="cr.codeOrName != null and cr.codeOrName != '' ">
AND (name LIKE CONCAT('%',#{cr.codeOrName},'%') OR code LIKE CONCAT('%',#{cr.codeOrName},'%'))
</if>
<if test="cr.customerType != null">
AND type = #{cr.customerType}
</if>
<if test="cr.startTime != null and cr.startTime != '' ">
AND create_time &gt;= #{cr.startTime}
</if>
<if test="cr.endTime != null and cr.endTime != '' ">
AND create_time &lt;= #{cr.endTime}
</if>
ORDER BY create_time DESC
</select>
<!-- 根据id查询客户的基本信息 -->
<select id="queryCustomerById" parameterType="long" resultType="com.daqing.framework.domain.crms.CustomerEntity">
SELECT id,code,type,manager,name,addr,phone
FROM crms_customer
WHERE del_or_not = 0
AND id = #{id}
</select>
<!-- 根据id更新是否删除字段 -->
<update id="updateCustomerById" >
UPDATE crms_customer
SET del_or_not = 1
WHERE id IN
<foreach collection="ids" open="(" close=")" separator="," item="id">
#{id}
</foreach>
</update>
<!-- 根据id查询客户姓名 -->
<select id="queryCustomerNameById" resultType="string">
SELECT name
FROM crms_customer
WHERE del_or_not = 0
AND id IN
<foreach collection="ids" open="(" close=")" separator="," item="id">
#{id}
</foreach>
</select>
<!-- 插入客户基本信息 -->
<insert id="saveCustomer" parameterType="com.daqing.framework.domain.crms.CustomerEntity">
INSERT INTO crms_customer
(id,code,type,manager,name,addr,phone,del_or_not,status,create_time,motify_time)
VALUES (#{id},#{code},#{type},#{manager},#{name},#{addr},#{phone},0,0,#{createTime},#{motifyTime})
</insert>
<!-- 更新客户基本信息 -->
<update id="updateCustomer" parameterType="com.daqing.framework.domain.crms.CustomerEntity">
UPDATE crms_customer
SET manager=#{manager},name=#{name},addr=#{addr},phone=#{phone},motify_time=#{motifyTime}
WHERE id = #{id}
</update>
</mapper>

@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.daqing.financial.crms.dao.PersonalCustomerDao">
<!-- 可根据自己的需求,是否要使用 -->
<resultMap type="com.daqing.framework.domain.crms.PersonalCustomerEntity" id="personalCustomerMap">
<result property="id" column="id"/>
<result property="customerId" column="customer_id"/>
<result property="idCard" column="id_card"/>
<result property="age" column="age"/>
<result property="gender" column="gender"/>
<result property="maritalStatus" column="marital_status"/>
<result property="education" column="education"/>
<result property="employer" column="employer"/>
<result property="position" column="position"/>
<result property="workingYears" column="working_years"/>
<result property="socialSecurityNum" column="social_security_num"/>
<result property="livingSituation" column="living_situation"/>
<result property="residenceAddr" column="residence_addr"/>
<result property="businessSource" column="business_source"/>
<result property="emergencyLinkman" column="emergency_linkman"/>
<result property="emergencyLinkmanRelationship" column="emergency_linkman_relationship"/>
<result property="emergencyLinkmanPhone" column="emergency_linkman_phone"/>
</resultMap>
<!-- 根据客户基本信息id查询个人类型客户的信息 -->
<select id="queryPersonalCustomerById" parameterType="long" resultType="com.daqing.framework.domain.crms.PersonalCustomerEntity">
SELECT id_card,age,gender,marital_status,education,employer,position,working_years,social_security_num,
living_situation,residence_addr,business_source,emergency_linkman,emergency_linkman_relationship,
emergency_linkman_phone
FROM crms_personal_customer
WHERE customer_id = #{id}
</select>
<!-- 插入个人类型的客户信息 -->
<insert id="savePersonalCustomer" parameterType="com.daqing.framework.domain.crms.PersonalCustomerEntity">
INSERT INTO crms_personal_customer
(id,customer_id,id_card,age,gender,marital_status,education,employer,position,working_years,social_security_num,living_situation
,residence_addr,business_source,emergency_linkman,emergency_linkman_relationship,emergency_linkman_phone)
VALUES (#{id},#{customerId},#{idCard},#{age},#{gender},#{maritalStatus},#{education},#{employer},#{position},#{workingYears},
#{socialSecurityNum},#{livingSituation},#{residenceAddr},#{businessSource},#{emergencyLinkman},#{emergencyLinkmanRelationship},
#{emergencyLinkmanPhone});
</insert>
<!-- 更新个人类型的客户信息 -->
<update id="updatePersonalCustomer" parameterType="com.daqing.framework.domain.crms.PersonalCustomerEntity">
UPDATE crms_personal_customer
SET id_card=#{idCard},age=#{age},gender=#{gender},marital_status=#{maritalStatus},education=#{education},
employer=#{employer},position=#{position},working_years=#{workingYears},social_security_num=#{socialSecurityNum},
living_situation=#{livingSituation},residence_addr=#{residenceAddr},business_source=#{businessSource},
emergency_linkman=#{emergencyLinkman},emergency_linkman_relationship=#{emergencyLinkmanRelationship},
emergency_linkman_phone=#{emergencyLinkmanPhone}
WHERE customer_id = #{customerId}
</update>
</mapper>

@ -21,9 +21,8 @@ public interface DeptDao extends BaseMapper<DeptEntity> {
Integer getEmpDeptCount(@Param("deptId") Long deptId);
<<<<<<< Updated upstream
List<DeptEntity> getByPositionId(@Param("positionId") Long positionId);
=======
List<DepartmentVO> listDepartment();
>>>>>>> Stashed changes
}

@ -0,0 +1,18 @@
#服务名称
spring.application.name=dq-financial-hrms
#配置中心地址
spring.cloud.nacos.config.server-addr=192.168.31.142:8848
spring.cloud.nacos.config.namespace=4c56c2f9-b6a3-4e7b-88b8-b1001e86dfd6
#spring.cloud.nacos.config.group=prod
spring.cloud.nacos.config.ext-config[0].data-id=datasource.yml
spring.cloud.nacos.config.ext-config[0].group=dev
spring.cloud.nacos.config.ext-config[0].refresh=true
spring.cloud.nacos.config.ext-config[1].data-id=mybatis.yml
spring.cloud.nacos.config.ext-config[1].group=dev
spring.cloud.nacos.config.ext-config[1].refresh=true
spring.cloud.nacos.config.ext-config[2].data-id=other.yml
spring.cloud.nacos.config.ext-config[2].group=dev
spring.cloud.nacos.config.ext-config[2].refresh=true

@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<!--定义日志文件的存储地址,使用绝对路径-->
<property name="LOG_HOME" value="d:/logs/daqing/hrms"/>
<!-- Console 输出设置 -->
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
<charset>utf8</charset>
</encoder>
</appender>
<!-- 按照每天生成日志文件 -->
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!--日志文件输出的文件名-->
<fileNamePattern>${LOG_HOME}/hrms.%d{yyyy-MM-dd}.log</fileNamePattern>
</rollingPolicy>
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<!-- 异步输出 -->
<appender name="ASYNC" class="ch.qos.logback.classic.AsyncAppender">
<!-- 不丢失日志.默认的,如果队列的80%已满,则会丢弃TRACT、DEBUG、INFO级别的日志 -->
<discardingThreshold>0</discardingThreshold>
<!-- 更改默认的队列的深度,该值会影响性能.默认值为256 -->
<queueSize>512</queueSize>
<!-- 添加附加的appender,最多只能添加一个 -->
<appender-ref ref="FILE"/>
</appender>
<logger name="org.apache.ibatis.cache.decorators.LoggingCache" level="DEBUG" additivity="false">
<appender-ref ref="CONSOLE"/>
</logger>
<logger name="org.springframework.boot" level="DEBUG"/>
<root level="info">
<!--<appender-ref ref="ASYNC"/>-->
<appender-ref ref="FILE"/>
<appender-ref ref="CONSOLE"/>
</root>
</configuration>

@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.daqing.financial.hrms.dao.DeptDao">
<!-- 可根据自己的需求,是否要使用 -->
<resultMap type="com.daqing.framework.domain.hrms.DeptEntity" id="deptMap">
<result property="id" column="id"/>
<result property="name" column="name"/>
<result property="parentId" column="parent_id"/>
<result property="level" column="level"/>
<result property="sort" column="sort"/>
<result property="createTime" column="create_time"/>
<result property="motifyTime" column="motify_time"/>
</resultMap>
<!-- 部门树及各级部门下的员工 -->
<select id="getMaxSort" parameterType="java.lang.Long" resultType="java.lang.Integer">
SELECT MAX(sort) FROM hrms_dept WHERE parent_id = #{parentId}
</select>
<select id="getEmpDeptCount" parameterType="java.lang.Long" resultType="java.lang.Integer">
SELECT count(1) FROM hrms_employee_dept WHERE dept_id = #{deptId}
</select>
<select id="getByPositionId" resultType="com.daqing.framework.domain.hrms.DeptEntity">
SELECT
d.*
FROM
hrms_dept d
INNER JOIN hrms_dept_position dp ON d.id = dp.dept_id
WHERE
dp.position_id = #{positionId}
</select>
<select id="listDepartment" resultType="com.daqing.framework.domain.hrms.DepartmentVO">
SELECT id,name,parent_id,sort
FROM hrms_dept
</select>
</mapper>

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.daqing.financial.hrms.dao.DeptPositionDao">
<!-- 可根据自己的需求,是否要使用 -->
<resultMap type="com.daqing.framework.domain.hrms.DeptPositionEntity" id="deptPositionMap">
<result property="id" column="id"/>
<result property="deptId" column="dept_id"/>
<result property="positionId" column="position_id"/>
</resultMap>
<insert id="saveBatch" parameterType="java.util.List">
INSERT INTO hrms_dept_position (id, dept_id, position_id)
VALUES
<foreach collection="list" index="index" separator="," item="item">
(#{item.id}, #{item.deptId}, #{item.positionId})
</foreach>
</insert>
<delete id="deleteByPositionId">
DELETE
FROM
hrms_dept_position
WHERE
position_id = #{positionId}
</delete>
</mapper>

@ -0,0 +1,60 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.daqing.financial.hrms.dao.EmployeeDao">
<!-- 可根据自己的需求,是否要使用 -->
<resultMap type="com.daqing.framework.domain.hrms.EmployeeEntity" id="employeeMap">
<result property="id" column="id"/>
<result property="name" column="name"/>
<result property="gender" column="gender"/>
<result property="birthday" column="birthday"/>
<result property="officePhone" column="office_phone"/>
<result property="phone" column="phone"/>
<result property="companyMail" column="company_mail"/>
<result property="spareMail" column="spare_mail"/>
<result property="positionDescription" column="position_description"/>
<result property="jobNumber" column="job_number"/>
<result property="headPortaritUrl" column="head_portarit_url"/>
<result property="userId" column="user_id"/>
</resultMap>
<resultMap type="com.daqing.framework.domain.hrms.ext.EmployeeTO" id="employeeTO">
<id property="id" column="eid"/>
<result property="empName" column="emp_name"/>
<collection property="deptNames" ofType="string">
<result column="dept_name"/> <!-- 员工和部门是多对多,从单个员工的角度看为一对多 -->
</collection>
</resultMap>
<!-- 根据员工id查询员工的姓名和部门信息 -->
<select id="getEmployeeAndDeptById" resultMap="employeeTO">
SELECT e.id eid,e.name emp_name,d.name dept_name
FROM hrms_employee e
LEFT JOIN hrms_employee_dept ed
ON e.id = ed.employee_id
LEFT JOIN hrms_dept d
ON d.id = ed.dept_id
WHERE e.id
IN
<foreach collection="ids" open="(" separator="," close=")" item="id">
#{id}
</foreach>
</select>
<!-- 根据id查询员工姓名 -->
<select id="getEmployeeById" parameterType="long" resultType="com.daqing.framework.domain.hrms.EmployeeEntity">
SELECT name FROM hrms_employee WHERE id = #{id}
</select>
<!-- 根据部门id获取该部门下面所有的员工 -->
<select id="listEmployeeByDeptId" parameterType="long" resultType="com.daqing.framework.domain.hrms.ext.EmployeeVO">
SELECT e.id,e.name
FROM hrms_employee e
LEFT JOIN hrms_employee_dept ed
ON e.id = ed.employee_id
LEFT JOIN hrms_dept d
ON ed.dept_id = d.id
WHERE d.id = #{id}
</select>
</mapper>

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.daqing.financial.hrms.dao.EmployeeDeptDao">
<!-- 可根据自己的需求,是否要使用 -->
<resultMap type="com.daqing.framework.domain.hrms.EmployeeDeptEntity" id="employeeDeptMap">
<result property="id" column="id"/>
<result property="employeeId" column="employee_id"/>
<result property="deptId" column="dept_id"/>
</resultMap>
</mapper>

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.daqing.financial.hrms.dao.EmployeePositionDao">
<!-- 可根据自己的需求,是否要使用 -->
<resultMap type="com.daqing.framework.domain.hrms.EmployeePositionEntity" id="employeePositionMap">
<result property="id" column="id"/>
<result property="empId" column="emp_id"/>
<result property="positionId" column="position_id"/>
</resultMap>
</mapper>

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.daqing.financial.hrms.dao.EmployeeRoleDao">
<!-- 可根据自己的需求,是否要使用 -->
<resultMap type="com.daqing.framework.domain.hrms.EmployeeRoleEntity" id="employeeRoleMap">
<result property="id" column="id"/>
<result property="userId" column="user_id"/>
<result property="roleId" column="role_id"/>
</resultMap>
</mapper>

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.daqing.financial.hrms.dao.PermissionDao">
<!-- 可根据自己的需求,是否要使用 -->
<resultMap type="com.daqing.framework.domain.hrms.PermissionEntity" id="permissionMap">
<result property="id" column="id"/>
<result property="code" column="code"/>
<result property="name" column="name"/>
<result property="url" column="url"/>
<result property="parentId" column="parent_id"/>
<result property="level" column="level"/>
<result property="menuOrNot" column="menu_or_not"/>
<result property="status" column="status"/>
<result property="sort" column="sort"/>
<result property="icon" column="icon"/>
<result property="createTime" column="create_time"/>
<result property="motifyTime" column="motify_time"/>
</resultMap>
</mapper>

@ -0,0 +1,83 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.daqing.financial.hrms.dao.PositionDao">
<!-- 可根据自己的需求,是否要使用 -->
<resultMap type="com.daqing.framework.domain.hrms.PositionEntity" id="positionMap">
<result property="id" column="id"/>
<result property="name" column="name"/>
<result property="introduction" column="introduction"/>
<result property="sort" column="sort"/>
<result property="createUser" column="create_user"/>
<result property="createTime" column="create_time"/>
<result property="motifyTime" column="motify_time"/>
</resultMap>
<resultMap type="com.daqing.framework.domain.hrms.ext.PositionVO" id="positionVOMap">
<result property="id" column="position_id"/>
<result property="name" column="position_name"/>
<result property="deptNames" column="dept_name"/>
<result property="createUserName" column="crate_user_name"/>
<result property="createTime" column="create_time"/>
</resultMap>
<select id="pageByCondition" resultMap="positionVOMap">
SELECT
p.`id`, position_id,
p.`name` position_name,
GROUP_CONCAT(d.`name` SEPARATOR '/') dept_name,
e.`name` crate_user_name,
p.create_time
FROM
hrms_position p
INNER JOIN hrms_dept_position dp ON p.id = dp.position_id
INNER JOIN hrms_dept d ON dp.dept_id = d.id
INNER JOIN hrms_employee e ON p.create_user = e.id
<if test="queryMsg != null and queryMsg != ''">
WHERE
(
d.`name` LIKE CONCAT('%',#{queryMsg},'%')
OR p.`name` LIKE CONCAT('%',#{queryMsg},'%')
)
</if>
GROUP BY
p.id
ORDER BY
p.create_time
</select>
<select id="getCountByNameAndDeptId" resultType="java.lang.Integer">
SELECT
COUNT(1)
FROM
hrms_position p
INNER JOIN
hrms_dept_position dp
ON
p.id = dp.position_id
WHERE
dp.dept_id = #{deptId}
AND
p.name = #{name}
</select>
<select id="getCountByNameAndDeptIdAndId" resultType="java.lang.Integer">
SELECT
COUNT(1)
FROM
hrms_position p
INNER JOIN
hrms_dept_position dp
ON
p.id = dp.position_id
WHERE
dp.dept_id = #{deptId}
AND
p.name = #{name}
AND
p.id != #{id}
</select>
</mapper>

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.daqing.financial.hrms.dao.RoleDao">
<!-- 可根据自己的需求,是否要使用 -->
<resultMap type="com.daqing.framework.domain.hrms.RoleEntity" id="roleMap">
<result property="id" column="id"/>
<result property="name" column="name"/>
<result property="description" column="description"/>
<result property="createTime" column="create_time"/>
<result property="motifyTime" column="motify_time"/>
</resultMap>
</mapper>

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.daqing.financial.hrms.dao.RolePermissionDao">
<!-- 可根据自己的需求,是否要使用 -->
<resultMap type="com.daqing.framework.domain.hrms.RolePermissionEntity" id="rolePermissionMap">
<result property="id" column="id"/>
<result property="roleId" column="role_id"/>
<result property="permissionId" column="permission_id"/>
</resultMap>
</mapper>

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.daqing.financial.hrms.dao.UserDao">
<!-- 可根据自己的需求,是否要使用 -->
<resultMap type="com.daqing.framework.domain.hrms.UserEntity" id="userMap">
<result property="id" column="id"/>
<result property="account" column="account"/>
<result property="phoneAccount" column="phone_account"/>
<result property="password" column="password"/>
<result property="loginNum" column="login_num"/>
<result property="lasttime" column="lasttime"/>
<result property="wechatId" column="wechat_id"/>
<result property="status" column="status"/>
<result property="disableStartTime" column="disable_start_time"/>
<result property="disableEndTime" column="disable_end_time"/>
<result property="disableCause" column="disable_cause"/>
<result property="delOrNot" column="del_or_not"/>
<result property="createTime" column="create_time"/>
<result property="motifyTime" column="motify_time"/>
</resultMap>
</mapper>

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save