http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
productInBoundId, productInBoundCode, factoryCode, factoryName, customerCode, customerName,
storageAreaId, documentDate, originDocCode, referenceCode, orderTotal,
status, createUserId, updateUserId, createDate, updateDate, version
insert into PM_ProductInBound (productInBoundId, productInBoundCode,
factoryCode, factoryName, customerCode,
customerName, storageAreaId, documentDate,
originDocCode, referenceCode, orderTotal, status,
createUserId, updateUserId, createDate,
updateDate, postDate, version)
values (#{productInBoundId,jdbcType=VARCHAR}, #{productInBoundCode,jdbcType=VARCHAR},
#{factoryCode,jdbcType=VARCHAR}, #{factoryName,jdbcType=VARCHAR}, #{customerCode,jdbcType=VARCHAR},
#{customerName,jdbcType=VARCHAR}, #{storageAreaId}, #{documentDate,jdbcType=TIMESTAMP}, #{originDocCode,jdbcType=VARCHAR},
#{referenceCode,jdbcType=VARCHAR}, #{orderTotal,jdbcType=DECIMAL}, #{status,jdbcType=INTEGER},
#{createUserId,jdbcType=VARCHAR}, #{updateUserId,jdbcType=VARCHAR}, #{createDate,jdbcType=TIMESTAMP},
#{updateDate,jdbcType=TIMESTAMP}, #{postDate}, #{version,jdbcType=INTEGER})
update PM_ProductInBound
productInBoundCode = #{productInBoundCode,jdbcType=VARCHAR},
factoryCode = #{factoryCode,jdbcType=VARCHAR},
factoryName = #{factoryName,jdbcType=VARCHAR},
where productInBoundId = #{productInBoundId,jdbcType=VARCHAR}
update PM_ProductInBound
status = #{status},
updateUserId = #{updateUserId},
updateDate = #{updateDate},
version = #{version} + 1
where productInBoundId = #{productInBoundId}
and version = #{version}
and pro.productInBoundCode LIKE #{productInBoundCodeCon}
<if test="referenceCode != null and referenceCode !=''">
<bind name="referenceCodeCon" value="'%' + referenceCode + '%'" />
and pro.referenceCode LIKE #{referenceCodeCon}
</if>
<if test="storageAreaIds != null and storageAreaIds.size > 0">
AND pro.storageAreaId IN
<foreach collection="storageAreaIds" item="storageAreaId" index="index" open="(" separator="," close=")">
#{storageAreaId}
</foreach>
</if>
<if test="startDate != null and startDate !=''">
<![CDATA[AND pro.documentDate >= #{startDate}]]>
</if>
<if test="endDate != null and endDate !=''">
<![CDATA[AND pro.documentDate <= #{endDate}]]>
</if>
来源: http://www.bubuko.com/infodetail-2485798.html