Commit 416ad1c6 authored by neo.wang's avatar neo.wang

Merge branch 'dev_neo' into 'dev'

[DEV] fixed template group self defind sql

See merge request root/atms!43
parents acfd3c60 940f57c3
......@@ -279,18 +279,28 @@
<result column="TemplateGroupName" jdbcType="VARCHAR" property="templateGroupName" />
</resultMap>
<select id="getSingleOrgByOrgIDToOSTGDto" parameterType="map" resultMap="OrganizationServiceTemplateGroupDto">
select
m.ID as ID,
m.ServiceTypeID as ServiceTypeID,
m.OrganizationID as OrganizationID,
m.TemplateGroupID as TemplateGroupID,
t.Name as TemplateGroupName
from OrganizationServiceTemplateGroup as m
left join TemplateGroup as t on m.TemplateGroupID = t.ID
where m.OrganizationID = #{orgId}
order by m.ServiceTypeID
SELECT
m.ID AS ID,
m.service_type_id AS ServiceTypeID,
m.organization_id AS OrganizationID,
m.template_group_id AS TemplateGroupID,
t.Name AS TemplateGroupName
FROM
organization_service_template_group AS m
LEFT JOIN
template_group AS t ON m.template_group_id = t.ID
WHERE
m.organization_id = #{orgId}
order by m.service_type_id
</select>
<select id="getOrgnizationServiceTemplateGroupOrgNames" parameterType="java.lang.String" resultType="java.lang.String">
SELECT q.Name FROM OrganizationServiceTemplateGroup p LEFT JOIN Organization q on p.OrganizationID=q.ID WHERE p.TemplateGroupID=#{templateGroupDtoID,jdbcType=VARCHAR} AND q.IsActive=1
SELECT
q.Name
FROM
organization_service_template_group p
LEFT JOIN
Organization q ON p.organization_id = q.ID
WHERE
p.template_group_id = #{templateGroupDtoID,jdbcType=VARCHAR} AND q.IsActive = 1
</select>
</mapper>
\ No newline at end of file
package pwc.taxtech.atms;
import pwc.taxtech.atms.dto.taxadmin.ProjectDisplayDto;
import pwc.taxtech.atms.entitiy.Project;
import java.lang.reflect.Field;
public class FieldsCompare {
......@@ -12,18 +9,30 @@ public class FieldsCompare {
Field[] declaredFields = destClass.getDeclaredFields();
Field[] clsFields = clsSource.getDeclaredFields();
System.out.println(destClass.getName());
System.out.println();
System.out.println(clsSource.getName());
System.out.println(clsFields.toString());
System.out.println(clsSource.getName() + ":" + clsFields.length);
System.out.println(destClass.getName() + ":" + declaredFields.length);
System.out.println(clsSource.getName()+":"+clsFields.length);
System.out.println(destClass.getName()+":"+declaredFields.length);
Field[] fieldsMax = null;
Field[] fieldsMin = null;
Class fieldsMaxClass = null;
Class fieldsMinClass = null;
if (declaredFields.length > clsFields.length) {
fieldsMax = declaredFields;
fieldsMin = clsFields;
Field[] fieldsMax=null;
Class fieldsMinClass=null;
if(declaredFields.length>clsFields.length){
fieldsMax=declaredFields;
fieldsMinClass=clsSource;
}else {
fieldsMax=clsFields;
fieldsMinClass=destClass;
fieldsMaxClass = destClass;
fieldsMinClass = clsSource;
} else {
fieldsMax = clsFields;
fieldsMaxClass = clsSource;
fieldsMin = declaredFields;
fieldsMinClass = destClass;
}
for (Field field : fieldsMax) {
......@@ -36,12 +45,26 @@ public class FieldsCompare {
fieldsMinClass.getDeclaredField(fieldName);
} catch (NoSuchFieldException e) {
System.out.println("NoSuchFieldException "+fieldsMinClass.getName()+ "."+ fieldName);
System.out.println("NoSuchFieldException " + fieldsMinClass.getName() + "." + fieldName);
}
}
for (Field field : fieldsMin) {
field.setAccessible(true);
String fieldName = field.getName();
try {
if ("serialVersionUID".equals(fieldName)) {
continue;
}
fieldsMaxClass.getDeclaredField(fieldName);
} catch (NoSuchFieldException e) {
System.out.println("NoSuchFieldException " + fieldsMaxClass.getName() + "." + fieldName);
}
}
}
public static void main(String[] args) throws IllegalAccessException, ClassNotFoundException {
map(new Project(),new ProjectDisplayDto());
// map(new CompanyBalanceDto(), new CompanyBalance());
}
}
\ No newline at end of file
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