Commit 5d0c7966 authored by neo's avatar neo

[dev] fixed some project query sql bug

parent 4f452d87
...@@ -111,7 +111,7 @@ public interface ProjectMapper extends MyMapper { ...@@ -111,7 +111,7 @@ public interface ProjectMapper extends MyMapper {
int updateByPrimaryKey(Project record); int updateByPrimaryKey(Project record);
@Select("<script>" + @Select("<script>" +
"SELECT distinct " + "SELECT DISTINCT " +
" p.CREATE_TIME AS CreateTime, " + " p.CREATE_TIME AS CreateTime, " +
" p.IS_ACTIVE AS IsActive, " + " p.IS_ACTIVE AS IsActive, " +
" p.ORGANIZATION_ID AS OrganizationID, " + " p.ORGANIZATION_ID AS OrganizationID, " +
...@@ -123,16 +123,16 @@ public interface ProjectMapper extends MyMapper { ...@@ -123,16 +123,16 @@ public interface ProjectMapper extends MyMapper {
" p.REGION_ID AS RegionID, " + " p.REGION_ID AS RegionID, " +
" region.SHORT_NAME AS RegionName, " + " region.SHORT_NAME AS RegionName, " +
" p.RULE_TYPE AS RuleType, " + " p.RULE_TYPE AS RuleType, " +
" PROJECT_SERVICE_TYPE.SERVICE_TYPE_ID AS ServiceTypeID, " + " projectServiceType.SERVICE_TYPE_ID AS ServiceTypeID, " +
" p.UPDATE_TIME AS UpdateTime, " + " p.UPDATE_TIME AS UpdateTime, " +
" SERVICE_TYPE.Name AS ServiceTypeName, " + " serviceType.Name AS ServiceTypeName, " +
" organization.Name AS OrganizationName, " + " organization.Name AS OrganizationName, " +
" industry.Name AS IndustryName, " + " industry.Name AS IndustryName, " +
" PROJECT_SERVICE_TYPE.TemplateGroupID AS TemplateGroupID, " + " projectServiceType.Template_Group_ID AS TemplateGroupID, " +
" TEMPLATE_GROUP.Name AS TemplateGroupName, " + " templateGroup.Name AS TemplateGroupName, " +
" p.CLIENT_CODE AS ClientCode, " + " p.CLIENT_CODE AS ClientCode, " +
" p.DB_NAME AS DbName, " + " p.DB_NAME AS DbName, " +
" TRUE AS HaveCreateProject, " + " 1 AS HaveCreateProject, " +
" p.ENTERPRISE_ACCOUNT_SET_ID AS EnterpriseAccountSetID, " + " p.ENTERPRISE_ACCOUNT_SET_ID AS EnterpriseAccountSetID, " +
" p.START_PERIOD AS StartPeriod, " + " p.START_PERIOD AS StartPeriod, " +
" p.END_PERIOD AS EndPeriod " + " p.END_PERIOD AS EndPeriod " +
...@@ -141,11 +141,11 @@ public interface ProjectMapper extends MyMapper { ...@@ -141,11 +141,11 @@ public interface ProjectMapper extends MyMapper {
" JOIN " + " JOIN " +
" Organization org ON p.ORGANIZATION_ID = org.id " + " Organization org ON p.ORGANIZATION_ID = org.id " +
" JOIN " + " JOIN " +
" PROJECT_SERVICE_TYPE PROJECT_SERVICE_TYPE ON p.id = projectServiceType.PROJECT_ID " + " PROJECT_SERVICE_TYPE projectServiceType ON p.id = projectServiceType.PROJECT_ID " +
" JOIN " + " JOIN " +
" Organization organization ON p.ORGANIZATION_ID = organization.id " + " Organization organization ON p.ORGANIZATION_ID = organization.id " +
" JOIN " + " JOIN " +
" ServiceType serviceType ON projectServiceType.SERVICE_TYPE_ID = serviceType.id " + " SERVICE_TYPE serviceType ON projectServiceType.SERVICE_TYPE_ID = serviceType.id " +
" JOIN " + " JOIN " +
" Industry industry ON p.INDUSTRY_ID = industry.id " + " Industry industry ON p.INDUSTRY_ID = industry.id " +
" JOIN " + " JOIN " +
...@@ -153,7 +153,7 @@ public interface ProjectMapper extends MyMapper { ...@@ -153,7 +153,7 @@ public interface ProjectMapper extends MyMapper {
" JOIN " + " JOIN " +
" Region region ON p.REGION_ID = region.id " + " Region region ON p.REGION_ID = region.id " +
" JOIN " + " JOIN " +
" ENTERPRISE_ACCOUNT_SET_ORG enterOrg ON p.ENTERPRISE_ACCOUNT_SET_ID = enterOrg.ENTERPRISE_ACCOUNT_SET_ID " + " ENTERPRISE_ACCOUNT_SET_ORG enterOrg ON p.ENTERPRISE_ACCOUNT_SET_ID = enterOrg.ENTERPRISE_ACCOUNT_SET_ID" +
" <where>" + " <where>" +
" p.IS_ACTIVE=1 and serviceType.IS_ACTIVE=1 and p.ORGANIZATION_ID = enterOrg.ORGANIZATION_ID" + " p.IS_ACTIVE=1 and serviceType.IS_ACTIVE=1 and p.ORGANIZATION_ID = enterOrg.ORGANIZATION_ID" +
" <if test=\"orgId != null and orgId !='' \">AND org.id=#{orgId}</if>" + " <if test=\"orgId != null and orgId !='' \">AND org.id=#{orgId}</if>" +
......
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