|
@@ -6,6 +6,7 @@
|
|
|
|
|
|
<resultMap type="com.bosshand.virgo.api.workark.model.Product" id="result">
|
|
|
<id column="id" property="id"/>
|
|
|
+ <result column="organizationId" property="organizationId"/>
|
|
|
<result column="state" property="state"/>
|
|
|
<result column="type" property="type"/>
|
|
|
<result column="productLevelId" property="productLevelId"/>
|
|
@@ -23,6 +24,9 @@
|
|
|
<select id="getList" resultMap="result">
|
|
|
select * from workark_product
|
|
|
<where>
|
|
|
+ <if test="organizationId != 0">
|
|
|
+ and organizationId = #{organizationId}
|
|
|
+ </if>
|
|
|
<if test="name != null">
|
|
|
and name = #{name}
|
|
|
</if>
|
|
@@ -39,12 +43,13 @@
|
|
|
</select>
|
|
|
|
|
|
<insert id="save" useGeneratedKeys="true" keyProperty="id">
|
|
|
- INSERT INTO workark_product (type, productLevelId, createTime, name, price, intro) VALUES (#{type}, #{productLevelId}, now(), #{name}, #{price}, #{intro})
|
|
|
+ INSERT INTO workark_product (organizationId, type, productLevelId, createTime, name, price, intro) VALUES (#{organizationId}, #{type}, #{productLevelId}, now(), #{name}, #{price}, #{intro})
|
|
|
</insert>
|
|
|
|
|
|
<update id="update" parameterType="com.bosshand.virgo.api.workark.model.Product">
|
|
|
UPDATE workark_product
|
|
|
<trim prefix="set" suffixOverrides=",">
|
|
|
+ <if test="organizationId!=0">organizationId=#{organizationId},</if>
|
|
|
<if test="type!=null">type=#{type},</if>
|
|
|
<if test="productLevelId!=0">productLevelId=#{productLevelId},</if>
|
|
|
<if test="name!=null">name=#{name},</if>
|