|
|
@@ -17,11 +17,13 @@
|
|
|
<result column="ma_whid" property="ma_whid" jdbcType="INTEGER" />
|
|
|
<result column="ma_whcode" property="ma_whcode" jdbcType="VARCHAR" />
|
|
|
<result column="ma_whname" property="ma_whname" jdbcType="VARCHAR" />
|
|
|
- <result column="ma_recorddate" property="ma_recorddate" jdbcType="TIMESTAMP" />
|
|
|
+ <result column="ma_recorddate" property="createTime" jdbcType="TIMESTAMP" />
|
|
|
<result column="ma_recordid" property="ma_recordid" jdbcType="INTEGER" />
|
|
|
<result column="ma_recorder" property="ma_recorder" jdbcType="VARCHAR" />
|
|
|
<result column="ma_price" property="ma_price" jdbcType="DOUBLE" />
|
|
|
<result column="ma_total" property="ma_total" jdbcType="DOUBLE" />
|
|
|
+ <result column="ma_auditman" property="ma_auditman" jdbcType="DOUBLE" />
|
|
|
+ <result column="ma_auditdate" property="ma_auditdate" jdbcType="DOUBLE" />
|
|
|
<result column="companyId" property="companyId" jdbcType="INTEGER" />
|
|
|
<result column="updaterId" property="updaterId" jdbcType="INTEGER" />
|
|
|
<result column="updateTime" property="updateTime" jdbcType="TIMESTAMP" />
|
|
|
@@ -34,7 +36,7 @@
|
|
|
<sql id="Base_Column_List" >
|
|
|
ma_id, ma_code, ma_status, ma_statuscode, ma_type, ma_prodid, ma_prodcode, ma_proddetail,
|
|
|
ma_prodspec, ma_version, ma_produnit, ma_qty, ma_whid, ma_whcode, ma_whname, ma_recorddate,
|
|
|
- ma_recordid, ma_recorder, ma_price, ma_total, companyId, updaterId, updateTime, ma_text1,
|
|
|
+ ma_recordid, ma_recorder, ma_price, ma_total,ma_auditman,ma_auditdate, companyId, updaterId, updateTime, ma_text1,
|
|
|
ma_text2, ma_text3, ma_text4, ma_text5
|
|
|
</sql>
|
|
|
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
|
|
|
@@ -57,7 +59,7 @@
|
|
|
ma_version, ma_produnit, ma_qty,
|
|
|
ma_whid, ma_whcode, ma_whname, ma_recorddate,
|
|
|
ma_recordid, ma_recorder, ma_price,
|
|
|
- ma_total, companyId, updaterId,
|
|
|
+ ma_total, ma_auditman,ma_auditdate,companyId, updaterId,
|
|
|
updateTime, ma_text1, ma_text2,
|
|
|
ma_text3, ma_text4, ma_text5
|
|
|
)
|
|
|
@@ -67,7 +69,7 @@
|
|
|
#{ma_version,jdbcType=VARCHAR}, #{ma_produnit,jdbcType=VARCHAR}, #{ma_qty,jdbcType=DOUBLE},
|
|
|
#{ma_whid,jdbcType=INTEGER}, #{ma_whcode,jdbcType=VARCHAR}, #{ma_whname,jdbcType=VARCHAR}, #{ma_recorddate,jdbcType=TIMESTAMP},
|
|
|
#{ma_recordid,jdbcType=INTEGER}, #{ma_recorder,jdbcType=VARCHAR}, #{ma_price,jdbcType=DOUBLE},
|
|
|
- #{ma_total,jdbcType=DOUBLE}, #{companyId,jdbcType=INTEGER}, #{updaterId,jdbcType=INTEGER},
|
|
|
+ #{ma_total,jdbcType=DOUBLE}, #{ma_auditman,jdbcType=VARCHAR},#{ma_auditdate.jdbcType=TIMESTAMP},#{companyId,jdbcType=INTEGER}, #{updaterId,jdbcType=INTEGER},
|
|
|
#{updateTime,jdbcType=TIMESTAMP}, #{ma_text1,jdbcType=VARCHAR}, #{ma_text2,jdbcType=VARCHAR},
|
|
|
#{ma_text3,jdbcType=VARCHAR}, #{ma_text4,jdbcType=VARCHAR}, #{ma_text5,jdbcType=VARCHAR}
|
|
|
)
|
|
|
@@ -120,7 +122,7 @@
|
|
|
<if test="ma_whname != null" >
|
|
|
ma_whname,
|
|
|
</if>
|
|
|
- <if test="ma_recorddate != null" >
|
|
|
+ <if test="createTime != null" >
|
|
|
ma_recorddate,
|
|
|
</if>
|
|
|
<if test="ma_recordid != null" >
|
|
|
@@ -135,6 +137,12 @@
|
|
|
<if test="ma_total != null" >
|
|
|
ma_total,
|
|
|
</if>
|
|
|
+ <if test="ma_auditman !=null">
|
|
|
+ ma_auditman,
|
|
|
+ </if>
|
|
|
+ <if test="ma_auditdate !=null">
|
|
|
+ ma_auditdate,
|
|
|
+ </if>
|
|
|
<if test="companyId != null" >
|
|
|
companyId,
|
|
|
</if>
|
|
|
@@ -218,6 +226,16 @@
|
|
|
<if test="ma_total != null" >
|
|
|
#{ma_total,jdbcType=DOUBLE},
|
|
|
</if>
|
|
|
+ <if test="ma_auditman !=null">
|
|
|
+ #{ma_auditman,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="ma_auditdate !=null">
|
|
|
+ #{ma_auditdate,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
<if test="companyId != null" >
|
|
|
#{companyId,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
@@ -304,6 +322,15 @@
|
|
|
<if test="ma_total != null" >
|
|
|
ma_total = #{ma_total,jdbcType=DOUBLE},
|
|
|
</if>
|
|
|
+ <if test="ma_auditman !=null">
|
|
|
+ ma_auditman = #{ma_auditman,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="ma_auditdate !=null">
|
|
|
+ ma_auditdate = #{ma_auditdate,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
<if test="companyId != null" >
|
|
|
companyId = #{companyId,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
@@ -352,6 +379,9 @@
|
|
|
ma_recorder = #{ma_recorder,jdbcType=VARCHAR},
|
|
|
ma_price = #{ma_price,jdbcType=DOUBLE},
|
|
|
ma_total = #{ma_total,jdbcType=DOUBLE},
|
|
|
+ ma_auditman = #{ma_auditman,jdbcType=VARCHAR},
|
|
|
+ ma_auditdate = #{ma_auditdate,jdbcType=TIMESTAMP},
|
|
|
+
|
|
|
companyId = #{companyId,jdbcType=INTEGER},
|
|
|
updaterId = #{updaterId,jdbcType=INTEGER},
|
|
|
updateTime = #{updateTime,jdbcType=TIMESTAMP},
|
|
|
@@ -370,7 +400,7 @@
|
|
|
</if>
|
|
|
AND MAKE.COMPANYID = #{companyId}
|
|
|
</where>
|
|
|
- order by MA_ID
|
|
|
+ order by MA_ID desc
|
|
|
</select>
|
|
|
<select id="validateCodeWhenInsert" resultType="int">
|
|
|
select count(*) from MAKE where MA_CODE = #{code} and companyId =#{companyId}
|
|
|
@@ -386,4 +416,13 @@
|
|
|
<select id="selectMakeInOutCode" resultType="string">
|
|
|
SELECT PI_INOUTNO FROM PRODINOUT WHERE COMPANYID=#{companyId} AND PI_TEXT1=#{code} AND PI_CLASS=#{type}
|
|
|
</select>
|
|
|
+
|
|
|
+ <update id="calcMakePriceAndTotal" parameterType="long" >
|
|
|
+ update makematerial set mm_price = (select pw_avprice from productwh where pw_prodid = mm_prodid and pw_whid = mm_whid) where mm_maid = #{id};
|
|
|
+ update makematerial set mm_amount = round(mm_price*mm_qty,2) where mm_maid = #{id};
|
|
|
+ update make set ma_total = round((select sum(mm_amount) from makematerial where mm_maid = #{id} ),2) where ma_id = #{id};
|
|
|
+ update make set ma_price = ma_total/ma_qty where ma_id = #{id};
|
|
|
+ </update>
|
|
|
+
|
|
|
+
|
|
|
</mapper>
|