|
@@ -39,9 +39,55 @@
|
|
|
<if test="productLevelId != 0">
|
|
|
and productLevelId = #{productLevelId}
|
|
|
</if>
|
|
|
+ and deleteState != 1
|
|
|
</where>
|
|
|
</select>
|
|
|
|
|
|
+ <select id="getTotalCount" parameterType="com.bosshand.virgo.api.workark.model.Product" resultType="Integer">
|
|
|
+ SELECT count(*) FROM workark_product
|
|
|
+ <where>
|
|
|
+ <if test="organizationId != 0">
|
|
|
+ and organizationId = #{organizationId}
|
|
|
+ </if>
|
|
|
+ <if test="name != null">
|
|
|
+ and name = #{name}
|
|
|
+ </if>
|
|
|
+ <if test="state != null">
|
|
|
+ and state = #{state}
|
|
|
+ </if>
|
|
|
+ <if test="type != null">
|
|
|
+ and type = #{type}
|
|
|
+ </if>
|
|
|
+ <if test="productLevelId != 0">
|
|
|
+ and productLevelId = #{productLevelId}
|
|
|
+ </if>
|
|
|
+ and deleteState != 1
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getLimit" resultMap="result">
|
|
|
+ select * from workark_product
|
|
|
+ <where>
|
|
|
+ <if test="p.organizationId != 0">
|
|
|
+ and organizationId = #{p.organizationId}
|
|
|
+ </if>
|
|
|
+ <if test="p.name != null">
|
|
|
+ and name = #{p.name}
|
|
|
+ </if>
|
|
|
+ <if test="p.state != null">
|
|
|
+ and state = #{p.state}
|
|
|
+ </if>
|
|
|
+ <if test="p.type != null">
|
|
|
+ and type = #{p.type}
|
|
|
+ </if>
|
|
|
+ <if test="p.productLevelId != 0">
|
|
|
+ and productLevelId = #{p.productLevelId}
|
|
|
+ </if>
|
|
|
+ and deleteState != 1
|
|
|
+ </where>
|
|
|
+ order by createTime desc limit #{currIndex} , #{pageSize}
|
|
|
+ </select>
|
|
|
+
|
|
|
<insert id="save" useGeneratedKeys="true" keyProperty="id">
|
|
|
INSERT INTO workark_product (organizationId, type, productLevelId, createTime, name, price, intro) VALUES (#{organizationId}, #{type}, #{productLevelId}, now(), #{name}, #{price}, #{intro})
|
|
|
</insert>
|
|
@@ -62,7 +108,7 @@
|
|
|
</update>
|
|
|
|
|
|
<delete id="delete">
|
|
|
- DELETE FROM workark_product WHERE id = #{id}
|
|
|
+ UPDATE workark_product SET deleteState = 1 WHERE id=#{id}
|
|
|
</delete>
|
|
|
|
|
|
</mapper>
|