|
@@ -31,7 +31,7 @@
|
|
|
SELECT <include refid="columns_alias"/> FROM FOLD_THE_VALUES t
|
|
|
</sql>
|
|
|
<sql id="where">
|
|
|
- <where>
|
|
|
+ <where>
|
|
|
<if test="id != null and id != ''">
|
|
|
and ID = #{id}
|
|
|
</if>
|
|
@@ -65,7 +65,7 @@
|
|
|
</where>
|
|
|
</sql>
|
|
|
<sql id="whereLike">
|
|
|
- <where>
|
|
|
+ <where>
|
|
|
<if test="id != null and id != ''">
|
|
|
and ID LIKE '%${id}%'
|
|
|
</if>
|
|
@@ -104,7 +104,7 @@
|
|
|
</delete>
|
|
|
<delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
|
|
|
delete from FOLD_THE_VALUES
|
|
|
- where 1!=1
|
|
|
+ where 1!=1
|
|
|
<if test="materialsource != null and materialsource != ''">
|
|
|
or MATERIALSOURCE = #{materialsource}
|
|
|
</if>
|
|
@@ -135,11 +135,11 @@
|
|
|
</delete>
|
|
|
<insert id="insert" parameterType="com.steerinfo.ems.foldthevalues.model.FoldTheValues">
|
|
|
insert into FOLD_THE_VALUES (ID, MATERIALSOURCE, CLOCK,
|
|
|
- CODE, DESCRIPTION, ISAVAILABLE,
|
|
|
+ CODE, DESCRIPTION, ISAVAILABLE,
|
|
|
REVISOR, REVISETIME,MATERIALNO,
|
|
|
UNITID, BZ,TIMEGRANID,ESTIMATEDVALUE)
|
|
|
- values (#{id,jdbcType=VARCHAR}, #{materialsource,jdbcType=VARCHAR}, #{clock,jdbcType=VARCHAR},
|
|
|
- #{code,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, #{isavailable,jdbcType=VARCHAR},
|
|
|
+ values (#{id,jdbcType=VARCHAR}, #{materialsource,jdbcType=VARCHAR}, #{clock,jdbcType=VARCHAR},
|
|
|
+ #{code,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, #{isavailable,jdbcType=VARCHAR},
|
|
|
#{revisor,jdbcType=VARCHAR}, #{revisetime,jdbcType=VARCHAR},#{materialno,jdbcType=VARCHAR},
|
|
|
#{unitid,jdbcType=VARCHAR}, #{bz,jdbcType=VARCHAR},#{timegranid,jdbcType=VARCHAR},#{estimatedvalue,jdbcType=VARCHAR})
|
|
|
</insert>
|
|
@@ -271,19 +271,19 @@
|
|
|
<include refid="whereLike"/>
|
|
|
</select>
|
|
|
<insert id="batchInsert" parameterType="java.util.List">
|
|
|
- insert into FOLD_THE_VALUES
|
|
|
- (ID,
|
|
|
- MATERIALSOURCE, CLOCK, CODE,
|
|
|
- DESCRIPTION, ISAVAILABLE, REVISOR,
|
|
|
+ insert into FOLD_THE_VALUES
|
|
|
+ (ID,
|
|
|
+ MATERIALSOURCE, CLOCK, CODE,
|
|
|
+ DESCRIPTION, ISAVAILABLE, REVISOR,
|
|
|
REVISETIME, UNITID,
|
|
|
BZ)
|
|
|
- ( <foreach collection="list" item="item" separator="union all">
|
|
|
- select
|
|
|
- #{item.id,jdbcType=VARCHAR},
|
|
|
- #{item.materialsource,jdbcType=VARCHAR}, #{item.clock,jdbcType=VARCHAR}, #{item.code,jdbcType=VARCHAR},
|
|
|
- #{item.description,jdbcType=VARCHAR}, #{item.isavailable,jdbcType=VARCHAR}, #{item.revisor,jdbcType=VARCHAR},
|
|
|
+ ( <foreach collection="list" item="item" separator="union all">
|
|
|
+ select
|
|
|
+ #{item.id,jdbcType=VARCHAR},
|
|
|
+ #{item.materialsource,jdbcType=VARCHAR}, #{item.clock,jdbcType=VARCHAR}, #{item.code,jdbcType=VARCHAR},
|
|
|
+ #{item.description,jdbcType=VARCHAR}, #{item.isavailable,jdbcType=VARCHAR}, #{item.revisor,jdbcType=VARCHAR},
|
|
|
#{item.revisetime,jdbcType=VARCHAR}, #{item.unitid,jdbcType=VARCHAR},
|
|
|
- #{item.bz,jdbcType=VARCHAR} from dual
|
|
|
+ #{item.bz,jdbcType=VARCHAR} from dual
|
|
|
</foreach> )
|
|
|
</insert>
|
|
|
<update id="batchUpdate" parameterType="java.util.List">
|
|
@@ -329,14 +329,14 @@
|
|
|
<foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
|
|
|
when #{item.id,jdbcType=VARCHAR} then #{item.bz,jdbcType=VARCHAR}
|
|
|
</foreach>
|
|
|
- where ID in
|
|
|
+ where ID in
|
|
|
<foreach collection="list" index="index" item="item" separator="," open="(" close=")">
|
|
|
#{item.id,jdbcType=VARCHAR}
|
|
|
- </foreach>
|
|
|
+ </foreach>
|
|
|
</update>
|
|
|
<delete id="batchDelete" parameterType="java.util.List">
|
|
|
delete from FOLD_THE_VALUES
|
|
|
- where ID in
|
|
|
+ where ID in
|
|
|
<foreach collection="list" item="id" open="(" close=")" separator=",">
|
|
|
#{id}
|
|
|
</foreach>
|
|
@@ -409,7 +409,9 @@
|
|
|
ISAVAILABLE = #{isavailable,jdbcType=VARCHAR},
|
|
|
UNITID = #{unitid,jdbcType=VARCHAR},
|
|
|
TIMEGRANID = #{timegranid,jdbcType=VARCHAR},
|
|
|
- MATERIALNO = #{materialno,jdbcType=VARCHAR}
|
|
|
+ MATERIALNO = #{materialno,jdbcType=VARCHAR},
|
|
|
+ ESTIMATEDVALUE = #{estimatedvalue,jdbcType=VARCHAR},
|
|
|
+ ID = #{id,jdbcType=VARCHAR}
|
|
|
<where>
|
|
|
<if test="clock != null and clock != ''">
|
|
|
and CLOCK = #{clock,jdbcType=VARCHAR}
|
|
@@ -496,4 +498,19 @@ select t2.*
|
|
|
</if>
|
|
|
</where>) t
|
|
|
</select>
|
|
|
-</mapper>
|
|
|
+
|
|
|
+ <update id="updateByClock" parameterType="com.steerinfo.ems.foldthevalues.model.FoldTheValues">
|
|
|
+ UPDATE FOLD_THE_VALUES
|
|
|
+ SET
|
|
|
+ CODE = #{code,jdbcType=VARCHAR},
|
|
|
+ ESTIMATEDVALUE = #{estimatedvalue,jdbcType=VARCHAR}
|
|
|
+ <where>
|
|
|
+ <if test="clock != null and clock != ''">
|
|
|
+ and CLOCK > #{clock,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="materialno != null and materialno != ''">
|
|
|
+ and MATERIALNO = #{materialno,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </update>
|
|
|
+</mapper>
|