Commit e6854abe authored by gary's avatar gary

sql debug

parent c82ec81e
...@@ -29,8 +29,8 @@ public interface MyUserMapper extends MyMapper { ...@@ -29,8 +29,8 @@ public interface MyUserMapper extends MyMapper {
List<Map<String, Object>> selectUserOrganizationMapByUserId(@Param(value = "userId") String userId); 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," + @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" " 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") + " 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"), @Results({ @Result(id = true, column = "id", property = "id"),
@Result(column = "DimensionValueID", property = "dimensionValueId", javaType = String.class), @Result(column = "DimensionValueID", property = "dimensionValueId", javaType = String.class),
@Result(column = "DimensionID", property = "dimensionId", javaType = String.class), @Result(column = "DimensionID", property = "dimensionId", javaType = String.class),
...@@ -56,11 +56,12 @@ public interface MyUserMapper extends MyMapper { ...@@ -56,11 +56,12 @@ public interface MyUserMapper extends MyMapper {
@Result(column = "IsAccessible", property = "isAccessible") }) @Result(column = "IsAccessible", property = "isAccessible") })
List<UserOrganization> selectUserOrganizationByUserId(); 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, " @Select("select p.Dimension_Value_ID, p.Dimension_ID, d.Name as DimensionName, p.Dimension_Value_Name as Dimension_Value "
+ "create_time as CreateTime,update_time as UpdateTime from business_unit where is_active = 1 " + "union " + "from (select id as Dimension_Value_ID, name as Dimension_Value_Name, is_active as Is_Active, #{dimensionId} as Dimension_ID, "
+ "select id as DimensionValueID, name as DimensionValueName,is_active as IsActive,dimension_id as DimensionID,create_time as CreateTime,update_time as UpdateTime " + "create_time as Create_Time, update_time as Update_Time from business_unit where is_active = 1 " + "union "
+ "from dimension_value) p " + "join dimension d on p.dimension_id = d.id " + "where d.is_active = 1") + "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"), @Results({ @Result(column = "DimensionValueID", property = "dimensionValueID"),
@Result(column = "DimensionID", property = "dimensionId"), @Result(column = "DimensionID", property = "dimensionId"),
@Result(column = "DimensionName", property = "dimensionName"), @Result(column = "DimensionName", property = "dimensionName"),
......
...@@ -144,7 +144,7 @@ public interface UserMapper extends MyMapper { ...@@ -144,7 +144,7 @@ public interface UserMapper extends MyMapper {
@Select("select u.user_name as userName, o.id as organizationId, o.name as organizationName, " @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.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.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 " + "left join organization o on u.organization_id = o.id "
+ "where u.id = #{userId}") + "where u.id = #{userId}")
List<UserDto> selectUserWithOrgInfoById(@Param(value = "userId") String userId); List<UserDto> selectUserWithOrgInfoById(@Param(value = "userId") String userId);
...@@ -155,8 +155,8 @@ public interface UserMapper extends MyMapper { ...@@ -155,8 +155,8 @@ public interface UserMapper extends MyMapper {
List<RoleInfo> selectUserRoleInfoById(@Param(value = "userId") String userId); 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 " @Select("select udv.role_id as roleID, r.name as roleName, udv.user_dimension_value_id as id "
+ "FROM user_dimension_value_role UDV " + "FROM user_dimension_value_role udv "
+ "JOIN role R ON UDV.role_id = R.ID") + "JOIN role r ON udv.role_id = r.ID")
List<UserOrgRoleDto> selectUserDimensionValueRole(); List<UserOrgRoleDto> selectUserDimensionValueRole();
@Select("select q.role_id as roleID, r.name as roleName, q.user_organization_id as id " @Select("select q.role_id as roleID, r.name as roleName, q.user_organization_id as id "
......
...@@ -280,22 +280,22 @@ ...@@ -280,22 +280,22 @@
<select id="getDimensionValueOrgDtoList" resultMap="OrgDtoForGetDimValueOrgList"> <select id="getDimensionValueOrgDtoList" resultMap="OrgDtoForGetDimValueOrgList">
SELECT SELECT
dvq.dimension_value_id AS DIMENSION_VALUE_ID, DVQ.dimension_value_id AS DIMENSION_VALUE_ID,
dvgq.organization_id AS ORGANIZATION_ID, DVGQ.organization_id AS ORGANIZATION_ID,
dvgq.name AS ORGANIZATION_NAME, DVGQ.name AS ORGANIZATION_NAME,
dvq.dimension_id AS DIMENSION_ID, DVQ.dimension_id AS DIMENSION_ID,
d.name AS DIMENSION_NAME, d.name AS DIMENSION_NAME,
dvq.dimension_value_name AS DIMENSION_VALUE, DVQ.dimension_value_name AS DIMENSION_VALUE,
dvgq.organization_id AS ID DVGQ.organization_id AS ID
FROM FROM
( (
SELECT SELECT
org.id AS DIMENSION_VALUE_ID, org.id AS DIMENSION_VALUE_ID,
org.name AS DIMENSION_VALUE_NAME, org.name AS DIMENSION_VALUE_NAME,
org.isactive AS IS_ACTIVE, org.is_active AS IS_ACTIVE,
"c61a5bd6-a996-4952-9869-d053966537e8" DIMENSION_ID, "c61a5bd6-a996-4952-9869-d053966537e8" DIMENSION_ID,
org.createtime AS CREATE_TIME, org.create_time AS CREATE_TIME,
org.updatetime AS UPDATE_TIME org.update_time AS UPDATE_TIME
FROM FROM
organization org organization org
where where
...@@ -306,7 +306,7 @@ ...@@ -306,7 +306,7 @@
SELECT SELECT
bu.id AS DIMENSION_VALUE_ID, bu.id AS DIMENSION_VALUE_ID,
bu.name AS DIMENSION_VALUE_NAME, bu.name AS DIMENSION_VALUE_NAME,
bu.isactive AS IS_ACTIVE, bu.is_active AS IS_ACTIVE,
"c61a5bd6-a996-4952-9869-d053995237e5" DIMENSION_ID, "c61a5bd6-a996-4952-9869-d053995237e5" DIMENSION_ID,
bu.create_time AS CREATE_TIME, bu.create_time AS CREATE_TIME,
bu.update_time AS UPDATE_TIME bu.update_time AS UPDATE_TIME
...@@ -354,7 +354,7 @@ ...@@ -354,7 +354,7 @@
) )
d d
on on
dvq.dimension_id = d.id DVQ.dimension_id = d.id
JOIN JOIN
( (
SELECT SELECT
...@@ -409,7 +409,7 @@ ...@@ -409,7 +409,7 @@
) )
DVGQ DVGQ
on on
dvq.dimension_value_id = dvgq.dimension_value_id DVQ.DIMENSION_VALUE_ID = DVGQ.DIMENSION_VALUE_ID
</select> </select>
<resultMap id="OrgDtoForGetAllCusDimOrgList" type="pwc.taxtech.atms.dpo.OrganizationDto"> <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