Commit 70e85bf1 authored by neo.wang's avatar neo.wang

Merge branch 'dev_neo' into 'dev'

[DEV] re build voucher mapper

See merge request root/atms!37
parents 707b9abc 2ec9521c
...@@ -51,7 +51,7 @@ public class InputInvoiceImportController { ...@@ -51,7 +51,7 @@ public class InputInvoiceImportController {
} }
@RequestMapping(value = "getInputInvoiceList/{period}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @RequestMapping(value = "getInputInvoiceList/{period}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public ResponseEntity getInputInvoiceList(Integer period) { public ResponseEntity getInputInvoiceList(@PathVariable Integer period) {
return ResponseEntity.ok().body(inputInvoiceDataImportService.getInputInvoiceList(period)); return ResponseEntity.ok().body(inputInvoiceDataImportService.getInputInvoiceList(period));
} }
......
...@@ -191,7 +191,7 @@ public interface ProjectMapper extends MyMapper { ...@@ -191,7 +191,7 @@ public interface ProjectMapper extends MyMapper {
" st.Name AS ServiceTypeName, " + " st.Name AS ServiceTypeName, " +
" org.Name AS OrganizationName, " + " org.Name AS OrganizationName, " +
" ind.Name AS IndustryName, " + " ind.Name AS IndustryName, " +
" ostg.TemplateGroupID AS TemplateGroupID, " + " ostg.template_group_id AS TemplateGroupID, " +
" '' AS TemplateGroupName, " + " '' AS TemplateGroupName, " +
" org.ClientCode AS ClientCode, " + " org.ClientCode AS ClientCode, " +
" '' AS DbName, " + " '' AS DbName, " +
...@@ -206,9 +206,9 @@ public interface ProjectMapper extends MyMapper { ...@@ -206,9 +206,9 @@ public interface ProjectMapper extends MyMapper {
" JOIN " + " JOIN " +
" EnterpriseAccountSetOrg ea ON org.ID = ea.OrganizationID " + " EnterpriseAccountSetOrg ea ON org.ID = ea.OrganizationID " +
" JOIN " + " JOIN " +
" OrganizationServiceTemplateGroup ostg ON org.ID = ostg.OrganizationID " + " organization_service_template_group ostg ON org.ID = ostg.organization_id " +
" JOIN " + " JOIN " +
" ServiceType st ON ostg.ServiceTypeID = st.ID " + " ServiceType st ON ostg.service_type_id = st.ID " +
" JOIN " + " JOIN " +
" Industry ind ON org.IndustryID = ind.ID " + " Industry ind ON org.IndustryID = ind.ID " +
" JOIN " + " JOIN " +
......
...@@ -466,72 +466,72 @@ public class VoucherMappingExample { ...@@ -466,72 +466,72 @@ public class VoucherMappingExample {
} }
public Criteria andGroupIsNull() { public Criteria andGroupIsNull() {
addCriterion("Group is null"); addCriterion("\"Group\" is null");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andGroupIsNotNull() { public Criteria andGroupIsNotNull() {
addCriterion("Group is not null"); addCriterion("\"Group\" is not null");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andGroupEqualTo(String value) { public Criteria andGroupEqualTo(String value) {
addCriterion("Group =", value, "group"); addCriterion("\"Group\" =", value, "group");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andGroupNotEqualTo(String value) { public Criteria andGroupNotEqualTo(String value) {
addCriterion("Group <>", value, "group"); addCriterion("\"Group\" <>", value, "group");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andGroupGreaterThan(String value) { public Criteria andGroupGreaterThan(String value) {
addCriterion("Group >", value, "group"); addCriterion("\"Group\" >", value, "group");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andGroupGreaterThanOrEqualTo(String value) { public Criteria andGroupGreaterThanOrEqualTo(String value) {
addCriterion("Group >=", value, "group"); addCriterion("\"Group\" >=", value, "group");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andGroupLessThan(String value) { public Criteria andGroupLessThan(String value) {
addCriterion("Group <", value, "group"); addCriterion("\"Group\" <", value, "group");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andGroupLessThanOrEqualTo(String value) { public Criteria andGroupLessThanOrEqualTo(String value) {
addCriterion("Group <=", value, "group"); addCriterion("\"Group\" <=", value, "group");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andGroupLike(String value) { public Criteria andGroupLike(String value) {
addCriterion("Group like", value, "group"); addCriterion("\"Group\" like", value, "group");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andGroupNotLike(String value) { public Criteria andGroupNotLike(String value) {
addCriterion("Group not like", value, "group"); addCriterion("\"Group\" not like", value, "group");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andGroupIn(List<String> values) { public Criteria andGroupIn(List<String> values) {
addCriterion("Group in", values, "group"); addCriterion("\"Group\" in", values, "group");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andGroupNotIn(List<String> values) { public Criteria andGroupNotIn(List<String> values) {
addCriterion("Group not in", values, "group"); addCriterion("\"Group\" not in", values, "group");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andGroupBetween(String value1, String value2) { public Criteria andGroupBetween(String value1, String value2) {
addCriterion("Group between", value1, value2, "group"); addCriterion("\"Group\" between", value1, value2, "group");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andGroupNotBetween(String value1, String value2) { public Criteria andGroupNotBetween(String value1, String value2) {
addCriterion("Group not between", value1, value2, "group"); addCriterion("\"Group\" not between", value1, value2, "group");
return (Criteria) this; return (Criteria) this;
} }
......
...@@ -86,7 +86,7 @@ ...@@ -86,7 +86,7 @@
WARNING - @mbg.generated WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
--> -->
ID, TranCode, VID, Period, Group, ItemID, CreatorID, CreateTime ID, TranCode, VID, Period, "Group", ItemID, CreatorID, CreateTime
</sql> </sql>
<select id="selectByExample" parameterType="pwc.taxtech.atms.vat.entity.VoucherMappingExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="pwc.taxtech.atms.vat.entity.VoucherMappingExample" resultMap="BaseResultMap">
<!-- <!--
...@@ -140,7 +140,7 @@ ...@@ -140,7 +140,7 @@
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
--> -->
insert into VoucherMapping (ID, TranCode, VID, insert into VoucherMapping (ID, TranCode, VID,
Period, Group, ItemID, Period, "Group", ItemID,
CreatorID, CreateTime) CreatorID, CreateTime)
values (#{ID,jdbcType=VARCHAR}, #{tranCode,jdbcType=VARCHAR}, #{VID,jdbcType=VARCHAR}, values (#{ID,jdbcType=VARCHAR}, #{tranCode,jdbcType=VARCHAR}, #{VID,jdbcType=VARCHAR},
#{period,jdbcType=INTEGER}, #{group,jdbcType=VARCHAR}, #{itemID,jdbcType=VARCHAR}, #{period,jdbcType=INTEGER}, #{group,jdbcType=VARCHAR}, #{itemID,jdbcType=VARCHAR},
...@@ -166,7 +166,7 @@ ...@@ -166,7 +166,7 @@
Period, Period,
</if> </if>
<if test="group != null"> <if test="group != null">
Group, "Group",
</if> </if>
<if test="itemID != null"> <if test="itemID != null">
ItemID, ItemID,
...@@ -235,7 +235,7 @@ ...@@ -235,7 +235,7 @@
Period = #{record.period,jdbcType=INTEGER}, Period = #{record.period,jdbcType=INTEGER},
</if> </if>
<if test="record.group != null"> <if test="record.group != null">
Group = #{record.group,jdbcType=VARCHAR}, "Group" = #{record.group,jdbcType=VARCHAR},
</if> </if>
<if test="record.itemID != null"> <if test="record.itemID != null">
ItemID = #{record.itemID,jdbcType=VARCHAR}, ItemID = #{record.itemID,jdbcType=VARCHAR},
...@@ -261,7 +261,7 @@ ...@@ -261,7 +261,7 @@
TranCode = #{record.tranCode,jdbcType=VARCHAR}, TranCode = #{record.tranCode,jdbcType=VARCHAR},
VID = #{record.VID,jdbcType=VARCHAR}, VID = #{record.VID,jdbcType=VARCHAR},
Period = #{record.period,jdbcType=INTEGER}, Period = #{record.period,jdbcType=INTEGER},
Group = #{record.group,jdbcType=VARCHAR}, "Group" = #{record.group,jdbcType=VARCHAR},
ItemID = #{record.itemID,jdbcType=VARCHAR}, ItemID = #{record.itemID,jdbcType=VARCHAR},
CreatorID = #{record.creatorID,jdbcType=VARCHAR}, CreatorID = #{record.creatorID,jdbcType=VARCHAR},
CreateTime = #{record.createTime,jdbcType=TIMESTAMP} CreateTime = #{record.createTime,jdbcType=TIMESTAMP}
...@@ -286,7 +286,7 @@ ...@@ -286,7 +286,7 @@
Period = #{period,jdbcType=INTEGER}, Period = #{period,jdbcType=INTEGER},
</if> </if>
<if test="group != null"> <if test="group != null">
Group = #{group,jdbcType=VARCHAR}, "Group" = #{group,jdbcType=VARCHAR},
</if> </if>
<if test="itemID != null"> <if test="itemID != null">
ItemID = #{itemID,jdbcType=VARCHAR}, ItemID = #{itemID,jdbcType=VARCHAR},
...@@ -309,7 +309,7 @@ ...@@ -309,7 +309,7 @@
set TranCode = #{tranCode,jdbcType=VARCHAR}, set TranCode = #{tranCode,jdbcType=VARCHAR},
VID = #{VID,jdbcType=VARCHAR}, VID = #{VID,jdbcType=VARCHAR},
Period = #{period,jdbcType=INTEGER}, Period = #{period,jdbcType=INTEGER},
Group = #{group,jdbcType=VARCHAR}, "Group" = #{group,jdbcType=VARCHAR},
ItemID = #{itemID,jdbcType=VARCHAR}, ItemID = #{itemID,jdbcType=VARCHAR},
CreatorID = #{creatorID,jdbcType=VARCHAR}, CreatorID = #{creatorID,jdbcType=VARCHAR},
CreateTime = #{createTime,jdbcType=TIMESTAMP} CreateTime = #{createTime,jdbcType=TIMESTAMP}
......
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 {
public static <S, D> void map(S source, D dest) throws ClassNotFoundException, IllegalAccessException {
Class destClass = Class.forName(dest.getClass().getName());
Class clsSource = Class.forName(source.getClass().getName());
Field[] declaredFields = destClass.getDeclaredFields();
Field[] clsFields = clsSource.getDeclaredFields();
System.out.println(clsSource.getName()+":"+clsFields.length);
System.out.println(destClass.getName()+":"+declaredFields.length);
Field[] fieldsMax=null;
Class fieldsMinClass=null;
if(declaredFields.length>clsFields.length){
fieldsMax=declaredFields;
fieldsMinClass=clsSource;
}else {
fieldsMax=clsFields;
fieldsMinClass=destClass;
}
for (Field field : fieldsMax) {
field.setAccessible(true);
String fieldName = field.getName();
try {
if ("serialVersionUID".equals(fieldName)) {
continue;
}
fieldsMinClass.getDeclaredField(fieldName);
} catch (NoSuchFieldException e) {
System.out.println("NoSuchFieldException "+fieldsMinClass.getName()+ "."+ fieldName);
}
}
}
public static void main(String[] args) throws IllegalAccessException, ClassNotFoundException {
map(new Project(),new ProjectDisplayDto());
}
}
\ 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