|
@@ -0,0 +1,59 @@
|
|
|
+<!DOCTYPE mapper
|
|
|
+ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
+ "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
+
|
|
|
+<mapper namespace="com.bosshand.virgo.api.workark.dao.ProceModelDao">
|
|
|
+
|
|
|
+ <resultMap type="com.bosshand.virgo.api.workark.model.ProceModel" id="result" >
|
|
|
+ <id column="id" property="id"/>
|
|
|
+ <result column="name" property="name"/>
|
|
|
+ <result column="parentId" property="parentId"/>
|
|
|
+ <result column="productCouponModelId" property="productCouponModelId"/>
|
|
|
+ <result column="sequence" property="sequence"/>
|
|
|
+ <result column="attachment" property="attachment"/>
|
|
|
+ <result column="attachmentNumber" property="attachmentNumber"/>
|
|
|
+ <result column="roleId" property="roleId"/>
|
|
|
+ <result column="remark" property="remark"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <select id="get" resultMap="result">
|
|
|
+ select * from workark_proce_model where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getParentId" resultMap="result">
|
|
|
+ select * from workark_proce_model where parentId = #{parentId} order by sequence
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getList" resultMap="result">
|
|
|
+ select * from workark_proce_model where productCouponModelId = #{productCouponModelId} order by sequence
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getRoot" resultMap="result">
|
|
|
+ select * from workark_proce_model where parentId = -1 and productCouponModelId = #{productCouponModelId} order by sequence
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="save" parameterType="com.bosshand.virgo.api.workark.model.ProceModel" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ INSERT into workark_proce_model(name, parentId, productCouponModelId, sequence, attachment, attachmentNumber, roleId, remark)
|
|
|
+ values(#{name}, #{parentId}, #{productCouponModelId}, #{sequence}, #{attachment}, #{attachmentNumber}, #{roleId}, #{remark})
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="update" parameterType="com.bosshand.virgo.api.workark.model.ProceModel">
|
|
|
+ UPDATE workark_proce_model
|
|
|
+ <trim prefix="set" suffixOverrides=",">
|
|
|
+ <if test="name!=null">name=#{name},</if>
|
|
|
+ <if test="parentId!=0">parentId=#{parentId},</if>
|
|
|
+ <if test="productCouponModelId!=0">productCouponModelId=#{productCouponModelId},</if>
|
|
|
+ <if test="sequence!=0">sequence=#{sequence},</if>
|
|
|
+ <if test="attachment!=null">attachment=#{attachment},</if>
|
|
|
+ <if test="attachmentNumber!=null">attachmentNumber=#{attachmentNumber},</if>
|
|
|
+ <if test="roleId!=0">roleId=#{roleId},</if>
|
|
|
+ <if test="remark!=null">remark=#{remark},</if>
|
|
|
+ </trim>
|
|
|
+ WHERE id=#{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="delete">
|
|
|
+ DELETE FROM workark_proce_model where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+</mapper>
|