|
@@ -9,9 +9,10 @@
|
|
|
<result property="workId" column="work_id" />
|
|
|
<result property="type" column="type_" />
|
|
|
<result property="planNumber" column="plan_number" />
|
|
|
- <result property="summary" column="summary_" />
|
|
|
- <result property="amount" column="amount_" />
|
|
|
- <result property="balance" column="balance_" />
|
|
|
+ <result property="actualAmount" column="actual_amount" />
|
|
|
+ <result property="clothAmount" column="cloth_amount" />
|
|
|
+ <result property="rollAmount" column="roll_amount" />
|
|
|
+ <result property="totalAmount" column="total_amount" />
|
|
|
<result property="delFlag" column="del_flag" />
|
|
|
<result property="createBy" column="create_by" />
|
|
|
<result property="createTime" column="create_time" />
|
|
@@ -26,7 +27,7 @@
|
|
|
-->
|
|
|
<![CDATA[
|
|
|
insert into base_account
|
|
|
- (id_,customer_id,work_id,type_,plan_number,summary_,amount_,balance_,del_flag,create_by,create_time,update_by,update_time)
|
|
|
+ (id_,customer_id,work_id,type_,plan_number,actual_amount,cloth_amount,roll_amount,total_amount,del_flag,create_by,create_time,update_by,update_time)
|
|
|
values
|
|
|
(
|
|
|
#{id,jdbcType=VARCHAR}
|
|
@@ -34,9 +35,10 @@
|
|
|
,#{workId,jdbcType=VARCHAR}
|
|
|
,#{type,jdbcType= NUMERIC }
|
|
|
,#{planNumber,jdbcType=VARCHAR}
|
|
|
-,#{summary,jdbcType=VARCHAR}
|
|
|
-,#{amount,jdbcType= NUMERIC }
|
|
|
-,#{balance,jdbcType= NUMERIC }
|
|
|
+,#{actualAmount,jdbcType= NUMERIC }
|
|
|
+,#{clothAmount,jdbcType= NUMERIC }
|
|
|
+,#{rollAmount,jdbcType= NUMERIC }
|
|
|
+,#{totalAmount,jdbcType= NUMERIC }
|
|
|
,#{delFlag,jdbcType= NUMERIC }
|
|
|
,#{createBy,jdbcType=VARCHAR}
|
|
|
,#{createTime,jdbcType= TIMESTAMP }
|
|
@@ -63,14 +65,17 @@
|
|
|
<if test="planNumber!=null">
|
|
|
plan_number=#{planNumber,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
- <if test="summary!=null">
|
|
|
- summary_=#{summary,jdbcType=VARCHAR},
|
|
|
+ <if test="actualAmount!=null">
|
|
|
+ actual_amount=#{actualAmount,jdbcType= NUMERIC },
|
|
|
</if>
|
|
|
- <if test="amount!=null">
|
|
|
- amount_=#{amount,jdbcType= NUMERIC },
|
|
|
+ <if test="clothAmount!=null">
|
|
|
+ cloth_amount=#{clothAmount,jdbcType= NUMERIC },
|
|
|
</if>
|
|
|
- <if test="balance!=null">
|
|
|
- balance_=#{balance,jdbcType= NUMERIC },
|
|
|
+ <if test="rollAmount!=null">
|
|
|
+ roll_amount=#{rollAmount,jdbcType= NUMERIC },
|
|
|
+ </if>
|
|
|
+ <if test="totalAmount!=null">
|
|
|
+ total_amount=#{totalAmount,jdbcType= NUMERIC },
|
|
|
</if>
|
|
|
<if test="delFlag!=null">
|
|
|
del_flag=#{delFlag,jdbcType= NUMERIC },
|
|
@@ -92,7 +97,7 @@
|
|
|
</update>
|
|
|
<select id="get" parameterType="string" resultMap="AccountMap">
|
|
|
select
|
|
|
-id_,customer_id,work_id,type_,plan_number,summary_,amount_,balance_,del_flag,create_by,create_time,update_by,update_time from base_account where id_=#{0}
|
|
|
+id_,customer_id,work_id,type_,plan_number,actual_amount,cloth_amount,roll_amount,total_amount,del_flag,create_by,create_time,update_by,update_time from base_account where id_=#{0}
|
|
|
</select>
|
|
|
<select id="exist" parameterType="string" resultType="int">
|
|
|
select count(*) from base_account where id_=#{0}
|
|
@@ -113,4 +118,16 @@ id_,customer_id,work_id,type_,plan_number,summary_,amount_,balance_,del_flag,cre
|
|
|
${sort.name} ${sort.order}
|
|
|
</foreach>
|
|
|
</select>
|
|
|
+ <select id="getBalance" parameterType="string" resultType="int">
|
|
|
+ <![CDATA[
|
|
|
+ SELECT SUM(amount_) FROM base_account
|
|
|
+ WHERE del_flag = 0
|
|
|
+ AND customer_id = #{customerId}
|
|
|
+ AND create_time <= CONCAT(#{deadline},' 23:59:59')
|
|
|
+ ]]>
|
|
|
+ </select>
|
|
|
+ <select id="getByWorkId" parameterType="string" resultMap="AccountMap">
|
|
|
+ select * from base_account
|
|
|
+ where work_id = #{0}
|
|
|
+ </select>
|
|
|
</mapper>
|