|
@@ -2,11 +2,6 @@
|
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.goafanti.common.dao.TTaskMidMapper">
|
|
<mapper namespace="com.goafanti.common.dao.TTaskMidMapper">
|
|
|
<resultMap id="BaseResultMap" type="com.goafanti.common.model.TTaskMid">
|
|
<resultMap id="BaseResultMap" type="com.goafanti.common.model.TTaskMid">
|
|
|
- <!--
|
|
|
|
|
- WARNING - @mbg.generated
|
|
|
|
|
- This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
|
- This element was generated on Fri Dec 25 14:38:43 CST 2020.
|
|
|
|
|
- -->
|
|
|
|
|
<id column="id" jdbcType="INTEGER" property="id" />
|
|
<id column="id" jdbcType="INTEGER" property="id" />
|
|
|
<result column="tid" jdbcType="INTEGER" property="tid" />
|
|
<result column="tid" jdbcType="INTEGER" property="tid" />
|
|
|
<result column="cost_amount" jdbcType="DECIMAL" property="costAmount" />
|
|
<result column="cost_amount" jdbcType="DECIMAL" property="costAmount" />
|
|
@@ -20,59 +15,36 @@
|
|
|
<result column="end_count" jdbcType="INTEGER" property="endCount" />
|
|
<result column="end_count" jdbcType="INTEGER" property="endCount" />
|
|
|
<result column="authorize_count" jdbcType="INTEGER" property="authorizeCount" />
|
|
<result column="authorize_count" jdbcType="INTEGER" property="authorizeCount" />
|
|
|
<result column="apply_count" jdbcType="INTEGER" property="applyCount" />
|
|
<result column="apply_count" jdbcType="INTEGER" property="applyCount" />
|
|
|
|
|
+ <result column="high_new_retrial" jdbcType="INTEGER" property="highNewRetrial" />
|
|
|
</resultMap>
|
|
</resultMap>
|
|
|
<sql id="Base_Column_List">
|
|
<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 Dec 25 14:38:43 CST 2020.
|
|
|
|
|
- -->
|
|
|
|
|
id, tid, cost_amount, party_amount, create_time, certificates_count, urgent_day,
|
|
id, tid, cost_amount, party_amount, create_time, certificates_count, urgent_day,
|
|
|
- if_material, reject_count, accept_count, end_count, authorize_count, apply_count
|
|
|
|
|
|
|
+ if_material, reject_count, accept_count, end_count, authorize_count, apply_count,
|
|
|
|
|
+ high_new_retrial
|
|
|
</sql>
|
|
</sql>
|
|
|
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
|
<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 Dec 25 14:38:43 CST 2020.
|
|
|
|
|
- -->
|
|
|
|
|
select
|
|
select
|
|
|
<include refid="Base_Column_List" />
|
|
<include refid="Base_Column_List" />
|
|
|
from t_task_mid
|
|
from t_task_mid
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</select>
|
|
</select>
|
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
|
<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 Dec 25 14:38:43 CST 2020.
|
|
|
|
|
- -->
|
|
|
|
|
delete from t_task_mid
|
|
delete from t_task_mid
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</delete>
|
|
</delete>
|
|
|
<insert id="insert" parameterType="com.goafanti.common.model.TTaskMid">
|
|
<insert id="insert" parameterType="com.goafanti.common.model.TTaskMid">
|
|
|
- <!--
|
|
|
|
|
- WARNING - @mbg.generated
|
|
|
|
|
- This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
|
- This element was generated on Fri Dec 25 14:38:43 CST 2020.
|
|
|
|
|
- -->
|
|
|
|
|
insert into t_task_mid (id, tid, cost_amount,
|
|
insert into t_task_mid (id, tid, cost_amount,
|
|
|
party_amount, create_time, certificates_count,
|
|
party_amount, create_time, certificates_count,
|
|
|
urgent_day, if_material, reject_count,
|
|
urgent_day, if_material, reject_count,
|
|
|
accept_count, end_count, authorize_count,
|
|
accept_count, end_count, authorize_count,
|
|
|
- apply_count)
|
|
|
|
|
|
|
+ apply_count, high_new_retrial)
|
|
|
values (#{id,jdbcType=INTEGER}, #{tid,jdbcType=INTEGER}, #{costAmount,jdbcType=DECIMAL},
|
|
values (#{id,jdbcType=INTEGER}, #{tid,jdbcType=INTEGER}, #{costAmount,jdbcType=DECIMAL},
|
|
|
#{partyAmount,jdbcType=DECIMAL}, #{createTime,jdbcType=TIMESTAMP}, #{certificatesCount,jdbcType=INTEGER},
|
|
#{partyAmount,jdbcType=DECIMAL}, #{createTime,jdbcType=TIMESTAMP}, #{certificatesCount,jdbcType=INTEGER},
|
|
|
#{urgentDay,jdbcType=INTEGER}, #{ifMaterial,jdbcType=INTEGER}, #{rejectCount,jdbcType=INTEGER},
|
|
#{urgentDay,jdbcType=INTEGER}, #{ifMaterial,jdbcType=INTEGER}, #{rejectCount,jdbcType=INTEGER},
|
|
|
#{acceptCount,jdbcType=INTEGER}, #{endCount,jdbcType=INTEGER}, #{authorizeCount,jdbcType=INTEGER},
|
|
#{acceptCount,jdbcType=INTEGER}, #{endCount,jdbcType=INTEGER}, #{authorizeCount,jdbcType=INTEGER},
|
|
|
- #{applyCount,jdbcType=INTEGER})
|
|
|
|
|
|
|
+ #{applyCount,jdbcType=INTEGER}, #{highNewRetrial,jdbcType=INTEGER})
|
|
|
</insert>
|
|
</insert>
|
|
|
<insert id="insertSelective" parameterType="com.goafanti.common.model.TTaskMid">
|
|
<insert id="insertSelective" parameterType="com.goafanti.common.model.TTaskMid">
|
|
|
- <!--
|
|
|
|
|
- WARNING - @mbg.generated
|
|
|
|
|
- This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
|
- This element was generated on Fri Dec 25 14:38:43 CST 2020.
|
|
|
|
|
- -->
|
|
|
|
|
insert into t_task_mid
|
|
insert into t_task_mid
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
<if test="id != null">
|
|
<if test="id != null">
|
|
@@ -114,6 +86,9 @@
|
|
|
<if test="applyCount != null">
|
|
<if test="applyCount != null">
|
|
|
apply_count,
|
|
apply_count,
|
|
|
</if>
|
|
</if>
|
|
|
|
|
+ <if test="highNewRetrial != null">
|
|
|
|
|
+ high_new_retrial,
|
|
|
|
|
+ </if>
|
|
|
</trim>
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="id != null">
|
|
<if test="id != null">
|
|
@@ -155,14 +130,12 @@
|
|
|
<if test="applyCount != null">
|
|
<if test="applyCount != null">
|
|
|
#{applyCount,jdbcType=INTEGER},
|
|
#{applyCount,jdbcType=INTEGER},
|
|
|
</if>
|
|
</if>
|
|
|
|
|
+ <if test="highNewRetrial != null">
|
|
|
|
|
+ #{highNewRetrial,jdbcType=INTEGER},
|
|
|
|
|
+ </if>
|
|
|
</trim>
|
|
</trim>
|
|
|
</insert>
|
|
</insert>
|
|
|
<update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.TTaskMid">
|
|
<update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.TTaskMid">
|
|
|
- <!--
|
|
|
|
|
- WARNING - @mbg.generated
|
|
|
|
|
- This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
|
- This element was generated on Fri Dec 25 14:38:43 CST 2020.
|
|
|
|
|
- -->
|
|
|
|
|
update t_task_mid
|
|
update t_task_mid
|
|
|
<set>
|
|
<set>
|
|
|
<if test="tid != null">
|
|
<if test="tid != null">
|
|
@@ -201,15 +174,13 @@
|
|
|
<if test="applyCount != null">
|
|
<if test="applyCount != null">
|
|
|
apply_count = #{applyCount,jdbcType=INTEGER},
|
|
apply_count = #{applyCount,jdbcType=INTEGER},
|
|
|
</if>
|
|
</if>
|
|
|
|
|
+ <if test="highNewRetrial != null">
|
|
|
|
|
+ high_new_retrial = #{highNewRetrial,jdbcType=INTEGER},
|
|
|
|
|
+ </if>
|
|
|
</set>
|
|
</set>
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</update>
|
|
</update>
|
|
|
<update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.TTaskMid">
|
|
<update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.TTaskMid">
|
|
|
- <!--
|
|
|
|
|
- WARNING - @mbg.generated
|
|
|
|
|
- This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
|
- This element was generated on Fri Dec 25 14:38:43 CST 2020.
|
|
|
|
|
- -->
|
|
|
|
|
update t_task_mid
|
|
update t_task_mid
|
|
|
set tid = #{tid,jdbcType=INTEGER},
|
|
set tid = #{tid,jdbcType=INTEGER},
|
|
|
cost_amount = #{costAmount,jdbcType=DECIMAL},
|
|
cost_amount = #{costAmount,jdbcType=DECIMAL},
|
|
@@ -222,39 +193,41 @@
|
|
|
accept_count = #{acceptCount,jdbcType=INTEGER},
|
|
accept_count = #{acceptCount,jdbcType=INTEGER},
|
|
|
end_count = #{endCount,jdbcType=INTEGER},
|
|
end_count = #{endCount,jdbcType=INTEGER},
|
|
|
authorize_count = #{authorizeCount,jdbcType=INTEGER},
|
|
authorize_count = #{authorizeCount,jdbcType=INTEGER},
|
|
|
- apply_count = #{applyCount,jdbcType=INTEGER}
|
|
|
|
|
|
|
+ apply_count = #{applyCount,jdbcType=INTEGER},
|
|
|
|
|
+ high_new_retrial = #{highNewRetrial,jdbcType=INTEGER}
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</update>
|
|
</update>
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
<update id="updatePaymentAmount">
|
|
<update id="updatePaymentAmount">
|
|
|
- update t_task_mid
|
|
|
|
|
|
|
+ update t_task_mid
|
|
|
<if test="type == 0">
|
|
<if test="type == 0">
|
|
|
- set party_amount = party_amount + #{paymentAmount,jdbcType=DECIMAL}
|
|
|
|
|
|
|
+ set party_amount = party_amount + #{paymentAmount,jdbcType=DECIMAL}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="type == 1">
|
|
<if test="type == 1">
|
|
|
- set party_amount = party_amount - #{paymentAmount,jdbcType=DECIMAL}
|
|
|
|
|
|
|
+ set party_amount = party_amount - #{paymentAmount,jdbcType=DECIMAL}
|
|
|
</if>
|
|
</if>
|
|
|
where tid = #{tid,jdbcType=INTEGER}
|
|
where tid = #{tid,jdbcType=INTEGER}
|
|
|
</update>
|
|
</update>
|
|
|
<select id="selectListByTid" resultType="com.goafanti.common.model.TTaskMid">
|
|
<select id="selectListByTid" resultType="com.goafanti.common.model.TTaskMid">
|
|
|
- select c.id,c.tid,c.cost_amount costAmount,c.party_amount partyAmount from t_order_task a left join t_order_task b on a.order_no=b.order_no
|
|
|
|
|
- left join t_task_mid c on b.id=c.tid
|
|
|
|
|
- where a.id= #{tid}
|
|
|
|
|
|
|
+ select c.id,c.tid,c.cost_amount costAmount,c.party_amount partyAmount from t_order_task a left join t_order_task b on a.order_no=b.order_no
|
|
|
|
|
+ left join t_task_mid c on b.id=c.tid
|
|
|
|
|
+ where a.id= #{tid}
|
|
|
</select>
|
|
</select>
|
|
|
-
|
|
|
|
|
- <update id="updateCostAmount">
|
|
|
|
|
- update t_order_task a ,t_task_mid c
|
|
|
|
|
|
|
+
|
|
|
|
|
+ <update id="updateCostAmount">
|
|
|
|
|
+ update t_order_task a ,t_task_mid c
|
|
|
set c.cost_amount=#{count}
|
|
set c.cost_amount=#{count}
|
|
|
where a.id=c.tid and a.id= #{tid}
|
|
where a.id=c.tid and a.id= #{tid}
|
|
|
</update>
|
|
</update>
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
<update id="updateCertificatesCountByTid">
|
|
<update id="updateCertificatesCountByTid">
|
|
|
- update t_task_mid
|
|
|
|
|
- set certificates_count= #{count}
|
|
|
|
|
- where tid= #{tid}
|
|
|
|
|
|
|
+ update t_task_mid
|
|
|
|
|
+ set certificates_count= #{count}
|
|
|
|
|
+ where tid= #{tid}
|
|
|
</update>
|
|
</update>
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
<update id="updateByTid" parameterType="com.goafanti.common.model.TTaskMid">
|
|
<update id="updateByTid" parameterType="com.goafanti.common.model.TTaskMid">
|
|
|
update t_task_mid
|
|
update t_task_mid
|
|
|
<set>
|
|
<set>
|
|
@@ -277,35 +250,34 @@
|
|
|
where tid = #{tid,jdbcType=INTEGER}
|
|
where tid = #{tid,jdbcType=INTEGER}
|
|
|
</update>
|
|
</update>
|
|
|
<select id="selectCountBytid" resultType="com.goafanti.common.model.TTaskMid">
|
|
<select id="selectCountBytid" resultType="com.goafanti.common.model.TTaskMid">
|
|
|
- select a.id,
|
|
|
|
|
- <if test="type ==0">
|
|
|
|
|
- ifnull(b.lic,0) certificatesCount
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="type ==1">
|
|
|
|
|
- ifnull(b.acc ,0)acceptCount, ifnull(b.lic ,0)authorizeCount,ifnull(b.lic ,0)certificatesCount,
|
|
|
|
|
- ifnull(b.tgc ,0)endCount,ifnull(b.bhc ,0)rejectCount
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="type ==2">
|
|
|
|
|
- ifnull(b.acc ,0)acceptCount,ifnull(b.lic ,0)certificatesCount,ifnull(b.sqc,0) applyCount,
|
|
|
|
|
- ifnull(b.bhc,0) rejectCount
|
|
|
|
|
- </if>
|
|
|
|
|
- from t_task_mid a left join (select task_id tid,
|
|
|
|
|
- <if test="type ==0">
|
|
|
|
|
- sum(if(licence_time is null,0,1))lic from task_progress where task_id= #{tid} GROUP by task_id)b
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="type ==1">
|
|
|
|
|
- <!-- 下证数与授权数一样,下证统计大于则用下证,小于或者等于用授权统计 -->
|
|
|
|
|
- sum(if(if(licence_time is null,0,1) > if(authorize_time is null,0,1),
|
|
|
|
|
- if(licence_time is null,0,1),if(authorize_time is null,0,1)))lic ,ifnull(count(accept_time),0)acc,
|
|
|
|
|
- sum(if(status=1,1,0))tgc,sum(if(status=2 ,1,0))bhc from task_progress where task_id= #{tid} GROUP by task_id )b
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="type ==2">
|
|
|
|
|
- count(*)sqc, sum(if(licence_time is null,0,1))lic , sum(if(accept_time is null,0,1))acc,
|
|
|
|
|
- sum(if(status=2 ,1,0))bhc from task_progress where task_id= #{tid} GROUP by task_id )b
|
|
|
|
|
- </if>
|
|
|
|
|
- on a.tid =b.tid
|
|
|
|
|
- where a.tid= #{tid}
|
|
|
|
|
|
|
+ select a.id,
|
|
|
|
|
+ <if test="type ==0">
|
|
|
|
|
+ ifnull(b.lic,0) certificatesCount
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="type ==1">
|
|
|
|
|
+ ifnull(b.acc ,0)acceptCount, ifnull(b.lic ,0)authorizeCount,ifnull(b.lic ,0)certificatesCount,
|
|
|
|
|
+ ifnull(b.tgc ,0)endCount,ifnull(b.bhc ,0)rejectCount
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="type ==2">
|
|
|
|
|
+ ifnull(b.acc ,0)acceptCount,ifnull(b.lic ,0)certificatesCount,ifnull(b.sqc,0) applyCount,
|
|
|
|
|
+ ifnull(b.bhc,0) rejectCount
|
|
|
|
|
+ </if>
|
|
|
|
|
+ from t_task_mid a left join (select task_id tid,
|
|
|
|
|
+ <if test="type ==0">
|
|
|
|
|
+ sum(if(licence_time is null,0,1))lic from task_progress where task_id= #{tid} GROUP by task_id)b
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="type ==1">
|
|
|
|
|
+ <!-- 下证数与授权数一样,下证统计大于则用下证,小于或者等于用授权统计 -->
|
|
|
|
|
+ sum(if(if(licence_time is null,0,1) > if(authorize_time is null,0,1),
|
|
|
|
|
+ if(licence_time is null,0,1),if(authorize_time is null,0,1)))lic ,ifnull(count(accept_time),0)acc,
|
|
|
|
|
+ sum(if(status=1,1,0))tgc,sum(if(status=2 ,1,0))bhc from task_progress where task_id= #{tid} GROUP by task_id )b
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="type ==2">
|
|
|
|
|
+ count(*)sqc, sum(if(licence_time is null,0,1))lic , sum(if(accept_time is null,0,1))acc,
|
|
|
|
|
+ sum(if(status=2 ,1,0))bhc from task_progress where task_id= #{tid} GROUP by task_id )b
|
|
|
|
|
+ </if>
|
|
|
|
|
+ on a.tid =b.tid
|
|
|
|
|
+ where a.tid= #{tid}
|
|
|
</select>
|
|
</select>
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
</mapper>
|
|
</mapper>
|