Commit e6854abe authored by gary's avatar gary

sql debug

parent c82ec81e
......@@ -29,8 +29,8 @@ public interface MyUserMapper extends MyMapper {
List<Map<String, Object>> selectUserOrganizationMapByUserId(@Param(value = "userId") String userId);
@Select("select urd.id as id, urd.dimension_value_id as DimensionValueID, urd.dimension_id as DimensionID," +
" urd.userid as UserID, urd.is_accessible as IsAccessible, urd.has_original_role as HasOriginalRole, u.user_name as UserName"
+ "from user_dimension_value urd " + "join user u on urd.user_id = u.id " + "where u.status = 1")
" urd.user_id as UserID, urd.is_accessible as IsAccessible, urd.has_original_role as HasOriginalRole, u.user_name as UserName"
+ " from user_dimension_value urd " + "join user u on urd.user_id = u.id " + "where u.status = 1")
@Results({ @Result(id = true, column = "id", property = "id"),
@Result(column = "DimensionValueID", property = "dimensionValueId", javaType = String.class),
@Result(column = "DimensionID", property = "dimensionId", javaType = String.class),
......@@ -56,11 +56,12 @@ public interface MyUserMapper extends MyMapper {
@Result(column = "IsAccessible", property = "isAccessible") })
List<UserOrganization> selectUserOrganizationByUserId();
@Select("select p.dimension_value_id as DimensionValueID, p.dimension_id as DimensionID, d.name as DimensionName, p.dimension_value_name as DimensionValue "
+ "from (select id as DimensionValueID, name as DimensionValueName, is_active as IsActive, #{dimensionId} as DimensionID, "
+ "create_time as CreateTime,update_time as UpdateTime from business_unit where is_active = 1 " + "union "
+ "select id as DimensionValueID, name as DimensionValueName,is_active as IsActive,dimension_id as DimensionID,create_time as CreateTime,update_time as UpdateTime "
+ "from dimension_value) p " + "join dimension d on p.dimension_id = d.id " + "where d.is_active = 1")
@Select("select p.Dimension_Value_ID, p.Dimension_ID, d.Name as DimensionName, p.Dimension_Value_Name as Dimension_Value "
+ "from (select id as Dimension_Value_ID, name as Dimension_Value_Name, is_active as Is_Active, #{dimensionId} as Dimension_ID, "
+ "create_time as Create_Time, update_time as Update_Time from business_unit where is_active = 1 " + "union "
+ "select id as DimensionValueID, name as DimensionValueName, is_active as Is_Active, dimension_id as Dimension_ID, create_time as Create_Time, update_time as Update_Time"
+ " from dimension_value) p " + "join dimension d on p.Dimension_ID = d.id " + "where d.is_active = 1")
@Results({ @Result(column = "DimensionValueID", property = "dimensionValueID"),
@Result(column = "DimensionID", property = "dimensionId"),
@Result(column = "DimensionName", property = "dimensionName"),
......
......@@ -144,7 +144,7 @@ public interface UserMapper extends MyMapper {
@Select("select u.user_name as userName, o.id as organizationId, o.name as organizationName, "
+ "u.email as email, u.status as status, u.attempt_times as attemptTimes, u.create_time as createTime, "
+ "u.expiration_date as expirationDate, u.is_admin as isAdmin, u.id as id, u.locked_time as lockedTime, "
+ "u.login_type as loginType, u.pass_word as password, u.password_update_time as passwordUpdateTime, u.update_time as updateTime from user u "
+ "u.login_type as loginType, u.password as password, u.password_update_time as passwordUpdateTime, u.update_time as updateTime from user u "
+ "left join organization o on u.organization_id = o.id "
+ "where u.id = #{userId}")
List<UserDto> selectUserWithOrgInfoById(@Param(value = "userId") String userId);
......@@ -155,8 +155,8 @@ public interface UserMapper extends MyMapper {
List<RoleInfo> selectUserRoleInfoById(@Param(value = "userId") String userId);
@Select("select udv.role_id as roleID, r.name as roleName, udv.user_dimension_value_id as id "
+ "FROM user_dimension_value_role UDV "
+ "JOIN role R ON UDV.role_id = R.ID")
+ "FROM user_dimension_value_role udv "
+ "JOIN role r ON udv.role_id = r.ID")
List<UserOrgRoleDto> selectUserDimensionValueRole();
@Select("select q.role_id as roleID, r.name as roleName, q.user_organization_id as id "
......
......@@ -280,22 +280,22 @@
<select id="getDimensionValueOrgDtoList" resultMap="OrgDtoForGetDimValueOrgList">
SELECT
dvq.dimension_value_id AS DIMENSION_VALUE_ID,
dvgq.organization_id AS ORGANIZATION_ID,
dvgq.name AS ORGANIZATION_NAME,
dvq.dimension_id AS DIMENSION_ID,
DVQ.dimension_value_id AS DIMENSION_VALUE_ID,
DVGQ.organization_id AS ORGANIZATION_ID,
DVGQ.name AS ORGANIZATION_NAME,
DVQ.dimension_id AS DIMENSION_ID,
d.name AS DIMENSION_NAME,
dvq.dimension_value_name AS DIMENSION_VALUE,
dvgq.organization_id AS ID
DVQ.dimension_value_name AS DIMENSION_VALUE,
DVGQ.organization_id AS ID
FROM
(
SELECT
org.id AS DIMENSION_VALUE_ID,
org.name AS DIMENSION_VALUE_NAME,
org.isactive AS IS_ACTIVE,
org.is_active AS IS_ACTIVE,
"c61a5bd6-a996-4952-9869-d053966537e8" DIMENSION_ID,
org.createtime AS CREATE_TIME,
org.updatetime AS UPDATE_TIME
org.create_time AS CREATE_TIME,
org.update_time AS UPDATE_TIME
FROM
organization org
where
......@@ -306,7 +306,7 @@
SELECT
bu.id AS DIMENSION_VALUE_ID,
bu.name AS DIMENSION_VALUE_NAME,
bu.isactive AS IS_ACTIVE,
bu.is_active AS IS_ACTIVE,
"c61a5bd6-a996-4952-9869-d053995237e5" DIMENSION_ID,
bu.create_time AS CREATE_TIME,
bu.update_time AS UPDATE_TIME
......@@ -354,7 +354,7 @@
)
d
on
dvq.dimension_id = d.id
DVQ.dimension_id = d.id
JOIN
(
SELECT
......@@ -409,7 +409,7 @@
)
DVGQ
on
dvq.dimension_value_id = dvgq.dimension_value_id
DVQ.DIMENSION_VALUE_ID = DVGQ.DIMENSION_VALUE_ID
</select>
<resultMap id="OrgDtoForGetAllCusDimOrgList" type="pwc.taxtech.atms.dpo.OrganizationDto">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment