From 84d1c713f5275b77083efdd00e616f3181f64d37 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期五, 07 六月 2024 15:04:46 +0800
Subject: [PATCH] 修复bug

---
 server/dmvisit_service/src/main/resources/mappers/SystemDataPermissionMapper.xml |   47 ++++
 server/dmvisit_service/src/main/resources/mappers/SystemRoleMapper.xml           |   49 ++++
 server/dmvisit_service/src/main/resources/mappers/SystemUserMapper.xml           |   70 ++++++
 server/dmvisit_service/src/main/resources/mappers/SystemPermissionMapper.xml     |   63 +++++
 server/dmvisit_service/src/main/resources/mappers/SystemPositionMapper.xml       |   49 ++++
 admin/package-lock.json                                                          |  160 +++++++-------
 admin/vue.config.js                                                              |    2 
 server/dmvisit_service/src/main/resources/mappers/SystemDictMapper.xml           |   37 +++
 server/dmvisit_service/src/main/resources/mappers/SystemDepartmentMapper.xml     |   43 +++
 server/dmvisit_service/src/main/resources/mappers/SystemDictDataMapper.xml       |   47 ++++
 server/dmvisit_service/src/main/resources/mappers/SystemMenuMapper.xml           |   58 +++++
 11 files changed, 545 insertions(+), 80 deletions(-)

diff --git a/admin/package-lock.json b/admin/package-lock.json
index 697ba46..50d988a 100644
--- a/admin/package-lock.json
+++ b/admin/package-lock.json
@@ -1819,63 +1819,6 @@
           "integrity": "sha1-/q7SVZc9LndVW4PbwIhRpsY1IPo=",
           "dev": true
         },
-        "ansi-styles": {
-          "version": "4.3.0",
-          "resolved": "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-4.3.0.tgz",
-          "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
-          "dev": true,
-          "optional": true,
-          "requires": {
-            "color-convert": "^2.0.1"
-          }
-        },
-        "chalk": {
-          "version": "4.1.2",
-          "resolved": "https://registry.npmmirror.com/chalk/-/chalk-4.1.2.tgz",
-          "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
-          "dev": true,
-          "optional": true,
-          "requires": {
-            "ansi-styles": "^4.1.0",
-            "supports-color": "^7.1.0"
-          }
-        },
-        "color-convert": {
-          "version": "2.0.1",
-          "resolved": "https://registry.npmmirror.com/color-convert/-/color-convert-2.0.1.tgz",
-          "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
-          "dev": true,
-          "optional": true,
-          "requires": {
-            "color-name": "~1.1.4"
-          }
-        },
-        "color-name": {
-          "version": "1.1.4",
-          "resolved": "https://registry.npmmirror.com/color-name/-/color-name-1.1.4.tgz",
-          "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
-          "dev": true,
-          "optional": true
-        },
-        "has-flag": {
-          "version": "4.0.0",
-          "resolved": "https://registry.npmmirror.com/has-flag/-/has-flag-4.0.0.tgz",
-          "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
-          "dev": true,
-          "optional": true
-        },
-        "loader-utils": {
-          "version": "2.0.4",
-          "resolved": "https://registry.npmmirror.com/loader-utils/-/loader-utils-2.0.4.tgz",
-          "integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==",
-          "dev": true,
-          "optional": true,
-          "requires": {
-            "big.js": "^5.2.2",
-            "emojis-list": "^3.0.0",
-            "json5": "^2.1.2"
-          }
-        },
         "ssri": {
           "version": "8.0.1",
           "resolved": "https://registry.npm.taobao.org/ssri/download/ssri-8.0.1.tgz?cache=0&sync_timestamp=1617826515595&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fssri%2Fdownload%2Fssri-8.0.1.tgz",
@@ -1883,28 +1826,6 @@
           "dev": true,
           "requires": {
             "minipass": "^3.1.1"
-          }
-        },
-        "supports-color": {
-          "version": "7.2.0",
-          "resolved": "https://registry.npmmirror.com/supports-color/-/supports-color-7.2.0.tgz",
-          "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
-          "dev": true,
-          "optional": true,
-          "requires": {
-            "has-flag": "^4.0.0"
-          }
-        },
-        "vue-loader-v16": {
-          "version": "npm:vue-loader@16.8.3",
-          "resolved": "https://registry.npmmirror.com/vue-loader/-/vue-loader-16.8.3.tgz",
-          "integrity": "sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA==",
-          "dev": true,
-          "optional": true,
-          "requires": {
-            "chalk": "^4.1.0",
-            "hash-sum": "^2.0.0",
-            "loader-utils": "^2.0.0"
           }
         }
       }
@@ -13568,6 +13489,87 @@
         }
       }
     },
+    "vue-loader-v16": {
+      "version": "npm:vue-loader@16.8.3",
+      "resolved": "https://registry.npmmirror.com/vue-loader/-/vue-loader-16.8.3.tgz",
+      "integrity": "sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA==",
+      "dev": true,
+      "optional": true,
+      "requires": {
+        "chalk": "^4.1.0",
+        "hash-sum": "^2.0.0",
+        "loader-utils": "^2.0.0"
+      },
+      "dependencies": {
+        "ansi-styles": {
+          "version": "4.3.0",
+          "resolved": "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-4.3.0.tgz",
+          "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "color-convert": "^2.0.1"
+          }
+        },
+        "chalk": {
+          "version": "4.1.2",
+          "resolved": "https://registry.npmmirror.com/chalk/-/chalk-4.1.2.tgz",
+          "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "ansi-styles": "^4.1.0",
+            "supports-color": "^7.1.0"
+          }
+        },
+        "color-convert": {
+          "version": "2.0.1",
+          "resolved": "https://registry.npmmirror.com/color-convert/-/color-convert-2.0.1.tgz",
+          "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "color-name": "~1.1.4"
+          }
+        },
+        "color-name": {
+          "version": "1.1.4",
+          "resolved": "https://registry.npmmirror.com/color-name/-/color-name-1.1.4.tgz",
+          "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
+          "dev": true,
+          "optional": true
+        },
+        "has-flag": {
+          "version": "4.0.0",
+          "resolved": "https://registry.npmmirror.com/has-flag/-/has-flag-4.0.0.tgz",
+          "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
+          "dev": true,
+          "optional": true
+        },
+        "loader-utils": {
+          "version": "2.0.4",
+          "resolved": "https://registry.npmmirror.com/loader-utils/-/loader-utils-2.0.4.tgz",
+          "integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==",
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "big.js": "^5.2.2",
+            "emojis-list": "^3.0.0",
+            "json5": "^2.1.2"
+          }
+        },
+        "supports-color": {
+          "version": "7.2.0",
+          "resolved": "https://registry.npmmirror.com/supports-color/-/supports-color-7.2.0.tgz",
+          "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "has-flag": "^4.0.0"
+          }
+        }
+      }
+    },
     "vue-property-decorator": {
       "version": "8.5.1",
       "resolved": "https://registry.npmjs.org/vue-property-decorator/-/vue-property-decorator-8.5.1.tgz",
diff --git a/admin/vue.config.js b/admin/vue.config.js
index c856bf8..19105d0 100644
--- a/admin/vue.config.js
+++ b/admin/vue.config.js
@@ -21,7 +21,7 @@
         // target: 'http://218.23.218.228:8018/admin_interface',
         // http://218.23.218.228:9912/admin_interface
         // http://facepay.huasunsolar.com/admin_interface
-        target: 'http://facepay.huasunsolar.com/admin_interface',
+        target: 'http://localhost:10028',
         changeOrigin: true,
         pathRewrite: {
           [`^${[process.env.VUE_APP_API_PREFIX]}`]: ''
diff --git a/server/dmvisit_service/src/main/resources/mappers/SystemDataPermissionMapper.xml b/server/dmvisit_service/src/main/resources/mappers/SystemDataPermissionMapper.xml
new file mode 100644
index 0000000..13f821f
--- /dev/null
+++ b/server/dmvisit_service/src/main/resources/mappers/SystemDataPermissionMapper.xml
@@ -0,0 +1,47 @@
+<?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.doumee.dao.system.SystemDataPermissionMapper">
+
+  <!-- 鏌ヨ閮ㄩ棬鍒楄〃 -->
+  <resultMap id="SystemDataPermissionListVO" type="com.doumee.dao.system.vo.SystemDataPermissionListVO" autoMapping="true">
+    <id column="ID" property="id"/>
+    <association property="role" javaType="com.doumee.dao.system.model.SystemRole">
+      <result column="ROLE_ID" property="id"/>
+      <result column="ROLE_CODE" property="code"/>
+      <result column="ROLE_NAME" property="name"/>
+    </association>
+    <association property="createUserInfo" javaType="com.doumee.dao.system.model.SystemUser">
+      <result column="CREATE_USER_ID" property="id"/>
+      <result column="CREATE_USER_NAME" property="username"/>
+    </association>
+    <association property="updateUserInfo" javaType="com.doumee.dao.system.model.SystemUser">
+      <result column="UPDATE_USER_ID" property="id"/>
+      <result column="UPDATE_USER_NAME" property="username"/>
+    </association>
+  </resultMap>
+  <select id="selectManageList" resultMap="SystemDataPermissionListVO">
+    SELECT
+      sdp.`ID`, sdp.`BUSINESS_CODE`, sdp.`ROLE_ID`, sdp.`TYPE`, sdp.`CUSTOM_DATA`, sdp.`DISABLED`, sdp.`REMARK`, sdp.DISABLED, sdp.`CREATE_TIME`, sdp.`UPDATE_TIME`,
+      role.`ID` AS ROLE_ID, role.`CODE` AS ROLE_CODE, role.`NAME` AS ROLE_NAME,
+      create_user.ID CREATE_USER_ID, create_user.`USERNAME` CREATE_USER_NAME,
+      update_user.ID UPDETE_USER_ID, update_user.`USERNAME` UPDATE_USER_NAME
+    FROM SYSTEM_DATA_PERMISSION sdp
+    INNER JOIN `SYSTEM_ROLE` role ON role.ID = sdp.ROLE_ID
+    LEFT JOIN `SYSTEM_USER` create_user ON create_user.ID = sdp.CREATE_USER
+    LEFT JOIN `SYSTEM_USER` update_user ON update_user.ID = sdp.UPDATE_USER
+    <where>
+      sdp.DELETED = 0
+      <if test="dto.businessCode != null and dto.businessCode != ''">
+        AND sdp.`BUSINESS_CODE` = #{dto.businessCode}
+      </if>
+      <if test="dto.roleId != null">
+        AND role.`ID` =  #{dto.roleId}
+      </if>
+      <if test="dto.type != null">
+        AND sdp.`TYPE` =  #{dto.type}
+      </if>
+    </where>
+    ${orderByClause}
+  </select>
+
+</mapper>
diff --git a/server/dmvisit_service/src/main/resources/mappers/SystemDepartmentMapper.xml b/server/dmvisit_service/src/main/resources/mappers/SystemDepartmentMapper.xml
new file mode 100644
index 0000000..0a57944
--- /dev/null
+++ b/server/dmvisit_service/src/main/resources/mappers/SystemDepartmentMapper.xml
@@ -0,0 +1,43 @@
+<?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.doumee.dao.system.SystemDepartmentMapper">
+
+  <!-- 鏌ヨ閮ㄩ棬鍒楄〃 -->
+  <resultMap id="SystemDepartmentListVO" type="com.doumee.dao.system.vo.SystemDepartmentListVO" autoMapping="true">
+    <id column="ID" property="id"/>
+    <association property="createUserInfo" javaType="com.doumee.dao.system.model.SystemUser">
+      <result column="CREATE_USER_ID" property="id"/>
+      <result column="CREATE_USER_NAME" property="username"/>
+    </association>
+    <association property="updateUserInfo" javaType="com.doumee.dao.system.model.SystemUser">
+      <result column="UPDATE_USER_ID" property="id"/>
+      <result column="UPDATE_USER_NAME" property="username"/>
+    </association>
+  </resultMap>
+  <select id="selectManageList" parameterType="com.doumee.dao.system.dto.QuerySystemDepartmentDTO" resultMap="SystemDepartmentListVO">
+    SELECT
+      dept.`ID`, dept.`PARENT_ID`, dept.`CODE`, dept.`NAME`, dept.`PHONE`, dept.`EMAIL`, dept.`CREATE_TIME`, dept.`UPDATE_TIME`, dept.`CREATE_USER`, dept.`UPDATE_USER`, dept.`DELETED`,
+      create_user.ID CREATE_USER_ID, create_user.`USERNAME` CREATE_USER_NAME,
+      update_user.ID UPDETE_USER_ID, update_user.`USERNAME` UPDATE_USER_NAME,
+      COUNT(usr.ID) USER_COUNT
+    FROM SYSTEM_DEPARTMENT dept
+    LEFT JOIN `SYSTEM_DEPARTMENT_USER` sdu ON sdu.DEPARTMENT_ID = dept.ID AND sdu.DELETED = 0
+    LEFT JOIN `SYSTEM_USER` usr ON usr.ID = sdu.USER_ID AND usr.DELETED = 0
+    LEFT JOIN `SYSTEM_USER` create_user ON create_user.ID = dept.CREATE_USER
+    LEFT JOIN `SYSTEM_USER` update_user ON update_user.ID = dept.UPDATE_USER
+    <where>
+      dept.DELETED = 0
+      <if test="id != null">
+        AND dept.ID = #{id}
+      </if>
+      <if test="ids != null">
+        AND dept.ID IN
+        <foreach collection="ids" item="id" separator="," open="(" close=")">
+          #{id}
+        </foreach>
+      </if>
+    </where>
+    GROUP BY dept.`ID`
+  </select>
+
+</mapper>
diff --git a/server/dmvisit_service/src/main/resources/mappers/SystemDictDataMapper.xml b/server/dmvisit_service/src/main/resources/mappers/SystemDictDataMapper.xml
new file mode 100644
index 0000000..ae3a515
--- /dev/null
+++ b/server/dmvisit_service/src/main/resources/mappers/SystemDictDataMapper.xml
@@ -0,0 +1,47 @@
+<?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.doumee.dao.system.SystemDictDataMapper">
+
+  <!-- 鏌ヨ瀛楀吀鏁版嵁鍒楄〃 -->
+  <resultMap id="SystemDictDataListVO" type="com.doumee.dao.system.vo.SystemDictDataListVO" autoMapping="true">
+    <id column="ID" property="id"/>
+    <association property="createUserInfo" javaType="com.doumee.dao.system.model.SystemUser">
+      <result column="CREATE_USER_ID" property="id"/>
+      <result column="CREATE_USER_NAME" property="username"/>
+    </association>
+    <association property="updateUserInfo" javaType="com.doumee.dao.system.model.SystemUser">
+      <result column="UPDATE_USER_ID" property="id"/>
+      <result column="UPDATE_USER_NAME" property="username"/>
+    </association>
+  </resultMap>
+  <select id="selectManageList" parameterType="com.doumee.dao.system.dto.QuerySystemDictDataDTO" resultMap="SystemDictDataListVO">
+    SELECT
+      dict_data.`ID`, dict_data.`DICT_ID`, dict_data.`CODE`, dict_data.`LABEL`, dict_data.`SORT`, dict_data.`DISABLED`, dict_data.`CREATE_TIME`, dict_data.`UPDATE_TIME`, dict_data.`CREATE_USER`, dict_data.`UPDATE_USER`,
+      create_user.ID CREATE_USER_ID, create_user.`USERNAME` CREATE_USER_NAME,
+      update_user.ID UPDETE_USER_ID, update_user.`USERNAME` UPDATE_USER_NAME
+    FROM SYSTEM_DICT_DATA dict_data
+    LEFT JOIN `SYSTEM_USER` create_user ON create_user.ID = dict_data.CREATE_USER
+    LEFT JOIN `SYSTEM_USER` update_user ON update_user.ID = dict_data.UPDATE_USER
+    <where>
+      dict_data.DELETED = 0
+      <if test="dictId != null">
+        AND dict_data.`DICT_ID` = #{dictId}
+      </if>
+    </where>
+  </select>
+  <select id="list" resultType="com.doumee.dao.system.vo.SystemDictDataListVO">
+    SELECT
+      dict_data.`ID`, dict_data.`DICT_ID`, dict_data.`CODE`, dict_data.`LABEL`
+    FROM SYSTEM_DICT_DATA dict_data
+    <where>
+      dict_data.DELETED = 0
+      <if test="codes != null and codes.size > 0">
+        AND dict_data.`LABEL` in
+        <foreach collection="codes" index="index" item="code" open="(" separator="," close=")">
+          #{code}
+        </foreach>
+      </if>
+    </where>
+  </select>
+
+</mapper>
diff --git a/server/dmvisit_service/src/main/resources/mappers/SystemDictMapper.xml b/server/dmvisit_service/src/main/resources/mappers/SystemDictMapper.xml
new file mode 100644
index 0000000..76338cb
--- /dev/null
+++ b/server/dmvisit_service/src/main/resources/mappers/SystemDictMapper.xml
@@ -0,0 +1,37 @@
+<?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.doumee.dao.system.SystemDictMapper">
+
+  <!-- 鏌ヨ瀛楀吀鍒楄〃 -->
+  <resultMap id="SystemDictListVO" type="com.doumee.dao.system.vo.SystemDictListVO" autoMapping="true">
+    <id column="ID" property="id"/>
+    <association property="createUserInfo" javaType="com.doumee.dao.system.model.SystemUser">
+      <result column="CREATE_USER_ID" property="id"/>
+      <result column="CREATE_USER_NAME" property="username"/>
+    </association>
+    <association property="updateUserInfo" javaType="com.doumee.dao.system.model.SystemUser">
+      <result column="UPDATE_USER_ID" property="id"/>
+      <result column="UPDATE_USER_NAME" property="username"/>
+    </association>
+  </resultMap>
+  <select id="selectManageList" parameterType="com.doumee.dao.system.dto.QuerySystemDictDTO" resultMap="SystemDictListVO">
+    SELECT
+      dict.`ID`, dict.`CODE`, dict.`NAME`, dict.`REMARK`, dict.`CREATE_TIME`, dict.`UPDATE_TIME`, dict.`CREATE_USER`, dict.`UPDATE_USER`,
+      create_user.ID CREATE_USER_ID, create_user.`USERNAME` CREATE_USER_NAME,
+      update_user.ID UPDETE_USER_ID, update_user.`USERNAME` UPDATE_USER_NAME
+    FROM SYSTEM_DICT dict
+    LEFT JOIN `SYSTEM_USER` create_user ON create_user.ID = dict.CREATE_USER
+    LEFT JOIN `SYSTEM_USER` update_user ON update_user.ID = dict.UPDATE_USER
+    <where>
+      dict.DELETED = 0
+      <if test="dto.code != null and dto.code != ''">
+        AND dict.`CODE` LIKE concat('%', #{dto.code}, '%')
+      </if>
+      <if test="dto.name != null and dto.name != ''">
+        AND dict.`NAME` LIKE concat('%', #{dto.name}, '%')
+      </if>
+    </where>
+    ${orderByClause}
+  </select>
+
+</mapper>
diff --git a/server/dmvisit_service/src/main/resources/mappers/SystemMenuMapper.xml b/server/dmvisit_service/src/main/resources/mappers/SystemMenuMapper.xml
new file mode 100644
index 0000000..0ec9ada
--- /dev/null
+++ b/server/dmvisit_service/src/main/resources/mappers/SystemMenuMapper.xml
@@ -0,0 +1,58 @@
+<?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.doumee.dao.system.SystemMenuMapper">
+
+  <!-- 鏌ヨ鑿滃崟鍒楄〃 -->
+  <resultMap id="SystemMenuListVO" type="com.doumee.dao.system.vo.SystemMenuListVO" autoMapping="true">
+    <id column="ID" property="id"/>
+    <association property="createUserInfo" javaType="com.doumee.dao.system.model.SystemUser">
+      <result column="CREATE_USER_ID" property="id"/>
+      <result column="CREATE_USER_NAME" property="username"/>
+    </association>
+    <association property="updateUserInfo" javaType="com.doumee.dao.system.model.SystemUser">
+      <result column="UPDATE_USER_ID" property="id"/>
+      <result column="UPDATE_USER_NAME" property="username"/>
+    </association>
+  </resultMap>
+  <select id="selectManageList" resultMap="SystemMenuListVO">
+    SELECT
+      menu.`ID`, menu.`PARENT_ID`, menu.`NAME`, menu.`PATH`, menu.`FIXED`, menu.`REMARK`, menu.`DISABLED`, menu.SORT, menu.`ICON`, menu.`CREATE_TIME`, menu.`UPDATE_TIME`, menu.`CREATE_USER`, menu.`UPDATE_USER`, menu.`DELETED`,
+      create_user.ID CREATE_USER_ID, create_user.`USERNAME` CREATE_USER_NAME,
+      update_user.ID UPDETE_USER_ID, update_user.`USERNAME` UPDATE_USER_NAME
+    FROM SYSTEM_MENU menu
+    LEFT JOIN `SYSTEM_USER` create_user ON create_user.ID = menu.CREATE_USER
+    LEFT JOIN `SYSTEM_USER` update_user ON update_user.ID = menu.UPDATE_USER
+    <where>
+      menu.DELETED = 0
+    </where>
+    ORDER BY menu.SORT
+  </select>
+
+  <!-- 鏌ヨ鑿滃崟鏍� -->
+  <select id="selectByUserId" parameterType="java.lang.Integer" resultType="com.doumee.dao.system.model.SystemMenu">
+    SELECT
+      DISTINCT menu.`ID`, menu.`PARENT_ID`, menu.`NAME`, menu.`PATH`, menu.`REMARK`, menu.`DISABLED`, menu.SORT, menu.`ICON`, menu.`CREATE_TIME`, menu.`UPDATE_TIME`, menu.`CREATE_USER`, menu.`UPDATE_USER`, menu.`DELETED`
+    FROM `SYSTEM_MENU` menu
+    INNER JOIN SYSTEM_ROLE_MENU role_menu ON role_menu.MENU_ID = menu.ID AND role_menu.DELETED = 0
+    INNER JOIN SYSTEM_USER_ROLE user_role ON user_role.ROLE_ID = role_menu.ROLE_ID AND user_role.DELETED = 0
+    <where>
+      AND menu.DELETED = 0
+      AND menu.DISABLED = 0
+      AND user_role.USER_ID = #{userId}
+    </where>
+    ORDER BY menu.SORT
+  </select>
+
+  <!-- 鏍规嵁瑙掕壊ID鏌ヨ鑿滃崟鍒楄〃 -->
+  <select id="selectByRoleId" parameterType="java.lang.Integer" resultType="com.doumee.dao.system.model.SystemMenu">
+    SELECT
+      menu.`ID`, menu.`PARENT_ID`, menu.`NAME`, menu.`PATH`, menu.`REMARK`, menu.`DISABLED`, menu.SORT, menu.`ICON`, menu.`CREATE_TIME`, menu.`UPDATE_TIME`, menu.`CREATE_USER`, menu.`UPDATE_USER`, menu.`DELETED`
+    FROM `SYSTEM_MENU` menu
+    INNER JOIN `SYSTEM_ROLE_MENU` role_menu ON role_menu.MENU_ID = menu.ID AND role_menu.DELETED = 0
+    <where>
+      menu.DELETED = 0
+      AND role_menu.ROLE_ID = #{roleId}
+    </where>
+  </select>
+
+</mapper>
diff --git a/server/dmvisit_service/src/main/resources/mappers/SystemPermissionMapper.xml b/server/dmvisit_service/src/main/resources/mappers/SystemPermissionMapper.xml
new file mode 100644
index 0000000..9568ef5
--- /dev/null
+++ b/server/dmvisit_service/src/main/resources/mappers/SystemPermissionMapper.xml
@@ -0,0 +1,63 @@
+<?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.doumee.dao.system.SystemPermissionMapper">
+
+  <!-- 鏌ヨ绯荤粺鏉冮檺鍒楄〃 -->
+  <resultMap id="SystemPermissionListVO" type="com.doumee.dao.system.vo.SystemPermissionListVO" autoMapping="true">
+    <id column="ID" property="id"/>
+    <association property="createUserInfo" javaType="com.doumee.dao.system.model.SystemUser">
+      <id column="CREATE_USER_ID" property="id"/>
+      <result column="CREATE_USER_NAME" property="username"/>
+    </association>
+    <association property="updateUserInfo" javaType="com.doumee.dao.system.model.SystemUser">
+      <id column="UPDATE_USER_ID" property="id"/>
+      <result column="UPDATE_USER_NAME" property="username"/>
+    </association>
+  </resultMap>
+  <select id="selectManageList" resultMap="SystemPermissionListVO">
+    SELECT
+      perm.`ID`, perm.`CODE`, perm.`NAME`, perm.`REMARK`, perm.`FIXED`, perm.`CREATE_TIME`, perm.`UPDATE_TIME`, perm.`CREATE_USER`, perm.`UPDATE_USER`, perm.`DELETED`,
+      create_user.ID CREATE_USER_ID, create_user.`USERNAME` CREATE_USER_NAME,
+      update_user.ID UPDETE_USER_ID, update_user.`USERNAME` UPDATE_USER_NAME
+    FROM SYSTEM_PERMISSION perm
+    LEFT JOIN `SYSTEM_USER` create_user ON create_user.ID = perm.CREATE_USER
+    LEFT JOIN `SYSTEM_USER` update_user ON update_user.ID = perm.UPDATE_USER
+    <where>
+      perm.DELETED = 0
+      <if test="dto.code != null">
+        AND perm.CODE LIKE CONCAT('%', #{dto.code}, '%')
+      </if>
+      <if test="dto.name != null">
+        AND perm.`NAME` LIKE CONCAT('%', #{dto.name}, '%')
+      </if>
+    </where>
+    ${orderByClause}
+  </select>
+
+  <!-- 鏍规嵁鐢ㄦ埛ID鏌ヨ鏉冮檺 -->
+  <select id="selectByUserId" parameterType="java.lang.Integer" resultType="com.doumee.dao.system.model.SystemPermission">
+    SELECT
+      perm.`ID`, perm.`CODE`, perm.`NAME`, perm.`REMARK`, perm.`CREATE_TIME`, perm.`UPDATE_TIME`, perm.`CREATE_USER`, perm.`UPDATE_USER`, perm.`DELETED`
+    FROM SYSTEM_PERMISSION perm
+    INNER JOIN SYSTEM_ROLE_PERMISSION role_perm ON role_perm.PERMISSION_ID = perm.ID AND role_perm.DELETED = 0
+    INNER JOIN SYSTEM_ROLE role ON role.ID = role_perm.ROLE_ID AND role.DELETED = 0
+    INNER JOIN SYSTEM_USER_ROLE user_role ON user_role.ROLE_ID = role.ID AND user_role.DELETED = 0
+    <where>
+      perm.DELETED = 0
+      AND user_role.USER_ID = #{userId}
+    </where>
+  </select>
+
+  <!-- 鏍规嵁瑙掕壊ID鏌ヨ鏉冮檺 -->
+  <select id="selectByRoleId" parameterType="java.lang.Integer" resultType="com.doumee.dao.system.model.SystemPermission">
+    SELECT
+      perm.`ID`, perm.`CODE`, perm.`NAME`, perm.`REMARK`, perm.`CREATE_TIME`, perm.`UPDATE_TIME`, perm.`CREATE_USER`, perm.`UPDATE_USER`, perm.`DELETED`
+    FROM SYSTEM_PERMISSION perm
+    INNER JOIN SYSTEM_ROLE_PERMISSION role_perm ON role_perm.PERMISSION_ID = perm.ID AND role_perm.DELETED = 0
+    <where>
+      perm.DELETED = 0
+      AND role_perm.ROLE_ID = #{roleId}
+    </where>
+  </select>
+
+</mapper>
diff --git a/server/dmvisit_service/src/main/resources/mappers/SystemPositionMapper.xml b/server/dmvisit_service/src/main/resources/mappers/SystemPositionMapper.xml
new file mode 100644
index 0000000..fc15235
--- /dev/null
+++ b/server/dmvisit_service/src/main/resources/mappers/SystemPositionMapper.xml
@@ -0,0 +1,49 @@
+<?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.doumee.dao.system.SystemPositionMapper">
+
+  <!-- 鏌ヨ宀椾綅鍒楄〃 -->
+  <resultMap id="SystemPositionListVO" type="com.doumee.dao.system.vo.SystemPositionListVO" autoMapping="true">
+    <id column="ID" property="id"/>
+    <association property="createUserInfo" javaType="com.doumee.dao.system.model.SystemUser">
+      <result column="CREATE_USER_ID" property="id"/>
+      <result column="CREATE_USER_NAME" property="username"/>
+    </association>
+    <association property="updateUserInfo" javaType="com.doumee.dao.system.model.SystemUser">
+      <result column="UPDATE_USER_ID" property="id"/>
+      <result column="UPDATE_USER_NAME" property="username"/>
+    </association>
+  </resultMap>
+  <select id="selectManageList" resultMap="SystemPositionListVO">
+    SELECT
+      posi.`ID`, posi.`PARENT_ID`, posi.`CODE`, posi.`NAME`, posi.`CREATE_TIME`, posi.`UPDATE_TIME`, posi.`CREATE_USER`, posi.`UPDATE_USER`,
+      create_user.ID CREATE_USER_ID, create_user.`USERNAME` CREATE_USER_NAME,
+      update_user.ID UPDETE_USER_ID, update_user.`USERNAME` UPDATE_USER_NAME,
+      COUNT(usr.ID) USER_COUNT
+    FROM SYSTEM_POSITION posi
+    LEFT JOIN `SYSTEM_POSITION_USER` spu ON spu.POSITION_ID = posi.ID AND spu.DELETED = 0
+    LEFT JOIN `SYSTEM_USER` usr ON usr.ID = spu.USER_ID AND usr.DELETED = 0
+    LEFT JOIN `SYSTEM_USER` create_user ON create_user.ID = posi.CREATE_USER
+    LEFT JOIN `SYSTEM_USER` update_user ON update_user.ID = posi.UPDATE_USER
+    <where>
+      posi.DELETED = 0
+      <if test="name != null and name != ''">
+        AND posi.`NAME` LIKE concat('%', #{name}, '%')
+      </if>
+    </where>
+    GROUP BY posi.`ID`
+  </select>
+
+  <!-- 鏌ヨ鐢ㄦ埛宀椾綅鍒楄〃 -->
+  <select id="selectByUserId" parameterType="java.lang.Integer" resultType="com.doumee.dao.system.model.SystemPosition">
+    SELECT
+      sp.`ID`, sp.`PARENT_ID`, sp.`CODE`, sp.`NAME`
+    FROM `SYSTEM_POSITION` sp
+    INNER JOIN `SYSTEM_POSITION_USER` spu ON spu.`POSITION_ID` = sp.`ID` AND spu.`DELETED` = 0
+    INNER JOIN `SYSTEM_USER` su ON su.`ID` = spu.`USER_ID`
+    <where>
+      sp.DELETED = 0
+      AND spu.USER_ID = #{userId}
+    </where>
+  </select>
+</mapper>
diff --git a/server/dmvisit_service/src/main/resources/mappers/SystemRoleMapper.xml b/server/dmvisit_service/src/main/resources/mappers/SystemRoleMapper.xml
new file mode 100644
index 0000000..e2851b9
--- /dev/null
+++ b/server/dmvisit_service/src/main/resources/mappers/SystemRoleMapper.xml
@@ -0,0 +1,49 @@
+<?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.doumee.dao.system.SystemRoleMapper">
+
+  <!-- 鏌ヨ瑙掕壊鍒楄〃 -->
+  <resultMap id="SystemRoleListVO" type="com.doumee.dao.system.vo.SystemRoleListVO" autoMapping="true">
+    <id column="ID" property="id"/>
+    <association property="createUserInfo" javaType="com.doumee.dao.system.model.SystemUser">
+      <id column="CREATE_USER_ID" property="id"/>
+      <result column="CREATE_USER_NAME" property="username"/>
+    </association>
+    <association property="updateUserInfo" javaType="com.doumee.dao.system.model.SystemUser">
+      <id column="UPDATE_USER_ID" property="id"/>
+      <result column="UPDATE_USER_NAME" property="username"/>
+    </association>
+  </resultMap>
+  <select id="selectManageList" parameterType="com.doumee.dao.system.dto.QuerySystemUserDTO" resultMap="SystemRoleListVO">
+    SELECT
+      role.ID, role.`CODE`, role.`NAME`, role.`REMARK`, role.`FIXED`, role.`CREATE_TIME`, role.`UPDATE_TIME`,
+      create_user.ID CREATE_USER_ID, create_user.`USERNAME` CREATE_USER_NAME,
+      update_user.ID UPDETE_USER_ID, update_user.`USERNAME` UPDATE_USER_NAME
+    FROM SYSTEM_ROLE role
+    LEFT JOIN `SYSTEM_USER` create_user ON create_user.ID = role.CREATE_USER
+    LEFT JOIN `SYSTEM_USER` update_user ON update_user.ID = role.UPDATE_USER
+    <where>
+      role.DELETED = 0
+      <if test="dto.code != null and dto.code != ''">
+        AND role.`CODE` LIKE CONCAT('%', #{dto.code}, '%')
+      </if>
+      <if test="dto.name != null and dto.name != ''">
+        AND role.`NAME` LIKE CONCAT('%', #{dto.name}, '%')
+      </if>
+    </where>
+    ${orderByClause}
+  </select>
+
+  <!-- 鏌ヨ鐢ㄦ埛瑙掕壊鍒楄〃 -->
+  <select id="selectByUserId" parameterType="java.lang.Integer" resultType="com.doumee.dao.system.model.SystemRole">
+    SELECT
+    role.ID, role.`CODE`, role.`NAME`, role.`REMARK`, role.`CREATE_TIME`, role.`UPDATE_TIME`
+    FROM SYSTEM_ROLE role
+    INNER JOIN SYSTEM_USER_ROLE user_role ON user_role.ROLE_ID = role.ID AND user_role.DELETED = 0
+    <where>
+      role.DELETED = 0
+      AND user_role.USER_ID = #{userId}
+    </where>
+  </select>
+
+</mapper>
diff --git a/server/dmvisit_service/src/main/resources/mappers/SystemUserMapper.xml b/server/dmvisit_service/src/main/resources/mappers/SystemUserMapper.xml
new file mode 100644
index 0000000..78d68d6
--- /dev/null
+++ b/server/dmvisit_service/src/main/resources/mappers/SystemUserMapper.xml
@@ -0,0 +1,70 @@
+<?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.doumee.dao.system.SystemUserMapper">
+
+  <!-- 鏌ヨ鐢ㄦ埛鍒楄〃 -->
+  <resultMap id="SystemUserListVO" type="com.doumee.dao.system.vo.SystemUserListVO" autoMapping="true">
+    <id column="ID" property="id"/>
+    <association property="department" javaType="com.doumee.dao.system.model.SystemDepartment">
+      <result column="DEPARTMENT_ID" property="id"/>
+      <result column="DEPARTMENT_NAME" property="name"/>
+    </association>
+    <association property="createUserInfo" javaType="com.doumee.dao.system.model.SystemUser">
+      <result column="CREATE_USER_ID" property="id"/>
+      <result column="CREATE_USER_NAME" property="username"/>
+      <result column="CREATE_REAL_NAME" property="realname"/>
+    </association>
+    <association property="updateUserInfo" javaType="com.doumee.dao.system.model.SystemUser">
+      <result column="UPDATE_USER_ID" property="id"/>
+      <result column="UPDATE_USER_NAME" property="username"/>
+      <result column="UPDATE_REAL_NAME" property="realname"/>
+    </association>
+  </resultMap>
+  <select id="selectManageList" parameterType="com.doumee.dao.system.dto.QuerySystemUserDTO" resultMap="SystemUserListVO">
+    SELECT
+      DISTINCT
+      usr.ID, usr.BIRTHDAY, usr.EMAIL, usr.EMP_NO, usr.MOBILE, usr.AVATAR, usr.USERNAME, usr.REALNAME, usr.SEX, usr.FIXED, usr.CREATE_TIME, usr.UPDATE_TIME,
+      sd.ID AS DEPARTMENT_ID, sd.`NAME` AS DEPARTMENT_NAME,usr.wechat_name,usr.status,usr.OPENID,usr.type,
+      create_user.ID CREATE_USER_ID, create_user.`USERNAME` CREATE_USER_NAME, create_user.`REALNAME` CREATE_REAL_NAME,
+      update_user.ID UPDETE_USER_ID, update_user.`USERNAME` UPDATE_USER_NAME, create_user.`REALNAME` UPDATE_REAL_NAME
+    FROM `SYSTEM_USER` usr
+    LEFT JOIN `SYSTEM_USER` create_user ON create_user.ID = usr.CREATE_USER
+    LEFT JOIN `SYSTEM_USER` update_user ON update_user.ID = usr.UPDATE_USER
+--     LEFT JOIN `SYSTEM_POSITION_USER` spu ON spu.USER_ID = usr.ID AND spu.DELETED = 0
+--     LEFT JOIN `SYSTEM_POSITION` sp ON sp.ID = spu.POSITION_ID AND sp.DELETED = 0
+    LEFT JOIN `SYSTEM_DEPARTMENT_USER` sdu ON sdu.USER_ID = usr.ID AND sdu.DELETED = 0
+    LEFT JOIN `SYSTEM_DEPARTMENT` sd ON sd.ID = sdu.DEPARTMENT_ID AND sd.DELETED = 0
+    <if test="dto.roleId != null">
+      RIGHT JOIN system_user_role sur on sur.USER_ID = usr.ID and sur.ROLE_ID = #{dto.roleId}
+    </if>
+    <where>
+      usr.DELETED = 0
+<!--      <if test="dto.positionId != null">-->
+<!--        AND spu.POSITION_ID = #{dto.positionId}-->
+<!--      </if>-->
+      <if test="dto.strictDeptId != null">
+        AND sdu.DEPARTMENT_ID = #{dto.strictDeptId}
+      </if>
+      <if test="dto.departmentIds != null and dto.departmentIds.size > 0">
+        AND sdu.DEPARTMENT_ID IN
+        <foreach collection="dto.departmentIds" open="(" close=")" separator="," item="id">
+          #{id}
+        </foreach>
+      </if>
+      <if test="dto.username != null and dto.username != ''">
+        AND usr.`USERNAME` LIKE CONCAT('%', #{dto.username}, '%')
+      </if>
+      <if test="dto.realname != null and dto.realname != ''">
+        AND usr.`REALNAME` LIKE CONCAT('%', #{dto.realname}, '%')
+      </if>
+      <if test="dto.mobile != null and dto.mobile != ''">
+        AND usr.`MOBILE` LIKE CONCAT('%', #{dto.mobile}, '%')
+      </if>
+      <if test="dto.status != null ">
+        AND  usr.`status` = #{dto.status}
+      </if>
+    </where>
+    ${orderByClause}
+  </select>
+
+</mapper>

--
Gitblit v1.9.3