|
@@ -9,7 +9,9 @@
|
|
|
<resultMap type="com.ym.mec.biz.dal.entity.SubjectGoodsMapper" id="SubjectGoodsMapper">
|
|
|
<result column="id_" property="id"/>
|
|
|
<result column="subject_id_" property="subjectId"/>
|
|
|
+ <result column="type_" property="type" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
|
|
|
<result column="goods_category_id_" property="goodsCategoryId"/>
|
|
|
+ <result column="goods_id_list_" property="goodsIdList"/>
|
|
|
<result column="create_time_" property="createTime"/>
|
|
|
<result column="update_time_" property="updateTime"/>
|
|
|
</resultMap>
|
|
@@ -27,9 +29,10 @@
|
|
|
<!-- 向数据库增加一条记录 -->
|
|
|
<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.SubjectGoodsMapper" useGeneratedKeys="true"
|
|
|
keyColumn="id" keyProperty="id">
|
|
|
- INSERT INTO subject_goods_mapper (subject_id_,goods_category_id_,create_time_,update_time_)
|
|
|
- VALUES(#{subjectId},#{goodsCategoryId},now(),now())
|
|
|
+ INSERT INTO subject_goods_mapper (subject_id_,goods_category_id_,create_time_,update_time_,type_,goods_id_list_)
|
|
|
+ VALUES(#{subjectId},#{goodsCategoryId},now(),now(),#{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{goodsIdList})
|
|
|
</insert>
|
|
|
+
|
|
|
<insert id="batchAdd">
|
|
|
INSERT INTO subject_goods_mapper (subject_id_,goods_category_id_,create_time_,update_time_)
|
|
|
VALUES
|
|
@@ -51,6 +54,12 @@
|
|
|
<if test="goodsCategoryId != null">
|
|
|
goods_category_id_ = #{goodsCategoryId},
|
|
|
</if>
|
|
|
+ <if test="type != null">
|
|
|
+ type_ = #{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
+ </if>
|
|
|
+ <if test="goodsIdList != null">
|
|
|
+ goods_id_list_ = #{goodsIdList},
|
|
|
+ </if>
|
|
|
</set>
|
|
|
WHERE id_ = #{id}
|
|
|
</update>
|