Commit 175366e2c593e037f385799bc0266e6ae2141e3b
1 parent
63054ec5
Exists in
master
1.提交修正
Showing
3 changed files
with
3 additions
and
119 deletions
Show diff stats
src/com/taover/base/template/DAOTemplate.ftl
... | ... | @@ -22,7 +22,7 @@ public class ${beanName}Dao { |
22 | 22 | @Resource |
23 | 23 | private JdbcTemplate jdbcegroceryWrite; |
24 | 24 | |
25 | - Log logger = LogFactory.getLog(this.getClass()); | |
25 | + Log logger = LogFactory.getLog(this.getClass()); | |
26 | 26 | |
27 | 27 | |
28 | 28 | /** |
... | ... | @@ -567,83 +567,7 @@ public class ${beanName}Dao { |
567 | 567 | } |
568 | 568 | return count; |
569 | 569 | } |
570 | - | |
571 | - /** | |
572 | - * 根据对象ID修改。 | |
573 | - */ | |
574 | - public int update${beanName}PO(${beanName}PO ${beanName}) { | |
575 | - if (null == ${beanName} || null == ${beanName}.get${pkBeanName}()) { | |
576 | - LogUtils.error("error:", logger, new Exception("请求条件异常,请求对象和对象ID不能为空!"), null, null); | |
577 | - return -1; | |
578 | - } | |
579 | - Date starttime = new Date(); | |
580 | - StringBuffer sql = new StringBuffer("UPDATE ${tableName} SET"); | |
581 | - StringBuffer pql = new StringBuffer(sql.toString()); | |
582 | - List<Object> list = new ArrayList<Object>(); | |
583 | - <#if columnList?exists> | |
584 | - <#list columnList as clist> | |
585 | - <#if clist.seqName?exists> | |
586 | - <#else> | |
587 | - <#if clist.columnJAVAType = "Long" || clist.columnJAVAType = "Integer" || clist.columnJAVAType = "Short" || clist.columnJAVAType = "Float" || clist.columnJAVAType = "Double"> | |
588 | - boolean ${clist.columnUName}IsZero = false; | |
589 | - Object variation${clist.columnUName} = ${beanName}.getVariation${clist.columnUName}(); | |
590 | - if (variation${clist.columnUName} instanceof BigDecimal) { | |
591 | - ${clist.columnUName}IsZero = (((BigDecimal)variation${clist.columnUName}).compareTo(BigDecimal.ZERO) == 0); | |
592 | - } else { | |
593 | - Long l${clist.columnUName} = Long.parseLong(String.valueOf(variation${clist.columnUName})); | |
594 | - ${clist.columnUName}IsZero = (l${clist.columnUName} == 0); | |
595 | - } | |
596 | - if (!${clist.columnUName}IsZero) { | |
597 | - sql.append(" ${clist.columnName} = ${clist.columnName} + ?, "); | |
598 | - pql.append(" ${clist.columnName} = ${clist.columnName} + " + ${beanName}.getVariation${clist.columnUName}() + ","); | |
599 | - list.add(${beanName}.getVariation${clist.columnUName}()); | |
600 | - } else { | |
601 | - sql.append(" ${clist.columnName} = ?, "); | |
602 | - pql.append(" ${clist.columnName} = " + ${beanName}.get${clist.columnUName}() + ","); | |
603 | - list.add(${beanName}.get${clist.columnUName}()); | |
604 | - } | |
605 | - <#elseif clist.columnJAVAType = "java.math.BigDecimal"> | |
606 | - if (${beanName}.getVariation${clist.columnUName}().compareTo(BigDecimal.ZERO) != 0) { | |
607 | - sql.append(" ${clist.columnName} = ${clist.columnName} + ?, "); | |
608 | - pql.append(" ${clist.columnName} = ${clist.columnName} + " + ${beanName}.getVariation${clist.columnUName}() + ","); | |
609 | - list.add(${beanName}.getVariation${clist.columnUName}()); | |
610 | - } else { | |
611 | - sql.append(" ${clist.columnName} = ?, "); | |
612 | - pql.append(" ${clist.columnName} = " + ${beanName}.get${clist.columnUName}() + ","); | |
613 | - list.add(${beanName}.get${clist.columnUName}()); | |
614 | - } | |
615 | - <#else> | |
616 | - sql.append(" ${clist.columnName} = ?, "); | |
617 | - pql.append(" ${clist.columnName} = " + ${beanName}.get${clist.columnUName}() + ","); | |
618 | - list.add(${beanName}.get${clist.columnUName}()); | |
619 | - </#if> | |
620 | - </#if> | |
621 | - </#list> | |
622 | - </#if> | |
623 | - | |
624 | - String where = " WHERE ${pkColumName} = ?"; | |
625 | - String pwhere = " WHERE ${pkColumName} = " + ${beanName}.get${pkBeanName}(); | |
626 | - list.add(${beanName}.get${pkBeanName}()); | |
627 | - int count = 0; | |
628 | - try { | |
629 | - count = jdbcegroceryWrite.update(StringUtil.removeLast(sql.toString()) + where, list.toArray()); | |
630 | - return count; | |
631 | - } catch (Exception e) { | |
632 | - LogUtils.error("error:", logger, e, StringUtil.removeLast(pql.toString()) + pwhere, null); | |
633 | - } finally { | |
634 | - Date endtime = new Date(); | |
635 | - LogUtils.info("info", logger, | |
636 | - "${beanName}Dao.update${beanName}PO(${beanName}PO ${beanName})\n" | |
637 | - + "执行SQL:" + StringUtil.removeLast(pql.toString()) + pwhere + "\n" | |
638 | - + "方法执行时长:" + (endtime.getTime()-starttime.getTime()) + "毫秒, 影响记录数:" + count + "(" | |
639 | - + StringUtil.dateToFormatStr(starttime, "yyyy-MM-dd HH:mm:ss.SSS") | |
640 | - + "*-*" | |
641 | - + StringUtil.dateToFormatStr(endtime, "yyyy-MM-dd HH:mm:ss.SSS") | |
642 | - + ")"); | |
643 | - } | |
644 | - return -1; | |
645 | - } | |
646 | - | |
570 | + | |
647 | 571 | /** |
648 | 572 | * 根据ID修改指定的值 |
649 | 573 | */ |
... | ... | @@ -705,17 +629,6 @@ public class ${beanName}Dao { |
705 | 629 | } |
706 | 630 | |
707 | 631 | /** |
708 | - * 批量修改。 | |
709 | - */ | |
710 | - public int update${beanName}POList(List<${beanName}PO> ${beanName}list) { | |
711 | - int count = 0; | |
712 | - for (${beanName}PO ${beanName} : ${beanName}list) { | |
713 | - count += update${beanName}PO(${beanName}); | |
714 | - } | |
715 | - return count; | |
716 | - } | |
717 | - | |
718 | - /** | |
719 | 632 | * List<Object[]> updateObj 要修改成的值,数组长度为2,第一个值为列名,第二个值是要改成的值。 |
720 | 633 | * List<Object[]> condition 修改的条件, 数组长度是3, 第一个参数是列名,第二个参数是操作符,第三个参数是查询条件的值。 |
721 | 634 | */ | ... | ... |
src/com/taover/base/template/HtmlLayuiTemplate.ftl
... | ... | @@ -2,7 +2,7 @@ |
2 | 2 | <html> |
3 | 3 | <head> |
4 | 4 | <meta charset="utf-8"> |
5 | - <title>八爪云ERP系统</title> | |
5 | + <title>爱风尚ERP系统</title> | |
6 | 6 | <meta name="renderer" content="webkit"> |
7 | 7 | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
8 | 8 | <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0"> | ... | ... |
src/com/taover/base/template/POTemplate.ftl
... | ... | @@ -36,35 +36,6 @@ import java.io.Serializable; |
36 | 36 | this.${clist.columnName} = ${clist.columnName}; |
37 | 37 | } |
38 | 38 | |
39 | - <#if clist.columnJAVAType = "Long" || clist.columnJAVAType = "java.math.BigDecimal" || clist.columnJAVAType = "Integer" || clist.columnJAVAType = "Short" || clist.columnJAVAType = "Float" || clist.columnJAVAType = "Double"> | |
40 | - <#if clist.columnJAVAType = "Long"> | |
41 | - private ${clist.columnJAVAType} variation${clist.columnMethodName} = 0L; | |
42 | - </#if> | |
43 | - <#if clist.columnJAVAType = "java.math.BigDecimal"> | |
44 | - private ${clist.columnJAVAType} variation${clist.columnMethodName} = new java.math.BigDecimal(0.0); | |
45 | - </#if> | |
46 | - <#if clist.columnJAVAType = "Integer"> | |
47 | - private ${clist.columnJAVAType} variation${clist.columnMethodName} = 0; | |
48 | - </#if> | |
49 | - <#if clist.columnJAVAType = "Short"> | |
50 | - private ${clist.columnJAVAType} variation${clist.columnMethodName} = 0; | |
51 | - </#if> | |
52 | - <#if clist.columnJAVAType = "Double"> | |
53 | - private ${clist.columnJAVAType} variation${clist.columnMethodName} = 0d; | |
54 | - </#if> | |
55 | - <#if clist.columnJAVAType = "Float"> | |
56 | - private ${clist.columnJAVAType} variation${clist.columnMethodName} = 0f; | |
57 | - </#if> | |
58 | - public ${clist.columnJAVAType} getVariation${clist.columnMethodName}(){ | |
59 | - return variation${clist.columnMethodName}; | |
60 | - } | |
61 | - | |
62 | - public void setVariation${clist.columnMethodName}(${clist.columnJAVAType} variation${clist.columnName}){ | |
63 | - this.variation${clist.columnMethodName} = variation${clist.columnName}; | |
64 | - } | |
65 | - | |
66 | - </#if> | |
67 | - | |
68 | 39 | </#list> |
69 | 40 | </#if> |
70 | 41 | ... | ... |