Bläddra i källkod

订单模块开发

anderx 7 år sedan
förälder
incheckning
86731cffe7

+ 1 - 1
GeneratorConfig.xml

@@ -9,6 +9,6 @@
     <javaModelGenerator targetPackage="com.goafanti.common.model" targetProject="aft" />
     <sqlMapGenerator targetPackage="com.goafanti.common.mapper" targetProject="aft" />
     <javaClientGenerator targetPackage="com.goafanti.common.dao" targetProject="aft" type="XMLMAPPER" />
-    <table schema="aft" tableName="t_order_dun"/> 
+    <table schema="aft" tableName="t_dun_log"/> 
   </context>
 </generatorConfiguration>

+ 0 - 26
src/main/java/OrderNewServiceImpl/TOrderNewBo.java

@@ -1,26 +0,0 @@
-package OrderNewServiceImpl;
-
-import org.apache.commons.lang3.time.DateFormatUtils;
-
-import com.goafanti.common.constant.AFTConstants;
-import com.goafanti.common.model.TOrderNew;
-
-public class TOrderNewBo extends TOrderNew{
-	
-	public String getCreateDate() {
-		if (super.getCreateTime() == null) {
-			return null;
-		} else {
-			return DateFormatUtils.format(super.getCreateTime(), AFTConstants.YYYYMMDDHHMMSS);
-		}
-	}
-	
-	public String getUpdateDate() {
-		if (super.getUpdateTime() == null) {
-			return null;
-		} else {
-			return DateFormatUtils.format(super.getUpdateTime(), AFTConstants.YYYYMMDDHHMMSS);
-		}
-	}
-	
-}

+ 100 - 0
src/main/java/com/goafanti/common/dao/TDunLogMapper.java

@@ -0,0 +1,100 @@
+package com.goafanti.common.dao;
+
+import com.goafanti.common.model.TDunLog;
+import com.goafanti.common.model.TDunLogExample;
+import com.goafanti.order.bo.TDunLogListBo;
+
+import java.util.List;
+import org.apache.ibatis.annotations.Param;
+
+public interface TDunLogMapper {
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table t_dun_log
+     *
+     * @mbg.generated Tue Nov 20 11:50:41 CST 2018
+     */
+    long countByExample(TDunLogExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table t_dun_log
+     *
+     * @mbg.generated Tue Nov 20 11:50:41 CST 2018
+     */
+    int deleteByExample(TDunLogExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table t_dun_log
+     *
+     * @mbg.generated Tue Nov 20 11:50:41 CST 2018
+     */
+    int deleteByPrimaryKey(String id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table t_dun_log
+     *
+     * @mbg.generated Tue Nov 20 11:50:41 CST 2018
+     */
+    int insert(TDunLog record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table t_dun_log
+     *
+     * @mbg.generated Tue Nov 20 11:50:41 CST 2018
+     */
+    int insertSelective(TDunLog record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table t_dun_log
+     *
+     * @mbg.generated Tue Nov 20 11:50:41 CST 2018
+     */
+    List<TDunLog> selectByExample(TDunLogExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table t_dun_log
+     *
+     * @mbg.generated Tue Nov 20 11:50:41 CST 2018
+     */
+    TDunLog selectByPrimaryKey(String id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table t_dun_log
+     *
+     * @mbg.generated Tue Nov 20 11:50:41 CST 2018
+     */
+    int updateByExampleSelective(@Param("record") TDunLog record, @Param("example") TDunLogExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table t_dun_log
+     *
+     * @mbg.generated Tue Nov 20 11:50:41 CST 2018
+     */
+    int updateByExample(@Param("record") TDunLog record, @Param("example") TDunLogExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table t_dun_log
+     *
+     * @mbg.generated Tue Nov 20 11:50:41 CST 2018
+     */
+    int updateByPrimaryKeySelective(TDunLog record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table t_dun_log
+     *
+     * @mbg.generated Tue Nov 20 11:50:41 CST 2018
+     */
+    int updateByPrimaryKey(TDunLog record);
+
+	List<TDunLogListBo> selectByDunId(String dunId);
+}

+ 292 - 0
src/main/java/com/goafanti/common/mapper/TDunLogMapper.xml

@@ -0,0 +1,292 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.goafanti.common.dao.TDunLogMapper">
+  <resultMap id="BaseResultMap" type="com.goafanti.common.model.TDunLog">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Nov 20 11:50:41 CST 2018.
+    -->
+    <id column="id" jdbcType="VARCHAR" property="id" />
+    <result column="dun_id" jdbcType="VARCHAR" property="dunId" />
+    <result column="dum_by" jdbcType="VARCHAR" property="dumBy" />
+    <result column="dum_time" jdbcType="DATE" property="dumTime" />
+    <result column="remarks" jdbcType="VARCHAR" property="remarks" />
+  </resultMap>
+  <sql id="Example_Where_Clause">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Nov 20 11:50:41 CST 2018.
+    -->
+    <where>
+      <foreach collection="oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Update_By_Example_Where_Clause">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Nov 20 11:50:41 CST 2018.
+    -->
+    <where>
+      <foreach collection="example.oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Base_Column_List">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Nov 20 11:50:41 CST 2018.
+    -->
+    id, dun_id, dum_by, dum_time, remarks
+  </sql>
+  <select id="selectByExample" parameterType="com.goafanti.common.model.TDunLogExample" resultMap="BaseResultMap">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Nov 20 11:50:41 CST 2018.
+    -->
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from t_dun_log
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+    <if test="orderByClause != null">
+      order by ${orderByClause}
+    </if>
+  </select>
+  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Nov 20 11:50:41 CST 2018.
+    -->
+    select 
+    <include refid="Base_Column_List" />
+    from t_dun_log
+    where id = #{id,jdbcType=VARCHAR}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Nov 20 11:50:41 CST 2018.
+    -->
+    delete from t_dun_log
+    where id = #{id,jdbcType=VARCHAR}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.goafanti.common.model.TDunLogExample">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Nov 20 11:50:41 CST 2018.
+    -->
+    delete from t_dun_log
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.goafanti.common.model.TDunLog">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Nov 20 11:50:41 CST 2018.
+    -->
+    insert into t_dun_log (id, dun_id, dum_by, 
+      dum_time, remarks)
+    values (#{id,jdbcType=VARCHAR}, #{dunId,jdbcType=VARCHAR}, #{dumBy,jdbcType=VARCHAR}, 
+      #{dumTime,jdbcType=DATE}, #{remarks,jdbcType=VARCHAR})
+  </insert>
+  <insert id="insertSelective" parameterType="com.goafanti.common.model.TDunLog">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Nov 20 11:50:41 CST 2018.
+    -->
+    insert into t_dun_log
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="dunId != null">
+        dun_id,
+      </if>
+      <if test="dumBy != null">
+        dum_by,
+      </if>
+      <if test="dumTime != null">
+        dum_time,
+      </if>
+      <if test="remarks != null">
+        remarks,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=VARCHAR},
+      </if>
+      <if test="dunId != null">
+        #{dunId,jdbcType=VARCHAR},
+      </if>
+      <if test="dumBy != null">
+        #{dumBy,jdbcType=VARCHAR},
+      </if>
+      <if test="dumTime != null">
+        #{dumTime,jdbcType=DATE},
+      </if>
+      <if test="remarks != null">
+        #{remarks,jdbcType=VARCHAR},
+      </if>
+    </trim>
+  </insert>
+  <select id="countByExample" parameterType="com.goafanti.common.model.TDunLogExample" resultType="java.lang.Long">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Nov 20 11:50:41 CST 2018.
+    -->
+    select count(*) from t_dun_log
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Nov 20 11:50:41 CST 2018.
+    -->
+    update t_dun_log
+    <set>
+      <if test="record.id != null">
+        id = #{record.id,jdbcType=VARCHAR},
+      </if>
+      <if test="record.dunId != null">
+        dun_id = #{record.dunId,jdbcType=VARCHAR},
+      </if>
+      <if test="record.dumBy != null">
+        dum_by = #{record.dumBy,jdbcType=VARCHAR},
+      </if>
+      <if test="record.dumTime != null">
+        dum_time = #{record.dumTime,jdbcType=DATE},
+      </if>
+      <if test="record.remarks != null">
+        remarks = #{record.remarks,jdbcType=VARCHAR},
+      </if>
+    </set>
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExample" parameterType="map">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Nov 20 11:50:41 CST 2018.
+    -->
+    update t_dun_log
+    set id = #{record.id,jdbcType=VARCHAR},
+      dun_id = #{record.dunId,jdbcType=VARCHAR},
+      dum_by = #{record.dumBy,jdbcType=VARCHAR},
+      dum_time = #{record.dumTime,jdbcType=DATE},
+      remarks = #{record.remarks,jdbcType=VARCHAR}
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.TDunLog">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Nov 20 11:50:41 CST 2018.
+    -->
+    update t_dun_log
+    <set>
+      <if test="dunId != null">
+        dun_id = #{dunId,jdbcType=VARCHAR},
+      </if>
+      <if test="dumBy != null">
+        dum_by = #{dumBy,jdbcType=VARCHAR},
+      </if>
+      <if test="dumTime != null">
+        dum_time = #{dumTime,jdbcType=DATE},
+      </if>
+      <if test="remarks != null">
+        remarks = #{remarks,jdbcType=VARCHAR},
+      </if>
+    </set>
+    where id = #{id,jdbcType=VARCHAR}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.TDunLog">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Nov 20 11:50:41 CST 2018.
+    -->
+    update t_dun_log
+    set dun_id = #{dunId,jdbcType=VARCHAR},
+      dum_by = #{dumBy,jdbcType=VARCHAR},
+      dum_time = #{dumTime,jdbcType=DATE},
+      remarks = #{remarks,jdbcType=VARCHAR}
+    where id = #{id,jdbcType=VARCHAR}
+  </update>
+  <select id="selectByDunId" parameterType="java.lang.String" resultType="com.goafanti.order.bo.TDunLogListBo">
+   select 
+    id, dun_id as dunId, dum_by as dumBy, dum_time as dumTime, remarks
+    from t_dun_log
+    where dun_id = #{dunId,jdbcType=VARCHAR}
+  </select>
+</mapper>

+ 22 - 5
src/main/java/com/goafanti/common/mapper/TOrderDunMapper.xml

@@ -16,6 +16,8 @@
     <result column="dun_status" jdbcType="INTEGER" property="dunStatus" />
     <result column="dun_by" jdbcType="VARCHAR" property="dunBy" />
     <result column="dun_target" jdbcType="VARCHAR" property="dunTarget" />
+    <result column="money" jdbcType="DECIMAL" property="money" />
+    
   </resultMap>
   <sql id="Example_Where_Clause">
     <!--
@@ -92,7 +94,7 @@
       This element was generated on Mon Nov 19 16:53:48 CST 2018.
     -->
     id, create_time, start_time, end_time, order_no, dun_subject, dun_status, dun_by, 
-    dun_target
+    dun_target,money
   </sql>
   <select id="selectByExample" parameterType="com.goafanti.common.model.TOrderDunExample" resultMap="BaseResultMap">
     <!--
@@ -152,11 +154,12 @@
     -->
     insert into t_order_dun (id, create_time, start_time, 
       end_time, order_no, dun_subject, 
-      dun_status, dun_by, dun_target
+      dun_status, dun_by, dun_target,money
       )
     values (#{id,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{startTime,jdbcType=DATE}, 
       #{endTime,jdbcType=DATE}, #{orderNo,jdbcType=VARCHAR}, #{dunSubject,jdbcType=INTEGER}, 
-      #{dunStatus,jdbcType=INTEGER}, #{dunBy,jdbcType=VARCHAR}, #{dunTarget,jdbcType=VARCHAR}
+      #{dunStatus,jdbcType=INTEGER}, #{dunBy,jdbcType=VARCHAR}, #{dunTarget,jdbcType=VARCHAR},
+      #{money,jdbcType=DECIMAL}
       )
   </insert>
   <insert id="insertSelective" parameterType="com.goafanti.common.model.TOrderDun">
@@ -194,6 +197,9 @@
       <if test="dunTarget != null">
         dun_target,
       </if>
+      <if test="money != null">
+      money,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="id != null">
@@ -223,6 +229,9 @@
       <if test="dunTarget != null">
         #{dunTarget,jdbcType=VARCHAR},
       </if>
+        <if test="money != null">
+      #{money,jdbcType=DECIMAL},
+      </if>
     </trim>
   </insert>
   <select id="countByExample" parameterType="com.goafanti.common.model.TOrderDunExample" resultType="java.lang.Long">
@@ -271,6 +280,9 @@
       <if test="record.dunTarget != null">
         dun_target = #{record.dunTarget,jdbcType=VARCHAR},
       </if>
+      <if test="record.money != null">
+      	money = #{money,jdbcType=DECIMAL},
+      </if>
     </set>
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
@@ -291,7 +303,8 @@
       dun_subject = #{record.dunSubject,jdbcType=INTEGER},
       dun_status = #{record.dunStatus,jdbcType=INTEGER},
       dun_by = #{record.dunBy,jdbcType=VARCHAR},
-      dun_target = #{record.dunTarget,jdbcType=VARCHAR}
+      dun_target = #{record.dunTarget,jdbcType=VARCHAR},
+      money = #{money,jdbcType=DECIMAL}
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
@@ -328,6 +341,9 @@
       <if test="dunTarget != null">
         dun_target = #{dunTarget,jdbcType=VARCHAR},
       </if>
+       <if test="money != null">
+      	money = #{money,jdbcType=DECIMAL},
+      </if>
     </set>
     where id = #{id,jdbcType=VARCHAR}
   </update>
@@ -345,7 +361,8 @@
       dun_subject = #{dunSubject,jdbcType=INTEGER},
       dun_status = #{dunStatus,jdbcType=INTEGER},
       dun_by = #{dunBy,jdbcType=VARCHAR},
-      dun_target = #{dunTarget,jdbcType=VARCHAR}
+      dun_target = #{dunTarget,jdbcType=VARCHAR},
+      money = #{money,jdbcType=DECIMAL},
     where id = #{id,jdbcType=VARCHAR}
   </update>
   <select id="selectByOrderNoDunSubject" resultType="com.goafanti.common.model.TOrderDun">

+ 90 - 0
src/main/java/com/goafanti/common/mapper/TOrderNewMapper.xml

@@ -795,4 +795,94 @@
       proof_aid = #{proofAid,jdbcType=VARCHAR}
     where order_no = #{orderNo,jdbcType=VARCHAR}
   </update>
+   <select id="selectOrderNewListByPage" resultType="com.goafanti.order.bo.TOrderNewBo">
+  	select 
+  		a.order_no as orderNo,a.create_time as createTime, date_format(a.sign_time,'%Y-%m-%d' ) as signDate,
+  		b.nickname as userName ,a.process_status as processStatus,a.total_amount as totalAmount,
+  		a.liquidation_status as liquidationStatus,a.approval,c.name as salesmanName,d.name as financeName
+  	from t_order_new a  left join `user` b on a.buyer_id=b.id 
+  	left join admin c on a.salesman_id=c.id
+  	left join admin d on a.finance_id=c.id
+  	where a.delete_sign = 0
+  	<if test="orderStatus != null">
+  	and a.order_status = #{orderStatus,jdbcType=VARCHAR}
+  	</if>
+  	<if test="name != null">
+  	and b.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
+  	</if>
+  	<if test="orderNo != null">
+  	and a.order_no = #{orderNo,jdbcType=VARCHAR}
+  	</if>
+  	<if test="starTime !=null and endTime !=null">
+  	and a.sign_time &gt; #{starTime,jdbcType=VARCHAR} 
+  	and a.sign_time &lt; #{endTime,jdbcType=VARCHAR}
+  	</if>
+  	order by a.sign_time desc
+  	<if test="page_sql!=null">
+			${page_sql}
+	</if>
+  </select>
+  
+   <select id="selectOrderNewListCount" resultType="java.lang.Integer">
+  	select 
+  		count(*)
+  	from t_order_new a  left join `user` b on a.buyer_id=b.id 
+  	where a.delete_sign = 0
+  	<if test="orderStatus != null">
+  	and a.order_status = #{orderStatus,jdbcType=VARCHAR}
+  	</if>
+  	<if test="name != null">
+  	and b.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
+  	</if>
+  	<if test="orderNo != null">
+  	and a.order_no = #{orderNo,jdbcType=VARCHAR}
+  	</if>
+  	<if test="starTime !=null and endTime !=null">
+  	and #{starTime,jdbcType=VARCHAR} &lt; a.sign_time &lt; #{endTime,jdbcType=VARCHAR}
+  	</if>
+  </select>
+  
+  <select id="selectDunOrderNewListByPage" resultType="com.goafanti.order.bo.TOrderNewBo">
+  	select a.id,a.order_no as orderNo,date_format(b.sign_time,'%Y-%m-%d') as signDate,
+    c.nickname as userName,b.order_status as orderStatus,b.total_amount as totalAmount,
+    b.project_status as projectStatus,b.liquidation_status as liquidationStatus,
+    b.settlement_amount as settlementAmount,d.name as salesmanName,a.dun_subject as dunSubject,
+    date_format(a.start_time, '%Y-%m-%d') as startDate
+    from t_order_dun a left join t_order_new b on a.order_no=b.order_no
+    left join `user` c on b.buyer_id=c.id 
+    left join admin d on b.salesman_id=c.id
+    where a.start_time is not null and b.delete_sign = 0
+    <if test="name != null">
+  	and c.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
+  	</if>
+  	<if test="orderNo != null">
+  	and a.order_no = #{orderNo,jdbcType=VARCHAR}
+  	</if>
+  	<if test="starTime !=null and endTime !=null">
+  	and b.sign_time &gt; #{starTime,jdbcType=VARCHAR} 
+  	and b.sign_time &lt; #{endTime,jdbcType=VARCHAR}
+  	</if>
+  	order by b.sign_time desc
+  	<if test="page_sql!=null">
+			${page_sql}
+	</if>
+  </select>
+  
+   <select id="selectDunOrderNewListCount" resultType="java.lang.Integer">
+  	select 
+		count(*)
+    from t_order_dun a left join t_order_new b on a.order_no=b.order_no
+    left join `user` c on b.buyer_id=c.id 
+    where b.delete_sign = 0
+    <if test="name != null">
+  	and c.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
+  	</if>
+  	<if test="orderNo != null">
+  	and a.order_no = #{orderNo,jdbcType=VARCHAR}
+  	</if>
+  	<if test="starTime !=null and endTime !=null">
+  	and b.sign_time &gt; #{starTime,jdbcType=VARCHAR} 
+  	and b.sign_time &lt; #{endTime,jdbcType=VARCHAR}
+  	</if>
+  </select>
 </mapper>

+ 170 - 0
src/main/java/com/goafanti/common/model/TDunLog.java

@@ -0,0 +1,170 @@
+package com.goafanti.common.model;
+
+import java.util.Date;
+
+public class TDunLog {
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column t_dun_log.id
+     *
+     * @mbg.generated Tue Nov 20 11:50:41 CST 2018
+     */
+    private String id;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column t_dun_log.dun_id
+     *
+     * @mbg.generated Tue Nov 20 11:50:41 CST 2018
+     */
+    private String dunId;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column t_dun_log.dum_by
+     *
+     * @mbg.generated Tue Nov 20 11:50:41 CST 2018
+     */
+    private String dumBy;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column t_dun_log.dum_time
+     *
+     * @mbg.generated Tue Nov 20 11:50:41 CST 2018
+     */
+    private Date dumTime;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column t_dun_log.remarks
+     *
+     * @mbg.generated Tue Nov 20 11:50:41 CST 2018
+     */
+    private String remarks;
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column t_dun_log.id
+     *
+     * @return the value of t_dun_log.id
+     *
+     * @mbg.generated Tue Nov 20 11:50:41 CST 2018
+     */
+    public String getId() {
+        return id;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column t_dun_log.id
+     *
+     * @param id the value for t_dun_log.id
+     *
+     * @mbg.generated Tue Nov 20 11:50:41 CST 2018
+     */
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column t_dun_log.dun_id
+     *
+     * @return the value of t_dun_log.dun_id
+     *
+     * @mbg.generated Tue Nov 20 11:50:41 CST 2018
+     */
+    public String getDunId() {
+        return dunId;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column t_dun_log.dun_id
+     *
+     * @param dunId the value for t_dun_log.dun_id
+     *
+     * @mbg.generated Tue Nov 20 11:50:41 CST 2018
+     */
+    public void setDunId(String dunId) {
+        this.dunId = dunId;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column t_dun_log.dum_by
+     *
+     * @return the value of t_dun_log.dum_by
+     *
+     * @mbg.generated Tue Nov 20 11:50:41 CST 2018
+     */
+    public String getDumBy() {
+        return dumBy;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column t_dun_log.dum_by
+     *
+     * @param dumBy the value for t_dun_log.dum_by
+     *
+     * @mbg.generated Tue Nov 20 11:50:41 CST 2018
+     */
+    public void setDumBy(String dumBy) {
+        this.dumBy = dumBy;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column t_dun_log.dum_time
+     *
+     * @return the value of t_dun_log.dum_time
+     *
+     * @mbg.generated Tue Nov 20 11:50:41 CST 2018
+     */
+    public Date getDumTime() {
+        return dumTime;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column t_dun_log.dum_time
+     *
+     * @param dumTime the value for t_dun_log.dum_time
+     *
+     * @mbg.generated Tue Nov 20 11:50:41 CST 2018
+     */
+    public void setDumTime(Date dumTime) {
+        this.dumTime = dumTime;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column t_dun_log.remarks
+     *
+     * @return the value of t_dun_log.remarks
+     *
+     * @mbg.generated Tue Nov 20 11:50:41 CST 2018
+     */
+    public String getRemarks() {
+        return remarks;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column t_dun_log.remarks
+     *
+     * @param remarks the value for t_dun_log.remarks
+     *
+     * @mbg.generated Tue Nov 20 11:50:41 CST 2018
+     */
+    public void setRemarks(String remarks) {
+        this.remarks = remarks;
+    }
+}

+ 670 - 0
src/main/java/com/goafanti/common/model/TDunLogExample.java

@@ -0,0 +1,670 @@
+package com.goafanti.common.model;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.Iterator;
+import java.util.List;
+
+public class TDunLogExample {
+    /**
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database table t_dun_log
+     *
+     * @mbg.generated Tue Nov 20 11:50:41 CST 2018
+     */
+    protected String orderByClause;
+
+    /**
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database table t_dun_log
+     *
+     * @mbg.generated Tue Nov 20 11:50:41 CST 2018
+     */
+    protected boolean distinct;
+
+    /**
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database table t_dun_log
+     *
+     * @mbg.generated Tue Nov 20 11:50:41 CST 2018
+     */
+    protected List<Criteria> oredCriteria;
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table t_dun_log
+     *
+     * @mbg.generated Tue Nov 20 11:50:41 CST 2018
+     */
+    public TDunLogExample() {
+        oredCriteria = new ArrayList<Criteria>();
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table t_dun_log
+     *
+     * @mbg.generated Tue Nov 20 11:50:41 CST 2018
+     */
+    public void setOrderByClause(String orderByClause) {
+        this.orderByClause = orderByClause;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table t_dun_log
+     *
+     * @mbg.generated Tue Nov 20 11:50:41 CST 2018
+     */
+    public String getOrderByClause() {
+        return orderByClause;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table t_dun_log
+     *
+     * @mbg.generated Tue Nov 20 11:50:41 CST 2018
+     */
+    public void setDistinct(boolean distinct) {
+        this.distinct = distinct;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table t_dun_log
+     *
+     * @mbg.generated Tue Nov 20 11:50:41 CST 2018
+     */
+    public boolean isDistinct() {
+        return distinct;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table t_dun_log
+     *
+     * @mbg.generated Tue Nov 20 11:50:41 CST 2018
+     */
+    public List<Criteria> getOredCriteria() {
+        return oredCriteria;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table t_dun_log
+     *
+     * @mbg.generated Tue Nov 20 11:50:41 CST 2018
+     */
+    public void or(Criteria criteria) {
+        oredCriteria.add(criteria);
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table t_dun_log
+     *
+     * @mbg.generated Tue Nov 20 11:50:41 CST 2018
+     */
+    public Criteria or() {
+        Criteria criteria = createCriteriaInternal();
+        oredCriteria.add(criteria);
+        return criteria;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table t_dun_log
+     *
+     * @mbg.generated Tue Nov 20 11:50:41 CST 2018
+     */
+    public Criteria createCriteria() {
+        Criteria criteria = createCriteriaInternal();
+        if (oredCriteria.size() == 0) {
+            oredCriteria.add(criteria);
+        }
+        return criteria;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table t_dun_log
+     *
+     * @mbg.generated Tue Nov 20 11:50:41 CST 2018
+     */
+    protected Criteria createCriteriaInternal() {
+        Criteria criteria = new Criteria();
+        return criteria;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table t_dun_log
+     *
+     * @mbg.generated Tue Nov 20 11:50:41 CST 2018
+     */
+    public void clear() {
+        oredCriteria.clear();
+        orderByClause = null;
+        distinct = false;
+    }
+
+    /**
+     * This class was generated by MyBatis Generator.
+     * This class corresponds to the database table t_dun_log
+     *
+     * @mbg.generated Tue Nov 20 11:50:41 CST 2018
+     */
+    protected abstract static class GeneratedCriteria {
+        protected List<Criterion> criteria;
+
+        protected GeneratedCriteria() {
+            super();
+            criteria = new ArrayList<Criterion>();
+        }
+
+        public boolean isValid() {
+            return criteria.size() > 0;
+        }
+
+        public List<Criterion> getAllCriteria() {
+            return criteria;
+        }
+
+        public List<Criterion> getCriteria() {
+            return criteria;
+        }
+
+        protected void addCriterion(String condition) {
+            if (condition == null) {
+                throw new RuntimeException("Value for condition cannot be null");
+            }
+            criteria.add(new Criterion(condition));
+        }
+
+        protected void addCriterion(String condition, Object value, String property) {
+            if (value == null) {
+                throw new RuntimeException("Value for " + property + " cannot be null");
+            }
+            criteria.add(new Criterion(condition, value));
+        }
+
+        protected void addCriterion(String condition, Object value1, Object value2, String property) {
+            if (value1 == null || value2 == null) {
+                throw new RuntimeException("Between values for " + property + " cannot be null");
+            }
+            criteria.add(new Criterion(condition, value1, value2));
+        }
+
+        protected void addCriterionForJDBCDate(String condition, Date value, String property) {
+            if (value == null) {
+                throw new RuntimeException("Value for " + property + " cannot be null");
+            }
+            addCriterion(condition, new java.sql.Date(value.getTime()), property);
+        }
+
+        protected void addCriterionForJDBCDate(String condition, List<Date> values, String property) {
+            if (values == null || values.size() == 0) {
+                throw new RuntimeException("Value list for " + property + " cannot be null or empty");
+            }
+            List<java.sql.Date> dateList = new ArrayList<java.sql.Date>();
+            Iterator<Date> iter = values.iterator();
+            while (iter.hasNext()) {
+                dateList.add(new java.sql.Date(iter.next().getTime()));
+            }
+            addCriterion(condition, dateList, property);
+        }
+
+        protected void addCriterionForJDBCDate(String condition, Date value1, Date value2, String property) {
+            if (value1 == null || value2 == null) {
+                throw new RuntimeException("Between values for " + property + " cannot be null");
+            }
+            addCriterion(condition, new java.sql.Date(value1.getTime()), new java.sql.Date(value2.getTime()), property);
+        }
+
+        public Criteria andIdIsNull() {
+            addCriterion("id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdIsNotNull() {
+            addCriterion("id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdEqualTo(String value) {
+            addCriterion("id =", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotEqualTo(String value) {
+            addCriterion("id <>", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdGreaterThan(String value) {
+            addCriterion("id >", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdGreaterThanOrEqualTo(String value) {
+            addCriterion("id >=", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdLessThan(String value) {
+            addCriterion("id <", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdLessThanOrEqualTo(String value) {
+            addCriterion("id <=", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdLike(String value) {
+            addCriterion("id like", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotLike(String value) {
+            addCriterion("id not like", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdIn(List<String> values) {
+            addCriterion("id in", values, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotIn(List<String> values) {
+            addCriterion("id not in", values, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdBetween(String value1, String value2) {
+            addCriterion("id between", value1, value2, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotBetween(String value1, String value2) {
+            addCriterion("id not between", value1, value2, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andDunIdIsNull() {
+            addCriterion("dun_id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andDunIdIsNotNull() {
+            addCriterion("dun_id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andDunIdEqualTo(String value) {
+            addCriterion("dun_id =", value, "dunId");
+            return (Criteria) this;
+        }
+
+        public Criteria andDunIdNotEqualTo(String value) {
+            addCriterion("dun_id <>", value, "dunId");
+            return (Criteria) this;
+        }
+
+        public Criteria andDunIdGreaterThan(String value) {
+            addCriterion("dun_id >", value, "dunId");
+            return (Criteria) this;
+        }
+
+        public Criteria andDunIdGreaterThanOrEqualTo(String value) {
+            addCriterion("dun_id >=", value, "dunId");
+            return (Criteria) this;
+        }
+
+        public Criteria andDunIdLessThan(String value) {
+            addCriterion("dun_id <", value, "dunId");
+            return (Criteria) this;
+        }
+
+        public Criteria andDunIdLessThanOrEqualTo(String value) {
+            addCriterion("dun_id <=", value, "dunId");
+            return (Criteria) this;
+        }
+
+        public Criteria andDunIdLike(String value) {
+            addCriterion("dun_id like", value, "dunId");
+            return (Criteria) this;
+        }
+
+        public Criteria andDunIdNotLike(String value) {
+            addCriterion("dun_id not like", value, "dunId");
+            return (Criteria) this;
+        }
+
+        public Criteria andDunIdIn(List<String> values) {
+            addCriterion("dun_id in", values, "dunId");
+            return (Criteria) this;
+        }
+
+        public Criteria andDunIdNotIn(List<String> values) {
+            addCriterion("dun_id not in", values, "dunId");
+            return (Criteria) this;
+        }
+
+        public Criteria andDunIdBetween(String value1, String value2) {
+            addCriterion("dun_id between", value1, value2, "dunId");
+            return (Criteria) this;
+        }
+
+        public Criteria andDunIdNotBetween(String value1, String value2) {
+            addCriterion("dun_id not between", value1, value2, "dunId");
+            return (Criteria) this;
+        }
+
+        public Criteria andDumByIsNull() {
+            addCriterion("dum_by is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andDumByIsNotNull() {
+            addCriterion("dum_by is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andDumByEqualTo(String value) {
+            addCriterion("dum_by =", value, "dumBy");
+            return (Criteria) this;
+        }
+
+        public Criteria andDumByNotEqualTo(String value) {
+            addCriterion("dum_by <>", value, "dumBy");
+            return (Criteria) this;
+        }
+
+        public Criteria andDumByGreaterThan(String value) {
+            addCriterion("dum_by >", value, "dumBy");
+            return (Criteria) this;
+        }
+
+        public Criteria andDumByGreaterThanOrEqualTo(String value) {
+            addCriterion("dum_by >=", value, "dumBy");
+            return (Criteria) this;
+        }
+
+        public Criteria andDumByLessThan(String value) {
+            addCriterion("dum_by <", value, "dumBy");
+            return (Criteria) this;
+        }
+
+        public Criteria andDumByLessThanOrEqualTo(String value) {
+            addCriterion("dum_by <=", value, "dumBy");
+            return (Criteria) this;
+        }
+
+        public Criteria andDumByLike(String value) {
+            addCriterion("dum_by like", value, "dumBy");
+            return (Criteria) this;
+        }
+
+        public Criteria andDumByNotLike(String value) {
+            addCriterion("dum_by not like", value, "dumBy");
+            return (Criteria) this;
+        }
+
+        public Criteria andDumByIn(List<String> values) {
+            addCriterion("dum_by in", values, "dumBy");
+            return (Criteria) this;
+        }
+
+        public Criteria andDumByNotIn(List<String> values) {
+            addCriterion("dum_by not in", values, "dumBy");
+            return (Criteria) this;
+        }
+
+        public Criteria andDumByBetween(String value1, String value2) {
+            addCriterion("dum_by between", value1, value2, "dumBy");
+            return (Criteria) this;
+        }
+
+        public Criteria andDumByNotBetween(String value1, String value2) {
+            addCriterion("dum_by not between", value1, value2, "dumBy");
+            return (Criteria) this;
+        }
+
+        public Criteria andDumTimeIsNull() {
+            addCriterion("dum_time is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andDumTimeIsNotNull() {
+            addCriterion("dum_time is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andDumTimeEqualTo(Date value) {
+            addCriterionForJDBCDate("dum_time =", value, "dumTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andDumTimeNotEqualTo(Date value) {
+            addCriterionForJDBCDate("dum_time <>", value, "dumTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andDumTimeGreaterThan(Date value) {
+            addCriterionForJDBCDate("dum_time >", value, "dumTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andDumTimeGreaterThanOrEqualTo(Date value) {
+            addCriterionForJDBCDate("dum_time >=", value, "dumTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andDumTimeLessThan(Date value) {
+            addCriterionForJDBCDate("dum_time <", value, "dumTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andDumTimeLessThanOrEqualTo(Date value) {
+            addCriterionForJDBCDate("dum_time <=", value, "dumTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andDumTimeIn(List<Date> values) {
+            addCriterionForJDBCDate("dum_time in", values, "dumTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andDumTimeNotIn(List<Date> values) {
+            addCriterionForJDBCDate("dum_time not in", values, "dumTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andDumTimeBetween(Date value1, Date value2) {
+            addCriterionForJDBCDate("dum_time between", value1, value2, "dumTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andDumTimeNotBetween(Date value1, Date value2) {
+            addCriterionForJDBCDate("dum_time not between", value1, value2, "dumTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andRemarksIsNull() {
+            addCriterion("remarks is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andRemarksIsNotNull() {
+            addCriterion("remarks is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andRemarksEqualTo(String value) {
+            addCriterion("remarks =", value, "remarks");
+            return (Criteria) this;
+        }
+
+        public Criteria andRemarksNotEqualTo(String value) {
+            addCriterion("remarks <>", value, "remarks");
+            return (Criteria) this;
+        }
+
+        public Criteria andRemarksGreaterThan(String value) {
+            addCriterion("remarks >", value, "remarks");
+            return (Criteria) this;
+        }
+
+        public Criteria andRemarksGreaterThanOrEqualTo(String value) {
+            addCriterion("remarks >=", value, "remarks");
+            return (Criteria) this;
+        }
+
+        public Criteria andRemarksLessThan(String value) {
+            addCriterion("remarks <", value, "remarks");
+            return (Criteria) this;
+        }
+
+        public Criteria andRemarksLessThanOrEqualTo(String value) {
+            addCriterion("remarks <=", value, "remarks");
+            return (Criteria) this;
+        }
+
+        public Criteria andRemarksLike(String value) {
+            addCriterion("remarks like", value, "remarks");
+            return (Criteria) this;
+        }
+
+        public Criteria andRemarksNotLike(String value) {
+            addCriterion("remarks not like", value, "remarks");
+            return (Criteria) this;
+        }
+
+        public Criteria andRemarksIn(List<String> values) {
+            addCriterion("remarks in", values, "remarks");
+            return (Criteria) this;
+        }
+
+        public Criteria andRemarksNotIn(List<String> values) {
+            addCriterion("remarks not in", values, "remarks");
+            return (Criteria) this;
+        }
+
+        public Criteria andRemarksBetween(String value1, String value2) {
+            addCriterion("remarks between", value1, value2, "remarks");
+            return (Criteria) this;
+        }
+
+        public Criteria andRemarksNotBetween(String value1, String value2) {
+            addCriterion("remarks not between", value1, value2, "remarks");
+            return (Criteria) this;
+        }
+    }
+
+    /**
+     * This class was generated by MyBatis Generator.
+     * This class corresponds to the database table t_dun_log
+     *
+     * @mbg.generated do_not_delete_during_merge Tue Nov 20 11:50:41 CST 2018
+     */
+    public static class Criteria extends GeneratedCriteria {
+
+        protected Criteria() {
+            super();
+        }
+    }
+
+    /**
+     * This class was generated by MyBatis Generator.
+     * This class corresponds to the database table t_dun_log
+     *
+     * @mbg.generated Tue Nov 20 11:50:41 CST 2018
+     */
+    public static class Criterion {
+        private String condition;
+
+        private Object value;
+
+        private Object secondValue;
+
+        private boolean noValue;
+
+        private boolean singleValue;
+
+        private boolean betweenValue;
+
+        private boolean listValue;
+
+        private String typeHandler;
+
+        public String getCondition() {
+            return condition;
+        }
+
+        public Object getValue() {
+            return value;
+        }
+
+        public Object getSecondValue() {
+            return secondValue;
+        }
+
+        public boolean isNoValue() {
+            return noValue;
+        }
+
+        public boolean isSingleValue() {
+            return singleValue;
+        }
+
+        public boolean isBetweenValue() {
+            return betweenValue;
+        }
+
+        public boolean isListValue() {
+            return listValue;
+        }
+
+        public String getTypeHandler() {
+            return typeHandler;
+        }
+
+        protected Criterion(String condition) {
+            super();
+            this.condition = condition;
+            this.typeHandler = null;
+            this.noValue = true;
+        }
+
+        protected Criterion(String condition, Object value, String typeHandler) {
+            super();
+            this.condition = condition;
+            this.value = value;
+            this.typeHandler = typeHandler;
+            if (value instanceof List<?>) {
+                this.listValue = true;
+            } else {
+                this.singleValue = true;
+            }
+        }
+
+        protected Criterion(String condition, Object value) {
+            this(condition, value, null);
+        }
+
+        protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
+            super();
+            this.condition = condition;
+            this.value = value;
+            this.secondValue = secondValue;
+            this.typeHandler = typeHandler;
+            this.betweenValue = true;
+        }
+
+        protected Criterion(String condition, Object value, Object secondValue) {
+            this(condition, value, secondValue, null);
+        }
+    }
+}

+ 12 - 0
src/main/java/com/goafanti/common/model/TOrderDun.java

@@ -1,5 +1,6 @@
 package com.goafanti.common.model;
 
+import java.math.BigDecimal;
 import java.util.Date;
 
 public class TOrderDun {
@@ -92,6 +93,9 @@ public class TOrderDun {
      *
      * @mbg.generated Mon Nov 19 16:53:48 CST 2018
      */
+    
+    private BigDecimal money;
+    
     public String getId() {
         return id;
     }
@@ -299,4 +303,12 @@ public class TOrderDun {
     public void setDunTarget(String dunTarget) {
         this.dunTarget = dunTarget;
     }
+
+	public BigDecimal getMoney() {
+		return money;
+	}
+
+	public void setMoney(BigDecimal money) {
+		this.money = money;
+	}
 }

+ 16 - 0
src/main/java/com/goafanti/order/bo/TDunLogListBo.java

@@ -0,0 +1,16 @@
+package com.goafanti.order.bo;
+
+import org.apache.commons.lang3.time.DateFormatUtils;
+
+import com.goafanti.common.constant.AFTConstants;
+import com.goafanti.common.model.TDunLog;
+
+public class TDunLogListBo extends TDunLog {
+	public String getDumDate() {
+		if (super.getDumTime() == null) {
+			return null;
+		} else {
+			return DateFormatUtils.format(super.getDumTime(), AFTConstants.YYYYMMDDHHMMSS);
+		}
+	}
+}

+ 89 - 0
src/main/java/com/goafanti/order/bo/TOrderNewBo.java

@@ -0,0 +1,89 @@
+package com.goafanti.order.bo;
+
+import org.apache.commons.lang3.time.DateFormatUtils;
+
+import com.goafanti.common.constant.AFTConstants;
+import com.goafanti.common.model.TOrderNew;
+
+public class TOrderNewBo extends TOrderNew{
+	private String id;
+	private String signDate;
+	private String userName;
+	private String salesmanName;
+	private String financeName;
+	private String dunSubject;
+	private String startDate;
+	
+	public String getSignDate() {
+		return signDate;
+	}
+
+	public void setSignDate(String signDate) {
+		this.signDate = signDate;
+	}
+
+	public String getUserName() {
+		return userName;
+	}
+
+	public void setUserName(String userName) {
+		this.userName = userName;
+	}
+
+	public String getSalesmanName() {
+		return salesmanName;
+	}
+
+	public void setSalesmanName(String salesmanName) {
+		this.salesmanName = salesmanName;
+	}
+
+	public String getFinanceName() {
+		return financeName;
+	}
+
+	public void setFinanceName(String financeName) {
+		this.financeName = financeName;
+	}
+
+	public String getCreateDate() {
+		if (super.getCreateTime() == null) {
+			return null;
+		} else {
+			return DateFormatUtils.format(super.getCreateTime(), AFTConstants.YYYYMMDDHHMMSS);
+		}
+	}
+	
+	public String getUpdateDate() {
+		if (super.getUpdateTime() == null) {
+			return null;
+		} else {
+			return DateFormatUtils.format(super.getUpdateTime(), AFTConstants.YYYYMMDDHHMMSS);
+		}
+	}
+
+	public String getStartDate() {
+		return startDate;
+	}
+
+	public void setStartDate(String startDate) {
+		this.startDate = startDate;
+	}
+
+	public String getDunSubject() {
+		return dunSubject;
+	}
+
+	public void setDunSubject(String dunSubject) {
+		this.dunSubject = dunSubject;
+	}
+
+	public String getId() {
+		return id;
+	}
+
+	public void setId(String id) {
+		this.id = id;
+	}
+	
+}

+ 73 - 1
src/main/java/com/goafanti/order/controller/AdminNewOrderApiController.java

@@ -13,6 +13,7 @@ import com.alibaba.fastjson.JSON;
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.controller.CertifyApiController;
+import com.goafanti.common.model.TDunLog;
 import com.goafanti.common.model.TOrderDun;
 import com.goafanti.common.model.TOrderNew;
 import com.goafanti.common.model.TOrderTask;
@@ -148,10 +149,81 @@ public class AdminNewOrderApiController extends CertifyApiController {
 	/**
 	 * 收款截点编辑
 	 */
-	@RequestMapping(value = "/createOrderDun", method = RequestMethod.GET)
+	@RequestMapping(value = "/createOrderDun", method = RequestMethod.POST)
 	public Result createOrderDun(String orderDun,String orderNo){
 		Result res = new Result();
+		if(StringUtils.isBlank(orderNo)){
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "订单编号","订单编号"));
+			return res;
+		}
 		res.setData(orderNewService.createOrderDun(orderDun,orderNo));
 		return res;
 	}
+	/**
+	 * 订单列表
+	 */
+	@RequestMapping(value="/orderNewList", method = RequestMethod.GET)
+	public Result orderNewList(String name,String orderNo,String starTime,String endTime,Integer orderStatus,Integer pageNo,Integer pageSize){
+		Result res=new Result();
+		res.data(orderNewService.orderNewList(name, orderNo, starTime, endTime,orderStatus, pageNo, pageSize));
+		return res;
+	}
+	/**
+	 * 订单审核
+	 */
+	@RequestMapping(value="/auditOrderNew", method = RequestMethod.GET)
+	public Result auditOrderNewList(String orderNo,Integer orderStatus){
+		Result res=new Result();
+		if(StringUtils.isBlank(orderNo)){
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "订单编号","订单编号"));
+			return res;
+		}
+		if(orderStatus==null||(orderStatus!=2&&orderStatus!=3)){
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "审核状态","审核状态"));
+			return res;
+		}
+		orderNewService.updateOrderNew(orderNo,orderStatus);
+		return res;
+	}
+	/**
+	 * 催款统计列表
+	 */
+	@RequestMapping(value="/dunOrderNewList", method = RequestMethod.GET)
+	public Result dunOrderNewList(String name,String orderNo,String starTime,String endTime,Integer orderStatus,Integer pageNo,Integer pageSize){
+		Result res=new Result();
+		res.data(orderNewService.dunOrderNewList(name, orderNo, starTime, endTime,orderStatus, pageNo, pageSize));
+		return res;
+	}
+	/**
+	 * 新增催款记录
+	 */
+	@RequestMapping(value="/createDunLog", method = RequestMethod.POST)
+	public Result createDunLog(String dunId,String dumTime,String remarks){
+		Result res=new  Result();
+		if (StringUtils.isBlank(dunId)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "催款ID","催款ID"));
+			return res;
+		}
+		if (StringUtils.isBlank(dumTime)||StringUtils.isBlank(remarks)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "时间与描述","时间与描述"));
+			return res;
+		}
+		
+		res.data(orderNewService.createDunLog(dunId, dumTime, remarks));
+		return res;
+	}
+	/**
+	 * 催款记录查询
+	 */
+	@RequestMapping(value="/selectDunLogList", method = RequestMethod.GET)
+	public Result selectDunLogList(String dunId){
+			Result res=new Result();
+			if (StringUtils.isBlank(dunId)) {
+				res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "催款ID","催款ID"));
+				return res;
+			}
+			res.data(orderNewService.selectDunLogList(dunId));
+			return res;
+	}
+	
 }

+ 49 - 2
src/main/java/com/goafanti/order/service/OrderNewService.java

@@ -2,10 +2,13 @@ package com.goafanti.order.service;
 
 import java.util.List;
 
+import com.goafanti.common.model.TDunLog;
 import com.goafanti.common.model.TOrderNew;
 import com.goafanti.common.model.TOrderTask;
-
-import OrderNewServiceImpl.TOrderNewBo;
+import com.goafanti.core.mybatis.page.Pagination;
+import com.goafanti.order.bo.BillListBo;
+import com.goafanti.order.bo.TDunLogListBo;
+import com.goafanti.order.bo.TOrderNewBo;
 
 public interface OrderNewService {
 	
@@ -58,6 +61,50 @@ public interface OrderNewService {
 	 * @return
 	 */
 	int createOrderDun(String orderDun,String orderNo);
+	/**
+	 * 订单列表
+	 * @param name
+	 * @param orderNo
+	 * @param starTime
+	 * @param endTime
+	 * @param orderStatus
+	 * @param pageNo
+	 * @param pageSize
+	 * @return
+	 */
+	Pagination<TOrderNewBo> orderNewList(String name, String orderNo, String starTime, String endTime, Integer orderStatus,Integer pageNo, Integer pageSize);
+	/**
+	 * 订单审核
+	 * @param orderNo
+	 * @param orderStatus
+	 * @return
+	 */
+	int updateOrderNew(String orderNo, Integer orderStatus);
+	
+	/**
+	 * 催款订单列表
+	 * @param name
+	 * @param orderNo
+	 * @param starTime
+	 * @param endTime
+	 * @param orderStatus
+	 * @param pageNo
+	 * @param pageSize
+	 * @return
+	 */
+	Pagination<TOrderNewBo> dunOrderNewList(String name, String orderNo, String starTime, String endTime, Integer orderStatus,
+			Integer pageNo, Integer pageSize);
+	/**
+	 * 新增催款记录
+	 * @return
+	 */
+	int createDunLog(String dunId,String dumTime,String remarks);
+	/**
+	 * 查询催款记录
+	 * @param dunId
+	 * @return
+	 */
+	List<TDunLogListBo> selectDunLogList(String dunId);
 	
 
 	

+ 91 - 9
src/main/java/com/goafanti/order/service/impl/OrderNewServiceImpl.java

@@ -3,9 +3,13 @@ package com.goafanti.order.service.impl;
 
 import java.lang.reflect.InvocationTargetException;
 import java.math.BigDecimal;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
 import java.util.Arrays;
 import java.util.Date;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 import java.util.UUID;
 
 import org.apache.commons.lang3.StringUtils;
@@ -20,6 +24,7 @@ import com.alibaba.fastjson.JSON;
 import com.goafanti.common.bo.Error;
 import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.constant.ErrorConstants;
+import com.goafanti.common.dao.TDunLogMapper;
 import com.goafanti.common.dao.TOrderDunMapper;
 import com.goafanti.common.dao.TOrderMapper;
 import com.goafanti.common.dao.TOrderNewMapper;
@@ -27,6 +32,7 @@ import com.goafanti.common.dao.TOrderTaskMapper;
 import com.goafanti.common.dao.UserLockReleaseMapper;
 import com.goafanti.common.enums.UserLockReleaseStatus;
 import com.goafanti.common.error.BusinessException;
+import com.goafanti.common.model.TDunLog;
 import com.goafanti.common.model.TOrder;
 import com.goafanti.common.model.TOrderDetail;
 import com.goafanti.common.model.TOrderDun;
@@ -36,8 +42,11 @@ import com.goafanti.common.model.UserLockRelease;
 import com.goafanti.common.utils.BeanUtilsExt;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.mybatis.JDBCIdGenerator;
+import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.customer.bo.LockingReleaseBo;
+import com.goafanti.order.bo.TDunLogListBo;
+import com.goafanti.order.bo.TOrderNewBo;
 import com.goafanti.order.enums.ActiveState;
 import com.goafanti.order.enums.ApprovalNewState;
 import com.goafanti.order.enums.LiquidationNewState;
@@ -47,17 +56,16 @@ import com.goafanti.order.enums.ProjectNewStage;
 import com.goafanti.order.enums.TaskState;
 import com.goafanti.order.service.OrderNewService;
 
-import OrderNewServiceImpl.TOrderNewBo;
-
 @Service
-public class OrderNewServiceImpl extends BaseMybatisDao<TOrderMapper> implements OrderNewService {
+public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> implements OrderNewService {
 	@Autowired
 	private TOrderNewMapper	tOrderNewMapper;
 	@Autowired
 	private TOrderTaskMapper tOrderTaskMapper;
 	@Autowired
 	private TOrderDunMapper tOrderDunMapper;
-
+	@Autowired
+	private TDunLogMapper tDunLogMapper;
 	@Autowired
 	private JDBCIdGenerator	idGenerator;
 	@Autowired
@@ -72,10 +80,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderMapper> implements
 	private String					accessSecret		= null;
 	
 	
-	
-	/*
-	 * -------------------------------------------------- APP管理端 --------------------------------------------------------
-	 */
+
 	
 	@Override
 	public int createServiceOrder(String uid, Integer orderType) {
@@ -180,9 +185,12 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderMapper> implements
 		List<TOrderDun> l2=tOrderDunMapper.selectByOrderNoDunSubject(orderNo);
 		if (l!=null&&!l.isEmpty()) {
 			for (TOrderDun t : l) {
-				if (t.getId()==null||t.getId()=="") {//Id为空新增
+				if (t.getId()==null||t.getId().equals("")) {//Id为空新增
 					t.setId(UUID.randomUUID().toString());
+					t.setDunBy(TokenManager.getAdminId()==null?"1":TokenManager.getAdminId());
 					tOrderDunMapper.insertSelective(t);
+				}else {
+					tOrderDunMapper.updateByPrimaryKey(t);
 				}
 				for (TOrderDun t2 : l2) {
 					boolean flag=true;
@@ -197,5 +205,79 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderMapper> implements
 		}
 		return 1;
 	}
+
+
+
+	@SuppressWarnings("unchecked")
+	@Override
+	public Pagination<TOrderNewBo> orderNewList(String name, String orderNo, String starTime, String endTime,Integer orderStatus, Integer pageNo,
+			Integer pageSize) {
+		Map<String, Object> params = new HashMap<String, Object>();
+		if(pageSize==null||pageSize<0)pageSize=10;
+		if(pageNo==null||pageNo<0)pageNo=1;
+		if (orderStatus==1) {
+			params.put("orderStatus", orderStatus);
+		}else {
+			if (StringUtils.isNotBlank(TokenManager.getAdminId())) params.put("aid", TokenManager.getAdminId()==null?"1":TokenManager.getAdminId());
+		}
+		if (StringUtils.isNotBlank(name)) params.put("name", name);
+		if (StringUtils.isNotBlank(orderNo)) params.put("orderNo", orderNo);
+		if (StringUtils.isNotBlank(starTime)) params.put("starTime", starTime);
+		if (StringUtils.isNotBlank(endTime)) params.put("endTime", endTime+" 23:59:59");
+		Pagination<TOrderNewBo> p = (Pagination<TOrderNewBo>)findPage("selectOrderNewListByPage", "selectOrderNewListCount", params, pageNo, pageSize);
+		return p;
+	}
+
+
+
+	@Override
+	public int updateOrderNew(String orderNo, Integer orderStatus) {
+		TOrderNew t= new TOrderNew();
+		t.setOrderNo(orderNo);
+		t.setOrderStatus(orderStatus);
+		return tOrderNewMapper.updateByPrimaryKeySelective(t);
+	}
+
+
+
+	@SuppressWarnings("unchecked")
+	@Override
+	public Pagination<TOrderNewBo> dunOrderNewList(String name, String orderNo, String starTime, String endTime,
+			Integer orderStatus, Integer pageNo, Integer pageSize) {
+		Map<String, Object> params = new HashMap<String, Object>();
+		if(pageSize==null||pageSize<0)pageSize=10;
+		if(pageNo==null||pageNo<0)pageNo=1;
+		if (StringUtils.isNotBlank(name)) params.put("name", name);
+		if (StringUtils.isNotBlank(orderNo)) params.put("orderNo", orderNo);
+		if (StringUtils.isNotBlank(starTime)) params.put("starTime", starTime);
+		if (StringUtils.isNotBlank(endTime)) params.put("endTime", endTime+" 23:59:59");
+		Pagination<TOrderNewBo> p = (Pagination<TOrderNewBo>)findPage("selectDunOrderNewListByPage", "selectDunOrderNewListCount", params, pageNo, pageSize);
+		return p;
+	}
+
+
+
+	@Override
+	public int createDunLog(String dunId,String dumTime,String remarks) {
+		TDunLog d=new TDunLog();
+		d.setId(UUID.randomUUID().toString());
+		d.setDunId(dunId);
+		d.setDumBy(TokenManager.getAdminId()==null?"1":TokenManager.getAdminId());
+		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+		try {
+			d.setDumTime(sdf.parse(dumTime));
+		} catch (ParseException e) {
+			e.printStackTrace();
+		}
+		d.setRemarks(remarks);
+		return tDunLogMapper.insertSelective(d);
+	}
+
+
+
+	@Override
+	public List<TDunLogListBo> selectDunLogList(String dunId) {
+		return tDunLogMapper.selectByDunId(dunId);
+	}
 	
 }