Просмотр исходного кода

update

Signed-off-by: anderx <anderx@qq.com>
anderx лет назад: 5
Родитель
Сommit
9c49316480

+ 86 - 84
src/main/java/com/goafanti/common/dao/NewOrderDunMapper.java

@@ -1,85 +1,87 @@
-package com.goafanti.common.dao;
-
-import com.goafanti.common.model.NewOrderDun;
-import com.goafanti.common.model.NewOrderDunExample;
-import com.goafanti.order.bo.OutNewOrderDunBo;
-
-import java.util.List;
-import org.apache.ibatis.annotations.Param;
-
-public interface NewOrderDunMapper {
-    /**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table new_order_dun
-	 * @mbg.generated  Fri May 15 09:46:56 CST 2020
-	 */
-	long countByExample(NewOrderDunExample example);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table new_order_dun
-	 * @mbg.generated  Fri May 15 09:46:56 CST 2020
-	 */
-	int deleteByExample(NewOrderDunExample example);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table new_order_dun
-	 * @mbg.generated  Fri May 15 09:46:56 CST 2020
-	 */
-	int deleteByPrimaryKey(Integer id);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table new_order_dun
-	 * @mbg.generated  Fri May 15 09:46:56 CST 2020
-	 */
-	int insert(NewOrderDun record);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table new_order_dun
-	 * @mbg.generated  Fri May 15 09:46:56 CST 2020
-	 */
-	int insertSelective(NewOrderDun record);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table new_order_dun
-	 * @mbg.generated  Fri May 15 09:46:56 CST 2020
-	 */
-	List<NewOrderDun> selectByExample(NewOrderDunExample example);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table new_order_dun
-	 * @mbg.generated  Fri May 15 09:46:56 CST 2020
-	 */
-	NewOrderDun selectByPrimaryKey(Integer id);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table new_order_dun
-	 * @mbg.generated  Fri May 15 09:46:56 CST 2020
-	 */
-	int updateByExampleSelective(@Param("record") NewOrderDun record, @Param("example") NewOrderDunExample example);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table new_order_dun
-	 * @mbg.generated  Fri May 15 09:46:56 CST 2020
-	 */
-	int updateByExample(@Param("record") NewOrderDun record, @Param("example") NewOrderDunExample example);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table new_order_dun
-	 * @mbg.generated  Fri May 15 09:46:56 CST 2020
-	 */
-	int updateByPrimaryKeySelective(NewOrderDun record);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table new_order_dun
-	 * @mbg.generated  Fri May 15 09:46:56 CST 2020
-	 */
-	int updateByPrimaryKey(NewOrderDun record);
-
-	List<OutNewOrderDunBo> selectListNewOrderDun(@Param("orderNo")String orderNo,@Param("aid") String aid,@Param("status")Integer status);
-
-	List<OutNewOrderDunBo> selectAllOrderDun();
-
-	List<OutNewOrderDunBo> selectByTid(String id);
-
-	void deleteByTid(Integer tid);
-
+package com.goafanti.common.dao;
+
+import com.goafanti.common.model.NewOrderDun;
+import com.goafanti.common.model.NewOrderDunExample;
+import com.goafanti.order.bo.OutNewOrderDunBo;
+
+import java.util.List;
+import org.apache.ibatis.annotations.Param;
+
+public interface NewOrderDunMapper {
+    /**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table new_order_dun
+	 * @mbg.generated  Fri May 15 09:46:56 CST 2020
+	 */
+	long countByExample(NewOrderDunExample example);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table new_order_dun
+	 * @mbg.generated  Fri May 15 09:46:56 CST 2020
+	 */
+	int deleteByExample(NewOrderDunExample example);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table new_order_dun
+	 * @mbg.generated  Fri May 15 09:46:56 CST 2020
+	 */
+	int deleteByPrimaryKey(Integer id);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table new_order_dun
+	 * @mbg.generated  Fri May 15 09:46:56 CST 2020
+	 */
+	int insert(NewOrderDun record);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table new_order_dun
+	 * @mbg.generated  Fri May 15 09:46:56 CST 2020
+	 */
+	int insertSelective(NewOrderDun record);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table new_order_dun
+	 * @mbg.generated  Fri May 15 09:46:56 CST 2020
+	 */
+	List<NewOrderDun> selectByExample(NewOrderDunExample example);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table new_order_dun
+	 * @mbg.generated  Fri May 15 09:46:56 CST 2020
+	 */
+	NewOrderDun selectByPrimaryKey(Integer id);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table new_order_dun
+	 * @mbg.generated  Fri May 15 09:46:56 CST 2020
+	 */
+	int updateByExampleSelective(@Param("record") NewOrderDun record, @Param("example") NewOrderDunExample example);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table new_order_dun
+	 * @mbg.generated  Fri May 15 09:46:56 CST 2020
+	 */
+	int updateByExample(@Param("record") NewOrderDun record, @Param("example") NewOrderDunExample example);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table new_order_dun
+	 * @mbg.generated  Fri May 15 09:46:56 CST 2020
+	 */
+	int updateByPrimaryKeySelective(NewOrderDun record);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table new_order_dun
+	 * @mbg.generated  Fri May 15 09:46:56 CST 2020
+	 */
+	int updateByPrimaryKey(NewOrderDun record);
+
+	List<OutNewOrderDunBo> selectListNewOrderDun(@Param("orderNo")String orderNo,@Param("aid") String aid,@Param("status")Integer status);
+
+	List<OutNewOrderDunBo> selectAllOrderDun();
+
+	List<OutNewOrderDunBo> selectByTid(String id);
+
+	void deleteByTid(Integer tid);
+
+	void insertBatch(List<OutNewOrderDunBo> newtd2);
+
 }

+ 2 - 0
src/main/java/com/goafanti/common/dao/TOrderDunMapper.java

@@ -111,4 +111,6 @@ public interface TOrderDunMapper {
 	List<TOrderDun> selectByOrderNo(String orderNo);
 
 	int  deleteByOrderNo(String orderNo);
+
+	void insertBatch(List<TOrderDun> newtd1);
 }

+ 82 - 80
src/main/java/com/goafanti/common/dao/TOrderLogMapper.java

@@ -1,81 +1,83 @@
-package com.goafanti.common.dao;
-
-import com.goafanti.common.model.TOrderLog;
-import com.goafanti.common.model.TOrderLogExample;
-import com.goafanti.order.bo.TOrderLogBo;
-
-import java.util.List;
-import org.apache.ibatis.annotations.Param;
-
-public interface TOrderLogMapper {
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_log
-	 * @mbg.generated  Thu Nov 28 11:28:43 CST 2019
-	 */
-	long countByExample(TOrderLogExample example);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_log
-	 * @mbg.generated  Thu Nov 28 11:28:43 CST 2019
-	 */
-	int deleteByExample(TOrderLogExample example);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_log
-	 * @mbg.generated  Thu Nov 28 11:28:43 CST 2019
-	 */
-	int deleteByPrimaryKey(Integer id);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_log
-	 * @mbg.generated  Thu Nov 28 11:28:43 CST 2019
-	 */
-	int insert(TOrderLog record);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_log
-	 * @mbg.generated  Thu Nov 28 11:28:43 CST 2019
-	 */
-	int insertSelective(TOrderLog record);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_log
-	 * @mbg.generated  Thu Nov 28 11:28:43 CST 2019
-	 */
-	List<TOrderLog> selectByExample(TOrderLogExample example);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_log
-	 * @mbg.generated  Thu Nov 28 11:28:43 CST 2019
-	 */
-	TOrderLog selectByPrimaryKey(Integer id);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_log
-	 * @mbg.generated  Thu Nov 28 11:28:43 CST 2019
-	 */
-	int updateByExampleSelective(@Param("record") TOrderLog record, @Param("example") TOrderLogExample example);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_log
-	 * @mbg.generated  Thu Nov 28 11:28:43 CST 2019
-	 */
-	int updateByExample(@Param("record") TOrderLog record, @Param("example") TOrderLogExample example);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_log
-	 * @mbg.generated  Thu Nov 28 11:28:43 CST 2019
-	 */
-	int updateByPrimaryKeySelective(TOrderLog record);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_log
-	 * @mbg.generated  Thu Nov 28 11:28:43 CST 2019
-	 */
-	int updateByPrimaryKey(TOrderLog record);
-
-	List<TOrderLogBo> selectOrderByNo(String orderNo);
-
-
+package com.goafanti.common.dao;
+
+import com.goafanti.common.model.TOrderLog;
+import com.goafanti.common.model.TOrderLogExample;
+import com.goafanti.order.bo.TOrderLogBo;
+
+import java.util.List;
+import org.apache.ibatis.annotations.Param;
+
+public interface TOrderLogMapper {
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_log
+	 * @mbg.generated  Thu Nov 28 11:28:43 CST 2019
+	 */
+	long countByExample(TOrderLogExample example);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_log
+	 * @mbg.generated  Thu Nov 28 11:28:43 CST 2019
+	 */
+	int deleteByExample(TOrderLogExample example);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_log
+	 * @mbg.generated  Thu Nov 28 11:28:43 CST 2019
+	 */
+	int deleteByPrimaryKey(Integer id);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_log
+	 * @mbg.generated  Thu Nov 28 11:28:43 CST 2019
+	 */
+	int insert(TOrderLog record);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_log
+	 * @mbg.generated  Thu Nov 28 11:28:43 CST 2019
+	 */
+	int insertSelective(TOrderLog record);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_log
+	 * @mbg.generated  Thu Nov 28 11:28:43 CST 2019
+	 */
+	List<TOrderLog> selectByExample(TOrderLogExample example);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_log
+	 * @mbg.generated  Thu Nov 28 11:28:43 CST 2019
+	 */
+	TOrderLog selectByPrimaryKey(Integer id);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_log
+	 * @mbg.generated  Thu Nov 28 11:28:43 CST 2019
+	 */
+	int updateByExampleSelective(@Param("record") TOrderLog record, @Param("example") TOrderLogExample example);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_log
+	 * @mbg.generated  Thu Nov 28 11:28:43 CST 2019
+	 */
+	int updateByExample(@Param("record") TOrderLog record, @Param("example") TOrderLogExample example);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_log
+	 * @mbg.generated  Thu Nov 28 11:28:43 CST 2019
+	 */
+	int updateByPrimaryKeySelective(TOrderLog record);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_log
+	 * @mbg.generated  Thu Nov 28 11:28:43 CST 2019
+	 */
+	int updateByPrimaryKey(TOrderLog record);
+
+	List<TOrderLogBo> selectOrderByNo(String orderNo);
+
+	void insertBatch(List<TOrderLogBo> newtl1);
+
+
 }

+ 2 - 0
src/main/java/com/goafanti/common/dao/TOrderTaskMapper.java

@@ -118,4 +118,6 @@ public interface TOrderTaskMapper {
 
 	int insertSelectiveGetId(TOrderTask tn);
 
+	List<Integer> getLockId(@Param("orderNo")String orderNo, @Param("aid")String aid, @Param("uid")String uid);
+
 }

+ 6 - 1
src/main/java/com/goafanti/common/dao/UserLockReleaseMapper.java

@@ -128,5 +128,10 @@ public interface UserLockReleaseMapper {
 
 	int checkLock(@Param("aid")String aid, @Param("uid")String uid, @Param("pid")String pid);
 
-	
+	int selectByUidGetCount(@Param("aid")String aid, @Param("uid")String uid);
+
+	void updateReleaseList( @Param("list")List<Integer> list);
+
+	void updateReleaseUser(String orderNo);
+
 }

+ 2 - 0
src/main/java/com/goafanti/common/dao/UserMapper.java

@@ -274,6 +274,8 @@ public interface UserMapper {
 
 	void updateShareType(@Param("uid")String uid,@Param("aid")String aid);
 
+	void updateRelease(String orderNo);
+
 	
 	
 }

+ 494 - 476
src/main/java/com/goafanti/common/mapper/NewOrderDunMapper.xml

@@ -1,477 +1,495 @@
-<?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.NewOrderDunMapper">
-  <resultMap id="BaseResultMap" type="com.goafanti.common.model.NewOrderDun">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri May 15 09:46:56 CST 2020.
-    -->
-    <id column="id" jdbcType="INTEGER" property="id" />
-    <result column="order_no" jdbcType="VARCHAR" property="orderNo" />
-    <result column="tid" jdbcType="INTEGER" property="tid" />
-    <result column="project_type" jdbcType="INTEGER" property="projectType" />
-    <result column="dun_type" jdbcType="INTEGER" property="dunType" />
-    <result column="wait_day" jdbcType="INTEGER" property="waitDay" />
-    <result column="effective_count" jdbcType="INTEGER" property="effectiveCount" />
-    <result column="aid" jdbcType="VARCHAR" property="aid" />
-    <result column="status" jdbcType="INTEGER" property="status" />
-    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
-    <result column="start_time" jdbcType="TIMESTAMP" property="startTime" />
-    <result column="money" jdbcType="DECIMAL" property="money" />
-    <result column="appropriation_ratio" jdbcType="DECIMAL" property="appropriationRatio" />
-    <result column="customize_name" jdbcType="VARCHAR" property="customizeName" />
-    <result column="customize_time" jdbcType="TIMESTAMP" property="customizeTime" />
-  </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 Fri May 15 09:46:56 CST 2020.
-    -->
-    <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 Fri May 15 09:46:56 CST 2020.
-    -->
-    <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 Fri May 15 09:46:56 CST 2020.
-    -->
-    id, order_no, tid, project_type, dun_type, wait_day, effective_count, aid, status, 
-    create_time, start_time, money, appropriation_ratio, customize_name, customize_time
-  </sql>
-  <select id="selectByExample" parameterType="com.goafanti.common.model.NewOrderDunExample" resultMap="BaseResultMap">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri May 15 09:46:56 CST 2020.
-    -->
-    select
-    <if test="distinct">
-      distinct
-    </if>
-    <include refid="Base_Column_List" />
-    from new_order_dun
-    <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.Integer" resultMap="BaseResultMap">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri May 15 09:46:56 CST 2020.
-    -->
-    select 
-    <include refid="Base_Column_List" />
-    from new_order_dun
-    where id = #{id,jdbcType=INTEGER}
-  </select>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri May 15 09:46:56 CST 2020.
-    -->
-    delete from new_order_dun
-    where id = #{id,jdbcType=INTEGER}
-  </delete>
-  <delete id="deleteByExample" parameterType="com.goafanti.common.model.NewOrderDunExample">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri May 15 09:46:56 CST 2020.
-    -->
-    delete from new_order_dun
-    <if test="_parameter != null">
-      <include refid="Example_Where_Clause" />
-    </if>
-  </delete>
-  <insert id="insert" parameterType="com.goafanti.common.model.NewOrderDun">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri May 15 09:46:56 CST 2020.
-    -->
-    insert into new_order_dun (id, order_no, tid, 
-      project_type, dun_type, wait_day, 
-      effective_count, aid, status, 
-      create_time, start_time, money, 
-      appropriation_ratio, customize_name, customize_time
-      )
-    values (#{id,jdbcType=INTEGER}, #{orderNo,jdbcType=VARCHAR}, #{tid,jdbcType=INTEGER}, 
-      #{projectType,jdbcType=INTEGER}, #{dunType,jdbcType=INTEGER}, #{waitDay,jdbcType=INTEGER}, 
-      #{effectiveCount,jdbcType=INTEGER}, #{aid,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, 
-      #{createTime,jdbcType=TIMESTAMP}, #{startTime,jdbcType=TIMESTAMP}, #{money,jdbcType=DECIMAL}, 
-      #{appropriationRatio,jdbcType=DECIMAL}, #{customizeName,jdbcType=VARCHAR}, #{customizeTime,jdbcType=TIMESTAMP}
-      )
-  </insert>
-  <insert id="insertSelective" parameterType="com.goafanti.common.model.NewOrderDun">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri May 15 09:46:56 CST 2020.
-    -->
-    insert into new_order_dun
-    <trim prefix="(" suffix=")" suffixOverrides=",">
-      <if test="id != null">
-        id,
-      </if>
-      <if test="orderNo != null">
-        order_no,
-      </if>
-      <if test="tid != null">
-        tid,
-      </if>
-      <if test="projectType != null">
-        project_type,
-      </if>
-      <if test="dunType != null">
-        dun_type,
-      </if>
-      <if test="waitDay != null">
-        wait_day,
-      </if>
-      <if test="effectiveCount != null">
-        effective_count,
-      </if>
-      <if test="aid != null">
-        aid,
-      </if>
-      <if test="status != null">
-        status,
-      </if>
-      <if test="createTime != null">
-        create_time,
-      </if>
-      <if test="startTime != null">
-        start_time,
-      </if>
-      <if test="money != null">
-        money,
-      </if>
-      <if test="appropriationRatio != null">
-        appropriation_ratio,
-      </if>
-      <if test="customizeName != null">
-        customize_name,
-      </if>
-      <if test="customizeTime != null">
-        customize_time,
-      </if>
-    </trim>
-    <trim prefix="values (" suffix=")" suffixOverrides=",">
-      <if test="id != null">
-        #{id,jdbcType=INTEGER},
-      </if>
-      <if test="orderNo != null">
-        #{orderNo,jdbcType=VARCHAR},
-      </if>
-      <if test="tid != null">
-        #{tid,jdbcType=INTEGER},
-      </if>
-      <if test="projectType != null">
-        #{projectType,jdbcType=INTEGER},
-      </if>
-      <if test="dunType != null">
-        #{dunType,jdbcType=INTEGER},
-      </if>
-      <if test="waitDay != null">
-        #{waitDay,jdbcType=INTEGER},
-      </if>
-      <if test="effectiveCount != null">
-        #{effectiveCount,jdbcType=INTEGER},
-      </if>
-      <if test="aid != null">
-        #{aid,jdbcType=VARCHAR},
-      </if>
-      <if test="status != null">
-        #{status,jdbcType=INTEGER},
-      </if>
-      <if test="createTime != null">
-        #{createTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="startTime != null">
-        #{startTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="money != null">
-        #{money,jdbcType=DECIMAL},
-      </if>
-      <if test="appropriationRatio != null">
-        #{appropriationRatio,jdbcType=DECIMAL},
-      </if>
-      <if test="customizeName != null">
-        #{customizeName,jdbcType=VARCHAR},
-      </if>
-      <if test="customizeTime != null">
-        #{customizeTime,jdbcType=TIMESTAMP},
-      </if>
-    </trim>
-  </insert>
-  <select id="countByExample" parameterType="com.goafanti.common.model.NewOrderDunExample" resultType="java.lang.Long">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri May 15 09:46:56 CST 2020.
-    -->
-    select count(*) from new_order_dun
-    <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 Fri May 15 09:46:56 CST 2020.
-    -->
-    update new_order_dun
-    <set>
-      <if test="record.id != null">
-        id = #{record.id,jdbcType=INTEGER},
-      </if>
-      <if test="record.orderNo != null">
-        order_no = #{record.orderNo,jdbcType=VARCHAR},
-      </if>
-      <if test="record.tid != null">
-        tid = #{record.tid,jdbcType=INTEGER},
-      </if>
-      <if test="record.projectType != null">
-        project_type = #{record.projectType,jdbcType=INTEGER},
-      </if>
-      <if test="record.dunType != null">
-        dun_type = #{record.dunType,jdbcType=INTEGER},
-      </if>
-      <if test="record.waitDay != null">
-        wait_day = #{record.waitDay,jdbcType=INTEGER},
-      </if>
-      <if test="record.effectiveCount != null">
-        effective_count = #{record.effectiveCount,jdbcType=INTEGER},
-      </if>
-      <if test="record.aid != null">
-        aid = #{record.aid,jdbcType=VARCHAR},
-      </if>
-      <if test="record.status != null">
-        status = #{record.status,jdbcType=INTEGER},
-      </if>
-      <if test="record.createTime != null">
-        create_time = #{record.createTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="record.startTime != null">
-        start_time = #{record.startTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="record.money != null">
-        money = #{record.money,jdbcType=DECIMAL},
-      </if>
-      <if test="record.appropriationRatio != null">
-        appropriation_ratio = #{record.appropriationRatio,jdbcType=DECIMAL},
-      </if>
-      <if test="record.customizeName != null">
-        customize_name = #{record.customizeName,jdbcType=VARCHAR},
-      </if>
-      <if test="record.customizeTime != null">
-        customize_time = #{record.customizeTime,jdbcType=TIMESTAMP},
-      </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 Fri May 15 09:46:56 CST 2020.
-    -->
-    update new_order_dun
-    set id = #{record.id,jdbcType=INTEGER},
-      order_no = #{record.orderNo,jdbcType=VARCHAR},
-      tid = #{record.tid,jdbcType=INTEGER},
-      project_type = #{record.projectType,jdbcType=INTEGER},
-      dun_type = #{record.dunType,jdbcType=INTEGER},
-      wait_day = #{record.waitDay,jdbcType=INTEGER},
-      effective_count = #{record.effectiveCount,jdbcType=INTEGER},
-      aid = #{record.aid,jdbcType=VARCHAR},
-      status = #{record.status,jdbcType=INTEGER},
-      create_time = #{record.createTime,jdbcType=TIMESTAMP},
-      start_time = #{record.startTime,jdbcType=TIMESTAMP},
-      money = #{record.money,jdbcType=DECIMAL},
-      appropriation_ratio = #{record.appropriationRatio,jdbcType=DECIMAL},
-      customize_name = #{record.customizeName,jdbcType=VARCHAR},
-      customize_time = #{record.customizeTime,jdbcType=TIMESTAMP}
-    <if test="_parameter != null">
-      <include refid="Update_By_Example_Where_Clause" />
-    </if>
-  </update>
-  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.NewOrderDun">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri May 15 09:46:56 CST 2020.
-    -->
-    update new_order_dun
-    <set>
-      <if test="orderNo != null">
-        order_no = #{orderNo,jdbcType=VARCHAR},
-      </if>
-      <if test="tid != null">
-        tid = #{tid,jdbcType=INTEGER},
-      </if>
-      <if test="projectType != null">
-        project_type = #{projectType,jdbcType=INTEGER},
-      </if>
-      <if test="dunType != null">
-        dun_type = #{dunType,jdbcType=INTEGER},
-      </if>
-      <if test="waitDay != null">
-        wait_day = #{waitDay,jdbcType=INTEGER},
-      </if>
-      <if test="effectiveCount != null">
-        effective_count = #{effectiveCount,jdbcType=INTEGER},
-      </if>
-      <if test="aid != null">
-        aid = #{aid,jdbcType=VARCHAR},
-      </if>
-      <if test="status != null">
-        status = #{status,jdbcType=INTEGER},
-      </if>
-      <if test="createTime != null">
-        create_time = #{createTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="startTime != null">
-        start_time = #{startTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="money != null">
-        money = #{money,jdbcType=DECIMAL},
-      </if>
-      <if test="appropriationRatio != null">
-        appropriation_ratio = #{appropriationRatio,jdbcType=DECIMAL},
-      </if>
-      <if test="customizeName != null">
-        customize_name = #{customizeName,jdbcType=VARCHAR},
-      </if>
-      <if test="customizeTime != null">
-        customize_time = #{customizeTime,jdbcType=TIMESTAMP},
-      </if>
-    </set>
-    where id = #{id,jdbcType=INTEGER}
-  </update>
-  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.NewOrderDun">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri May 15 09:46:56 CST 2020.
-    -->
-    update new_order_dun
-    set order_no = #{orderNo,jdbcType=VARCHAR},
-      tid = #{tid,jdbcType=INTEGER},
-      project_type = #{projectType,jdbcType=INTEGER},
-      dun_type = #{dunType,jdbcType=INTEGER},
-      wait_day = #{waitDay,jdbcType=INTEGER},
-      effective_count = #{effectiveCount,jdbcType=INTEGER},
-      aid = #{aid,jdbcType=VARCHAR},
-      status = #{status,jdbcType=INTEGER},
-      create_time = #{createTime,jdbcType=TIMESTAMP},
-      start_time = #{startTime,jdbcType=TIMESTAMP},
-      money = #{money,jdbcType=DECIMAL},
-      appropriation_ratio = #{appropriationRatio,jdbcType=DECIMAL},
-      customize_name = #{customizeName,jdbcType=VARCHAR},
-      customize_time = #{customizeTime,jdbcType=TIMESTAMP}
-    where id = #{id,jdbcType=INTEGER}
-  </update>
-  <delete id="deleteByTid" parameterType="java.lang.Integer">
-    
-    delete from new_order_dun
-    where tid = #{tid,jdbcType=INTEGER}
-  </delete>
-  <select id="selectListNewOrderDun" resultType="com.goafanti.order.bo.OutNewOrderDunBo">
-  select a.id,a.order_no orderNo, a.tid, a.project_type projectType, a.dun_type dunType, a.wait_day waitDay, b.set_up_amount setUpAmount,
-  a.effective_count effectiveCount, a.aid, a.create_time createTime ,b.commodity_name commodityName,a.money,a.status,a.customize_time customizeTime,
-  a.appropriation_ratio appropriationRatio,date_format(a.customize_time,'%Y-%m-%d') customizeTimes, a.customize_name customizeName 
-  from new_order_dun a left join t_order_task b on a.tid=b.id where 1=1
-  <if test="orderNo != null">
-  and  a.order_no= #{orderNo}
-  </if>
-  <if test="status != null">
-  and  a.status= #{status}
-  </if>
-   order by project_type,dun_type 
-  </select>
-  <select id="selectAllOrderDun" resultType="com.goafanti.order.bo.OutNewOrderDunBo"> 
-  select a.id, a.order_no orderNo, a.tid, a.project_type projectType, a.dun_type dunType, a.wait_day waitDay, 
-  a.effective_count effectiveCount, a.aid, a.create_time createTime,b.approval,a.customize_time customizeTime
-  ,date_format(a.customize_time,'%Y-%m-%d') customizeTimes, a.customize_name customizeName,a.money 
-  from new_order_dun a left join  t_order_new b on a.order_no=b.order_no
-  where 1=1 and a.status=0 and b.process_status &gt; 4
-  </select>
-  <select id="selectByTid" resultType="com.goafanti.order.bo.OutNewOrderDunBo">
-    select a.id, a.order_no orderNo, a.tid, a.project_type projectType, a.dun_type dunType, a.wait_day waitDay, 
-  	a.effective_count effectiveCount, a.aid, a.money,a.create_time createTime 
-  	,date_format(a.customize_time,'%Y-%m-%d') customizeTimes, a.customize_name customizeName
-  	from new_order_dun a
-    where tid = #{tid} and status=0
-  </select>
+<?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.NewOrderDunMapper">
+  <resultMap id="BaseResultMap" type="com.goafanti.common.model.NewOrderDun">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Fri May 15 09:46:56 CST 2020.
+    -->
+    <id column="id" jdbcType="INTEGER" property="id" />
+    <result column="order_no" jdbcType="VARCHAR" property="orderNo" />
+    <result column="tid" jdbcType="INTEGER" property="tid" />
+    <result column="project_type" jdbcType="INTEGER" property="projectType" />
+    <result column="dun_type" jdbcType="INTEGER" property="dunType" />
+    <result column="wait_day" jdbcType="INTEGER" property="waitDay" />
+    <result column="effective_count" jdbcType="INTEGER" property="effectiveCount" />
+    <result column="aid" jdbcType="VARCHAR" property="aid" />
+    <result column="status" jdbcType="INTEGER" property="status" />
+    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+    <result column="start_time" jdbcType="TIMESTAMP" property="startTime" />
+    <result column="money" jdbcType="DECIMAL" property="money" />
+    <result column="appropriation_ratio" jdbcType="DECIMAL" property="appropriationRatio" />
+    <result column="customize_name" jdbcType="VARCHAR" property="customizeName" />
+    <result column="customize_time" jdbcType="TIMESTAMP" property="customizeTime" />
+  </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 Fri May 15 09:46:56 CST 2020.
+    -->
+    <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 Fri May 15 09:46:56 CST 2020.
+    -->
+    <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 Fri May 15 09:46:56 CST 2020.
+    -->
+    id, order_no, tid, project_type, dun_type, wait_day, effective_count, aid, status, 
+    create_time, start_time, money, appropriation_ratio, customize_name, customize_time
+  </sql>
+  <select id="selectByExample" parameterType="com.goafanti.common.model.NewOrderDunExample" resultMap="BaseResultMap">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Fri May 15 09:46:56 CST 2020.
+    -->
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from new_order_dun
+    <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.Integer" resultMap="BaseResultMap">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Fri May 15 09:46:56 CST 2020.
+    -->
+    select 
+    <include refid="Base_Column_List" />
+    from new_order_dun
+    where id = #{id,jdbcType=INTEGER}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Fri May 15 09:46:56 CST 2020.
+    -->
+    delete from new_order_dun
+    where id = #{id,jdbcType=INTEGER}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.goafanti.common.model.NewOrderDunExample">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Fri May 15 09:46:56 CST 2020.
+    -->
+    delete from new_order_dun
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.goafanti.common.model.NewOrderDun">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Fri May 15 09:46:56 CST 2020.
+    -->
+    insert into new_order_dun (id, order_no, tid, 
+      project_type, dun_type, wait_day, 
+      effective_count, aid, status, 
+      create_time, start_time, money, 
+      appropriation_ratio, customize_name, customize_time
+      )
+    values (#{id,jdbcType=INTEGER}, #{orderNo,jdbcType=VARCHAR}, #{tid,jdbcType=INTEGER}, 
+      #{projectType,jdbcType=INTEGER}, #{dunType,jdbcType=INTEGER}, #{waitDay,jdbcType=INTEGER}, 
+      #{effectiveCount,jdbcType=INTEGER}, #{aid,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, 
+      #{createTime,jdbcType=TIMESTAMP}, #{startTime,jdbcType=TIMESTAMP}, #{money,jdbcType=DECIMAL}, 
+      #{appropriationRatio,jdbcType=DECIMAL}, #{customizeName,jdbcType=VARCHAR}, #{customizeTime,jdbcType=TIMESTAMP}
+      )
+  </insert>
+  <insert id="insertSelective" parameterType="com.goafanti.common.model.NewOrderDun">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Fri May 15 09:46:56 CST 2020.
+    -->
+    insert into new_order_dun
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="orderNo != null">
+        order_no,
+      </if>
+      <if test="tid != null">
+        tid,
+      </if>
+      <if test="projectType != null">
+        project_type,
+      </if>
+      <if test="dunType != null">
+        dun_type,
+      </if>
+      <if test="waitDay != null">
+        wait_day,
+      </if>
+      <if test="effectiveCount != null">
+        effective_count,
+      </if>
+      <if test="aid != null">
+        aid,
+      </if>
+      <if test="status != null">
+        status,
+      </if>
+      <if test="createTime != null">
+        create_time,
+      </if>
+      <if test="startTime != null">
+        start_time,
+      </if>
+      <if test="money != null">
+        money,
+      </if>
+      <if test="appropriationRatio != null">
+        appropriation_ratio,
+      </if>
+      <if test="customizeName != null">
+        customize_name,
+      </if>
+      <if test="customizeTime != null">
+        customize_time,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=INTEGER},
+      </if>
+      <if test="orderNo != null">
+        #{orderNo,jdbcType=VARCHAR},
+      </if>
+      <if test="tid != null">
+        #{tid,jdbcType=INTEGER},
+      </if>
+      <if test="projectType != null">
+        #{projectType,jdbcType=INTEGER},
+      </if>
+      <if test="dunType != null">
+        #{dunType,jdbcType=INTEGER},
+      </if>
+      <if test="waitDay != null">
+        #{waitDay,jdbcType=INTEGER},
+      </if>
+      <if test="effectiveCount != null">
+        #{effectiveCount,jdbcType=INTEGER},
+      </if>
+      <if test="aid != null">
+        #{aid,jdbcType=VARCHAR},
+      </if>
+      <if test="status != null">
+        #{status,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null">
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="startTime != null">
+        #{startTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="money != null">
+        #{money,jdbcType=DECIMAL},
+      </if>
+      <if test="appropriationRatio != null">
+        #{appropriationRatio,jdbcType=DECIMAL},
+      </if>
+      <if test="customizeName != null">
+        #{customizeName,jdbcType=VARCHAR},
+      </if>
+      <if test="customizeTime != null">
+        #{customizeTime,jdbcType=TIMESTAMP},
+      </if>
+    </trim>
+  </insert>
+  <select id="countByExample" parameterType="com.goafanti.common.model.NewOrderDunExample" resultType="java.lang.Long">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Fri May 15 09:46:56 CST 2020.
+    -->
+    select count(*) from new_order_dun
+    <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 Fri May 15 09:46:56 CST 2020.
+    -->
+    update new_order_dun
+    <set>
+      <if test="record.id != null">
+        id = #{record.id,jdbcType=INTEGER},
+      </if>
+      <if test="record.orderNo != null">
+        order_no = #{record.orderNo,jdbcType=VARCHAR},
+      </if>
+      <if test="record.tid != null">
+        tid = #{record.tid,jdbcType=INTEGER},
+      </if>
+      <if test="record.projectType != null">
+        project_type = #{record.projectType,jdbcType=INTEGER},
+      </if>
+      <if test="record.dunType != null">
+        dun_type = #{record.dunType,jdbcType=INTEGER},
+      </if>
+      <if test="record.waitDay != null">
+        wait_day = #{record.waitDay,jdbcType=INTEGER},
+      </if>
+      <if test="record.effectiveCount != null">
+        effective_count = #{record.effectiveCount,jdbcType=INTEGER},
+      </if>
+      <if test="record.aid != null">
+        aid = #{record.aid,jdbcType=VARCHAR},
+      </if>
+      <if test="record.status != null">
+        status = #{record.status,jdbcType=INTEGER},
+      </if>
+      <if test="record.createTime != null">
+        create_time = #{record.createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="record.startTime != null">
+        start_time = #{record.startTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="record.money != null">
+        money = #{record.money,jdbcType=DECIMAL},
+      </if>
+      <if test="record.appropriationRatio != null">
+        appropriation_ratio = #{record.appropriationRatio,jdbcType=DECIMAL},
+      </if>
+      <if test="record.customizeName != null">
+        customize_name = #{record.customizeName,jdbcType=VARCHAR},
+      </if>
+      <if test="record.customizeTime != null">
+        customize_time = #{record.customizeTime,jdbcType=TIMESTAMP},
+      </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 Fri May 15 09:46:56 CST 2020.
+    -->
+    update new_order_dun
+    set id = #{record.id,jdbcType=INTEGER},
+      order_no = #{record.orderNo,jdbcType=VARCHAR},
+      tid = #{record.tid,jdbcType=INTEGER},
+      project_type = #{record.projectType,jdbcType=INTEGER},
+      dun_type = #{record.dunType,jdbcType=INTEGER},
+      wait_day = #{record.waitDay,jdbcType=INTEGER},
+      effective_count = #{record.effectiveCount,jdbcType=INTEGER},
+      aid = #{record.aid,jdbcType=VARCHAR},
+      status = #{record.status,jdbcType=INTEGER},
+      create_time = #{record.createTime,jdbcType=TIMESTAMP},
+      start_time = #{record.startTime,jdbcType=TIMESTAMP},
+      money = #{record.money,jdbcType=DECIMAL},
+      appropriation_ratio = #{record.appropriationRatio,jdbcType=DECIMAL},
+      customize_name = #{record.customizeName,jdbcType=VARCHAR},
+      customize_time = #{record.customizeTime,jdbcType=TIMESTAMP}
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.NewOrderDun">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Fri May 15 09:46:56 CST 2020.
+    -->
+    update new_order_dun
+    <set>
+      <if test="orderNo != null">
+        order_no = #{orderNo,jdbcType=VARCHAR},
+      </if>
+      <if test="tid != null">
+        tid = #{tid,jdbcType=INTEGER},
+      </if>
+      <if test="projectType != null">
+        project_type = #{projectType,jdbcType=INTEGER},
+      </if>
+      <if test="dunType != null">
+        dun_type = #{dunType,jdbcType=INTEGER},
+      </if>
+      <if test="waitDay != null">
+        wait_day = #{waitDay,jdbcType=INTEGER},
+      </if>
+      <if test="effectiveCount != null">
+        effective_count = #{effectiveCount,jdbcType=INTEGER},
+      </if>
+      <if test="aid != null">
+        aid = #{aid,jdbcType=VARCHAR},
+      </if>
+      <if test="status != null">
+        status = #{status,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null">
+        create_time = #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="startTime != null">
+        start_time = #{startTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="money != null">
+        money = #{money,jdbcType=DECIMAL},
+      </if>
+      <if test="appropriationRatio != null">
+        appropriation_ratio = #{appropriationRatio,jdbcType=DECIMAL},
+      </if>
+      <if test="customizeName != null">
+        customize_name = #{customizeName,jdbcType=VARCHAR},
+      </if>
+      <if test="customizeTime != null">
+        customize_time = #{customizeTime,jdbcType=TIMESTAMP},
+      </if>
+    </set>
+    where id = #{id,jdbcType=INTEGER}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.NewOrderDun">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Fri May 15 09:46:56 CST 2020.
+    -->
+    update new_order_dun
+    set order_no = #{orderNo,jdbcType=VARCHAR},
+      tid = #{tid,jdbcType=INTEGER},
+      project_type = #{projectType,jdbcType=INTEGER},
+      dun_type = #{dunType,jdbcType=INTEGER},
+      wait_day = #{waitDay,jdbcType=INTEGER},
+      effective_count = #{effectiveCount,jdbcType=INTEGER},
+      aid = #{aid,jdbcType=VARCHAR},
+      status = #{status,jdbcType=INTEGER},
+      create_time = #{createTime,jdbcType=TIMESTAMP},
+      start_time = #{startTime,jdbcType=TIMESTAMP},
+      money = #{money,jdbcType=DECIMAL},
+      appropriation_ratio = #{appropriationRatio,jdbcType=DECIMAL},
+      customize_name = #{customizeName,jdbcType=VARCHAR},
+      customize_time = #{customizeTime,jdbcType=TIMESTAMP}
+    where id = #{id,jdbcType=INTEGER}
+  </update>
+  <delete id="deleteByTid" parameterType="java.lang.Integer">
+    
+    delete from new_order_dun
+    where tid = #{tid,jdbcType=INTEGER}
+  </delete>
+  <select id="selectListNewOrderDun" resultType="com.goafanti.order.bo.OutNewOrderDunBo">
+  select a.id,a.order_no orderNo, a.tid, a.project_type projectType, a.dun_type dunType, a.wait_day waitDay, b.set_up_amount setUpAmount,
+  a.effective_count effectiveCount, a.aid, a.create_time createTime ,b.commodity_name commodityName,a.money,a.status,a.customize_time customizeTime,
+  a.appropriation_ratio appropriationRatio,date_format(a.customize_time,'%Y-%m-%d') customizeTimes, a.customize_name customizeName 
+  from new_order_dun a left join t_order_task b on a.tid=b.id where 1=1
+  <if test="orderNo != null">
+  and  a.order_no= #{orderNo}
+  </if>
+  <if test="status != null">
+  and  a.status= #{status}
+  </if>
+   order by project_type,dun_type 
+  </select>
+  <select id="selectAllOrderDun" resultType="com.goafanti.order.bo.OutNewOrderDunBo"> 
+  select a.id, a.order_no orderNo, a.tid, a.project_type projectType, a.dun_type dunType, a.wait_day waitDay, 
+  a.effective_count effectiveCount, a.aid, a.create_time createTime,b.approval,a.customize_time customizeTime
+  ,date_format(a.customize_time,'%Y-%m-%d') customizeTimes, a.customize_name customizeName,a.money 
+  from new_order_dun a left join  t_order_new b on a.order_no=b.order_no
+  where 1=1 and a.status=0 and b.process_status &gt; 4
+  </select>
+  <select id="selectByTid" resultType="com.goafanti.order.bo.OutNewOrderDunBo">
+    select a.id, a.order_no orderNo, a.tid, a.project_type projectType, a.dun_type dunType, a.wait_day waitDay, 
+  	a.effective_count effectiveCount, a.aid, a.money,a.create_time createTime 
+  	,date_format(a.customize_time,'%Y-%m-%d') customizeTimes, a.customize_name customizeName
+  	from new_order_dun a
+    where tid = #{tid} and status=0
+  </select>
+  
+  <insert id="insertBatch" parameterType="com.goafanti.order.bo.OutNewOrderDunBo">
+  insert into new_order_dun ( order_no, tid, 
+      project_type, dun_type, wait_day, 
+      effective_count, aid, status, 
+      create_time, start_time, money, 
+      appropriation_ratio, customize_name, customize_time
+      )
+    values
+    <foreach item="item" index="index" collection="list" separator=",">
+     (#{item.orderNo,jdbcType=VARCHAR}, #{item.tid,jdbcType=INTEGER}, 
+      #{item.projectType,jdbcType=INTEGER}, #{item.dunType,jdbcType=INTEGER}, #{item.waitDay,jdbcType=INTEGER}, 
+      #{item.effectiveCount,jdbcType=INTEGER}, #{item.aid,jdbcType=VARCHAR}, #{item.status,jdbcType=INTEGER}, 
+      #{item.createTime,jdbcType=TIMESTAMP}, #{item.startTime,jdbcType=TIMESTAMP}, #{item.money,jdbcType=DECIMAL}, 
+      #{item.appropriationRatio,jdbcType=DECIMAL}, #{item.customizeName,jdbcType=VARCHAR}, #{item.customizeTime,jdbcType=TIMESTAMP}
+      )
+      </foreach>
+  </insert>
 </mapper>

+ 14 - 0
src/main/java/com/goafanti/common/mapper/TOrderDunMapper.xml

@@ -421,4 +421,18 @@ select a.id,a.order_no as orderNo,date_format(b.sign_time,'%Y-%m-%d') as signDat
      delete from t_order_dun
     where order_no = #{orderNo,jdbcType=VARCHAR}
     </update>
+    <insert id="insertBatch" parameterType="com.goafanti.common.model.TOrderDun">
+     insert into t_order_dun (id, create_time, start_time, 
+      end_time, order_no, dun_subject, 
+      dun_status, dun_by, dun_target,money
+      )
+    values 
+    <foreach item="item" index="index" collection="list" separator=",">
+    (#{item.id,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP}, #{item.startTime,jdbcType=DATE}, 
+      #{item.endTime,jdbcType=DATE}, #{item.orderNo,jdbcType=VARCHAR}, #{item.dunSubject,jdbcType=INTEGER}, 
+      #{item.dunStatus,jdbcType=INTEGER}, #{item.dunBy,jdbcType=VARCHAR}, #{item.dunTarget,jdbcType=VARCHAR},
+      #{item.money,jdbcType=DECIMAL}
+      )
+      </foreach>
+    </insert>
 </mapper>

+ 320 - 308
src/main/java/com/goafanti/common/mapper/TOrderLogMapper.xml

@@ -1,309 +1,321 @@
-<?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.TOrderLogMapper">
-  <resultMap id="BaseResultMap" type="com.goafanti.common.model.TOrderLog">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Nov 28 11:28:43 CST 2019.
-    -->
-    <id column="id" jdbcType="INTEGER" property="id" />
-    <result column="order_no" jdbcType="VARCHAR" property="orderNo" />
-    <result column="process" jdbcType="INTEGER" property="process" />
-    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
-    <result column="aid" jdbcType="VARCHAR" property="aid" />
-    <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 Thu Nov 28 11:28:43 CST 2019.
-    -->
-    <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 Thu Nov 28 11:28:43 CST 2019.
-    -->
-    <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 Thu Nov 28 11:28:43 CST 2019.
-    -->
-    id, order_no, process, create_time, aid, remarks
-  </sql>
-  <select id="selectByExample" parameterType="com.goafanti.common.model.TOrderLogExample" resultMap="BaseResultMap">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Nov 28 11:28:43 CST 2019.
-    -->
-    select
-    <if test="distinct">
-      distinct
-    </if>
-    <include refid="Base_Column_List" />
-    from t_order_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.Integer" resultMap="BaseResultMap">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Nov 28 11:28:43 CST 2019.
-    -->
-    select 
-    <include refid="Base_Column_List" />
-    from t_order_log
-    where id = #{id,jdbcType=INTEGER}
-  </select>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Nov 28 11:28:43 CST 2019.
-    -->
-    delete from t_order_log
-    where id = #{id,jdbcType=INTEGER}
-  </delete>
-  <delete id="deleteByExample" parameterType="com.goafanti.common.model.TOrderLogExample">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Nov 28 11:28:43 CST 2019.
-    -->
-    delete from t_order_log
-    <if test="_parameter != null">
-      <include refid="Example_Where_Clause" />
-    </if>
-  </delete>
-  <insert id="insert" parameterType="com.goafanti.common.model.TOrderLog">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Nov 28 11:28:43 CST 2019.
-    -->
-    insert into t_order_log (id, order_no, process, 
-      create_time, aid, remarks
-      )
-    values (#{id,jdbcType=INTEGER}, #{orderNo,jdbcType=VARCHAR}, #{process,jdbcType=INTEGER}, 
-      #{createTime,jdbcType=TIMESTAMP}, #{aid,jdbcType=VARCHAR}, #{remarks,jdbcType=VARCHAR}
-      )
-  </insert>
-  <insert id="insertSelective" parameterType="com.goafanti.common.model.TOrderLog">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Nov 28 11:28:43 CST 2019.
-    -->
-    insert into t_order_log
-    <trim prefix="(" suffix=")" suffixOverrides=",">
-      <if test="id != null">
-        id,
-      </if>
-      <if test="orderNo != null">
-        order_no,
-      </if>
-      <if test="process != null">
-        process,
-      </if>
-      <if test="createTime != null">
-        create_time,
-      </if>
-      <if test="aid != null">
-        aid,
-      </if>
-      <if test="remarks != null">
-        remarks,
-      </if>
-    </trim>
-    <trim prefix="values (" suffix=")" suffixOverrides=",">
-      <if test="id != null">
-        #{id,jdbcType=INTEGER},
-      </if>
-      <if test="orderNo != null">
-        #{orderNo,jdbcType=VARCHAR},
-      </if>
-      <if test="process != null">
-        #{process,jdbcType=INTEGER},
-      </if>
-      <if test="createTime != null">
-        #{createTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="aid != null">
-        #{aid,jdbcType=VARCHAR},
-      </if>
-      <if test="remarks != null">
-        #{remarks,jdbcType=VARCHAR},
-      </if>
-    </trim>
-  </insert>
-  <select id="countByExample" parameterType="com.goafanti.common.model.TOrderLogExample" resultType="java.lang.Long">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Nov 28 11:28:43 CST 2019.
-    -->
-    select count(*) from t_order_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 Thu Nov 28 11:28:43 CST 2019.
-    -->
-    update t_order_log
-    <set>
-      <if test="record.id != null">
-        id = #{record.id,jdbcType=INTEGER},
-      </if>
-      <if test="record.orderNo != null">
-        order_no = #{record.orderNo,jdbcType=VARCHAR},
-      </if>
-      <if test="record.process != null">
-        process = #{record.process,jdbcType=INTEGER},
-      </if>
-      <if test="record.createTime != null">
-        create_time = #{record.createTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="record.aid != null">
-        aid = #{record.aid,jdbcType=VARCHAR},
-      </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 Thu Nov 28 11:28:43 CST 2019.
-    -->
-    update t_order_log
-    set id = #{record.id,jdbcType=INTEGER},
-      order_no = #{record.orderNo,jdbcType=VARCHAR},
-      process = #{record.process,jdbcType=INTEGER},
-      create_time = #{record.createTime,jdbcType=TIMESTAMP},
-      aid = #{record.aid,jdbcType=VARCHAR},
-      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.TOrderLog">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Nov 28 11:28:43 CST 2019.
-    -->
-    update t_order_log
-    <set>
-      <if test="orderNo != null">
-        order_no = #{orderNo,jdbcType=VARCHAR},
-      </if>
-      <if test="process != null">
-        process = #{process,jdbcType=INTEGER},
-      </if>
-      <if test="createTime != null">
-        create_time = #{createTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="aid != null">
-        aid = #{aid,jdbcType=VARCHAR},
-      </if>
-      <if test="remarks != null">
-        remarks = #{remarks,jdbcType=VARCHAR},
-      </if>
-    </set>
-    where id = #{id,jdbcType=INTEGER}
-  </update>
-  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.TOrderLog">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Nov 28 11:28:43 CST 2019.
-    -->
-    update t_order_log
-    set order_no = #{orderNo,jdbcType=VARCHAR},
-      process = #{process,jdbcType=INTEGER},
-      create_time = #{createTime,jdbcType=TIMESTAMP},
-      aid = #{aid,jdbcType=VARCHAR},
-      remarks = #{remarks,jdbcType=VARCHAR}
-    where id = #{id,jdbcType=INTEGER}
-  </update>
-  <select id="selectOrderByNo" parameterType="string" resultType="com.goafanti.order.bo.TOrderLogBo">
-  select a.id,a.order_no as orderNo,a.aid,a.process,a.create_time as createTime, b.name as adminName,a.remarks
-	from t_order_log a left join admin b on a.aid=b.id
-	where a.order_no= #{orderNo,jdbcType=VARCHAR}
-	order by a.create_time
-  </select>
+<?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.TOrderLogMapper">
+  <resultMap id="BaseResultMap" type="com.goafanti.common.model.TOrderLog">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Thu Nov 28 11:28:43 CST 2019.
+    -->
+    <id column="id" jdbcType="INTEGER" property="id" />
+    <result column="order_no" jdbcType="VARCHAR" property="orderNo" />
+    <result column="process" jdbcType="INTEGER" property="process" />
+    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+    <result column="aid" jdbcType="VARCHAR" property="aid" />
+    <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 Thu Nov 28 11:28:43 CST 2019.
+    -->
+    <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 Thu Nov 28 11:28:43 CST 2019.
+    -->
+    <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 Thu Nov 28 11:28:43 CST 2019.
+    -->
+    id, order_no, process, create_time, aid, remarks
+  </sql>
+  <select id="selectByExample" parameterType="com.goafanti.common.model.TOrderLogExample" resultMap="BaseResultMap">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Thu Nov 28 11:28:43 CST 2019.
+    -->
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from t_order_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.Integer" resultMap="BaseResultMap">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Thu Nov 28 11:28:43 CST 2019.
+    -->
+    select 
+    <include refid="Base_Column_List" />
+    from t_order_log
+    where id = #{id,jdbcType=INTEGER}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Thu Nov 28 11:28:43 CST 2019.
+    -->
+    delete from t_order_log
+    where id = #{id,jdbcType=INTEGER}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.goafanti.common.model.TOrderLogExample">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Thu Nov 28 11:28:43 CST 2019.
+    -->
+    delete from t_order_log
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.goafanti.common.model.TOrderLog">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Thu Nov 28 11:28:43 CST 2019.
+    -->
+    insert into t_order_log (id, order_no, process, 
+      create_time, aid, remarks
+      )
+    values (#{id,jdbcType=INTEGER}, #{orderNo,jdbcType=VARCHAR}, #{process,jdbcType=INTEGER}, 
+      #{createTime,jdbcType=TIMESTAMP}, #{aid,jdbcType=VARCHAR}, #{remarks,jdbcType=VARCHAR}
+      )
+  </insert>
+  <insert id="insertSelective" parameterType="com.goafanti.common.model.TOrderLog">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Thu Nov 28 11:28:43 CST 2019.
+    -->
+    insert into t_order_log
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="orderNo != null">
+        order_no,
+      </if>
+      <if test="process != null">
+        process,
+      </if>
+      <if test="createTime != null">
+        create_time,
+      </if>
+      <if test="aid != null">
+        aid,
+      </if>
+      <if test="remarks != null">
+        remarks,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=INTEGER},
+      </if>
+      <if test="orderNo != null">
+        #{orderNo,jdbcType=VARCHAR},
+      </if>
+      <if test="process != null">
+        #{process,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null">
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="aid != null">
+        #{aid,jdbcType=VARCHAR},
+      </if>
+      <if test="remarks != null">
+        #{remarks,jdbcType=VARCHAR},
+      </if>
+    </trim>
+  </insert>
+  <select id="countByExample" parameterType="com.goafanti.common.model.TOrderLogExample" resultType="java.lang.Long">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Thu Nov 28 11:28:43 CST 2019.
+    -->
+    select count(*) from t_order_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 Thu Nov 28 11:28:43 CST 2019.
+    -->
+    update t_order_log
+    <set>
+      <if test="record.id != null">
+        id = #{record.id,jdbcType=INTEGER},
+      </if>
+      <if test="record.orderNo != null">
+        order_no = #{record.orderNo,jdbcType=VARCHAR},
+      </if>
+      <if test="record.process != null">
+        process = #{record.process,jdbcType=INTEGER},
+      </if>
+      <if test="record.createTime != null">
+        create_time = #{record.createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="record.aid != null">
+        aid = #{record.aid,jdbcType=VARCHAR},
+      </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 Thu Nov 28 11:28:43 CST 2019.
+    -->
+    update t_order_log
+    set id = #{record.id,jdbcType=INTEGER},
+      order_no = #{record.orderNo,jdbcType=VARCHAR},
+      process = #{record.process,jdbcType=INTEGER},
+      create_time = #{record.createTime,jdbcType=TIMESTAMP},
+      aid = #{record.aid,jdbcType=VARCHAR},
+      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.TOrderLog">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Thu Nov 28 11:28:43 CST 2019.
+    -->
+    update t_order_log
+    <set>
+      <if test="orderNo != null">
+        order_no = #{orderNo,jdbcType=VARCHAR},
+      </if>
+      <if test="process != null">
+        process = #{process,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null">
+        create_time = #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="aid != null">
+        aid = #{aid,jdbcType=VARCHAR},
+      </if>
+      <if test="remarks != null">
+        remarks = #{remarks,jdbcType=VARCHAR},
+      </if>
+    </set>
+    where id = #{id,jdbcType=INTEGER}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.TOrderLog">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Thu Nov 28 11:28:43 CST 2019.
+    -->
+    update t_order_log
+    set order_no = #{orderNo,jdbcType=VARCHAR},
+      process = #{process,jdbcType=INTEGER},
+      create_time = #{createTime,jdbcType=TIMESTAMP},
+      aid = #{aid,jdbcType=VARCHAR},
+      remarks = #{remarks,jdbcType=VARCHAR}
+    where id = #{id,jdbcType=INTEGER}
+  </update>
+  <select id="selectOrderByNo" parameterType="string" resultType="com.goafanti.order.bo.TOrderLogBo">
+  select a.id,a.order_no as orderNo,a.aid,a.process,a.create_time as createTime, b.name as adminName,a.remarks
+	from t_order_log a left join admin b on a.aid=b.id
+	where a.order_no= #{orderNo,jdbcType=VARCHAR}
+	order by a.create_time
+  </select>
+  
+  <insert id="insertBatch" parameterType="com.goafanti.order.bo.TOrderLogBo">
+    insert into t_order_log ( order_no, process, 
+      create_time, aid, remarks
+      )
+    values 
+    <foreach item="item" index="index" collection="list" separator=",">
+    ( #{item.orderNo,jdbcType=VARCHAR}, #{item.process,jdbcType=INTEGER}, 
+      #{item.createTime,jdbcType=TIMESTAMP}, #{item.aid,jdbcType=VARCHAR}, #{item.remarks,jdbcType=VARCHAR}
+      )
+      </foreach>
+  </insert>
 </mapper>

+ 6 - 0
src/main/java/com/goafanti/common/mapper/TOrderTaskMapper.xml

@@ -1798,4 +1798,10 @@ select
   <update id="updateByOutsourceToOrderNo">
   	update t_order_task set outsource= #{type} where order_no= #{orderNo}
   </update>
+  <select id="getLockId" resultType="java.lang.Integer">
+     select id from user_lock_release a left join (select commodity_id  from t_order_task 
+   where order_no = #{orderNo} GROUP by commodity_id ) 
+   b on a.business_project_id =b.commodity_id 
+   where a.`type` =1 and a.aid = #{aid} and a.uid = #{uid}
+  </select>
 </mapper>

+ 19 - 0
src/main/java/com/goafanti/common/mapper/UserLockReleaseMapper.xml

@@ -491,4 +491,23 @@
 	where aid= #{aid} and uid= #{uid} and business_project_id = #{pid}
   </select>
   
+  <update id="updateReleaseList" >
+  update user_lock_release 
+  	set release_time =now(),status =2
+  	where id  in 
+  	<foreach item="item" collection="list" separator="," open="(" close=")" index="">
+       #{item}
+     </foreach>
+  </update>
+  <select id="selectByUidGetCount" resultType="java.lang.Integer">
+  select count(*) from user_lock_release 
+  	where `type` =1 and aid = #{aid} and uid= #{uid} 
+  </select>
+  <update id="updateReleaseUser">
+  update t_order_new a ,user b ,user_business  c
+	set b.share_type =1,b.transfer_time =now(),
+	c.customer_status =6,c.follow_situation =8
+	where a.order_no = #{orderNo} and a.buyer_id =b.id  
+	and a.buyer_id =c.uid and a.salesman_id =c.aid and c.follow_situation =5
+  </update>
 </mapper>

+ 31 - 16
src/main/java/com/goafanti/order/service/impl/OrderChangeServiceImpl.java

@@ -43,6 +43,8 @@ import com.goafanti.common.dao.TOrderLogMapper;
 import com.goafanti.common.dao.TOrderNewMapper;
 import com.goafanti.common.dao.TOrderTaskMapper;
 import com.goafanti.common.dao.TTaskMidMapper;
+import com.goafanti.common.dao.UserLockReleaseMapper;
+import com.goafanti.common.dao.UserMapper;
 import com.goafanti.common.enums.NoticeStatus;
 import com.goafanti.common.error.BusinessException;
 import com.goafanti.common.model.OrderChangeLog;
@@ -55,6 +57,7 @@ import com.goafanti.common.model.TOrderDun;
 import com.goafanti.common.model.TOrderNew;
 import com.goafanti.common.model.TOrderTask;
 import com.goafanti.common.model.TTaskMid;
+import com.goafanti.common.model.UserLockRelease;
 import com.goafanti.common.model.Admin;
 import com.goafanti.common.model.NewOrderChange;
 import com.goafanti.common.model.NewOrderDun;
@@ -87,6 +90,7 @@ import com.goafanti.order.service.NewOrderDunService;
 import com.goafanti.order.service.OrderChangeService;
 import com.goafanti.order.service.OrderNewService;
 import com.goafanti.order.service.OrderService;
+import com.goafanti.report.bo.userDataListBo;
 import com.goafanti.techproject.enums.TaskState;
 
 @Service
@@ -133,6 +137,8 @@ public class OrderChangeServiceImpl extends BaseMybatisDao<NewOrderChangeMapper>
 	private TOrderBillNewMapper tOrderBillNewMapper;
 	@Autowired
 	private TTaskMidMapper	tTaskMidMapper;
+	@Autowired
+	private UserLockReleaseMapper	userLockReleaseMapper;
 	
 	Logger							logger	= LoggerFactory.getLogger(OrderChangeServiceImpl.class);
 	
@@ -440,7 +446,6 @@ public class OrderChangeServiceImpl extends BaseMybatisDao<NewOrderChangeMapper>
 	 */
 	private void changeAdopt(NewOrderChangeBo nb) {
 		TOrderNew t1=tOrderNewMapper.selectByPrimaryKey(nb.getOrderNo());
-		List<TOrderDun> td1=tOrderDunMapper.selectByOrderNo(nb.getOrderNo());
 		List<OutNewOrderDunBo> td2=newOrderDunMapper.selectListNewOrderDun(nb.getOrderNo(), null, null);
 		List<TOrderTaskBo> tt1=tOrderTaskMapper.selectOrderTaskAll(nb.getOrderNo());
 		List<TOrderLogBo> tl1=tOrderLogMapper.selectOrderByNo(nb.getOrderNo());		
@@ -465,20 +470,23 @@ public class OrderChangeServiceImpl extends BaseMybatisDao<NewOrderChangeMapper>
 				map.put(x, y);
 			}
 		}
-		for (OutNewOrderDunBo outNewOrderDunBo : td2) {
-			outNewOrderDunBo.setId(null);
-			outNewOrderDunBo.setOrderNo(newOrderNo);
-			newOrderDunMapper.insertSelective(outNewOrderDunBo);
-		}
-		for (TOrderDun tOrderDun : td1) {
-			tOrderDun.setId(UUID.randomUUID().toString());
-			tOrderDun.setOrderNo(newOrderNo);
-			tOrderDunMapper.insertSelective(tOrderDun);
+		if (!td2.isEmpty()) {
+			List<OutNewOrderDunBo> newtd2=new ArrayList<>();
+			for (OutNewOrderDunBo outNewOrderDunBo : td2) {
+				outNewOrderDunBo.setId(null);
+				outNewOrderDunBo.setOrderNo(newOrderNo);
+				newtd2.add(outNewOrderDunBo);
+			}
+			newOrderDunMapper.insertBatch(newtd2);
 		}
-		for (TOrderLogBo tOrderLogBo : tl1) {
-			tOrderLogBo.setId(null);
-			tOrderLogBo.setOrderNo(newOrderNo);
-			tOrderLogMapper.insertSelective(tOrderLogBo);
+		if (!tl1.isEmpty()) {
+			List<TOrderLogBo> newtl1=new ArrayList<>();
+			for (TOrderLogBo tOrderLogBo : tl1) {
+				tOrderLogBo.setId(null);
+				tOrderLogBo.setOrderNo(newOrderNo);
+				newtl1.add(tOrderLogBo);
+			}
+			tOrderLogMapper.insertBatch(newtl1);
 		}
 		nb.setStatus(4);
 		//将订单恢复正常
@@ -486,8 +494,6 @@ public class OrderChangeServiceImpl extends BaseMybatisDao<NewOrderChangeMapper>
 		orderNew.setOrderNo(nb.getOrderNo());
 		orderNew.setDeleteSign(0);
 		orderNew.setPrimaryOrder(newOrderNo);
-		//删除旧订单旧项目
-		tOrderDunMapper.deleteByOrderNo(nb.getOrderNo());
 		tOrderNewMapper.updateByPrimaryKeySelective(orderNew);
 	}
 	
@@ -663,6 +669,15 @@ public class OrderChangeServiceImpl extends BaseMybatisDao<NewOrderChangeMapper>
 			pushTaskAndDun(nob.getId(),nob.getOrderNo());
 		}else if (nob.getType()==OrderChangeType.ZS.getCode()) {
 			pushTaskAndDun(nob.getId(),nob.getOrderNo());
+		}else if(nob.getType()==OrderChangeType.TDTK.getCode()) {
+			//先将业务锁关闭
+			List<Integer> list=tOrderTaskMapper.getLockId(nb.getOrderNo(),o.getSalesmanId(),o.getBuyerId());
+			
+			userLockReleaseMapper.updateReleaseList(list);
+			int i=userLockReleaseMapper.selectByUidGetCount(o.getSalesmanId(),o.getBuyerId());
+			if (i<1) {
+				userLockReleaseMapper.updateReleaseUser(o.getOrderNo());
+			}
 		}
 		//
 		List<TOrderTaskBo> taskBos=tOrderTaskMapper.selectOrderTask(nb.getOrderNo());