标签:1.0 getc lan public util factory close status data
<?xml version="1.0" encoding="UTF-8" ?><sql id="Base_Column_List" >
productInBoundId, productInBoundCode, factoryCode, factoryName, customerCode, customerName,
storageAreaId, documentDate, originDocCode, referenceCode, orderTotal,
status, createUserId, updateUserId, createDate, updateDate, version
</sql>
<insert id="insert" parameterType="cn.eeka.productwms.entity.biz.ProductInBound" >
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})
</insert>
<update id="updateByPrimaryKey" parameterType="cn.eeka.productwms.entity.biz.ProductInBound" >
update PM_ProductInBound
<set >
<if test="productInBoundCode != null" >
productInBoundCode = #{productInBoundCode,jdbcType=VARCHAR},
</if>
<if test="factoryCode != null" >
factoryCode = #{factoryCode,jdbcType=VARCHAR},
</if>
<if test="factoryName != null" >
factoryName = #{factoryName,jdbcType=VARCHAR},
</if>
</set>
where productInBoundId = #{productInBoundId,jdbcType=VARCHAR}
</update>
<update id="updateById" parameterType="java.util.HashMap">
update PM_ProductInBound
<set >
<if test="status != null" >
status = #{status},
</if>
<if test="updateUserId != null" >
updateUserId = #{updateUserId},
</if>
<if test="updateDate != null" >
updateDate = #{updateDate},
</if>
<if test="version != null" >
version = #{version} + 1
</if>
</set>
where productInBoundId = #{productInBoundId}
and version = #{version}
</update>
<select id="listByPagePC" parameterType="java.util.HashMap" resultMap="BaseResultMap" >
SELECT pro.* FROM PM_ProductInBound pro
<where>
<include refid="condition_where_clause" />
</where>
<!--这里是后台动态排序(排序的字段不固定)-->
<if test="orderByCondition != null and orderByCondition != ‘‘">
ORDER BY ${orderByCondition} DESC
</if>
<if test="offset != null">
limit #{offset},#{limit}
</if>
</select>
<select id="getCountByCondition" parameterType="java.util.HashMap" resultType="java.lang.Integer">
SELECT count(1) FROM PM_ProductInBound pro
<where>
<include refid="condition_where_clause" />
</where>
</select>
<sql id="condition_where_clause">
<if test="productInBoundCode != null and productInBoundCode != ‘‘">
<bind name="productInBoundCodeCon" value="‘%‘ + productInBoundCode + ‘%‘" />
and pro.productInBoundCode LIKE #{productInBoundCodeCon}
</if>
<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>
</sql>
</mapper>
标签:1.0 getc lan public util factory close status data
原文地址:http://blog.51cto.com/9381188/2068469