|
@@ -0,0 +1,80 @@
|
|
|
+<?xml version="1.0" encoding="UTF-8" ?>
|
|
|
+<!DOCTYPE mapper
|
|
|
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
+<mapper namespace="com.miaxis.app.coach.mapper.CoachEvaluateMapper">
|
|
|
+
|
|
|
+ <resultMap type="CoachEvaluate" id="CoachEvaluateResult">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="userId" column="user_id" />
|
|
|
+ <result property="coachnum" column="coachnum" />
|
|
|
+ <result property="star" column="star" />
|
|
|
+ <result property="content" column="content" />
|
|
|
+ <result property="labelIds" column="label_ids" />
|
|
|
+ <result property="imagesId" column="images_id" />
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
+ <result property="updateTime" column="update_time" />
|
|
|
+ <result property="status" column="status" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectCoachEvaluateVo">
|
|
|
+ select id, user_id, coachnum, star, content, label_ids, images_id, create_time, update_time, status from coach_evaluate
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectCoachEvaluateList" parameterType="CoachEvaluate" resultMap="CoachEvaluateResult">
|
|
|
+ <include refid="selectCoachEvaluateVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="userId != null "> and user_id = #{userId}</if>
|
|
|
+ <if test="coachnum != null and coachnum != ''"> and coachnum = #{coachnum}</if>
|
|
|
+ <if test="star != null "> and star = #{star}</if>
|
|
|
+ <if test="content != null and content != ''"> and content = #{content}</if>
|
|
|
+ <if test="labelIds != null and labelIds != ''"> and label_ids = #{labelIds}</if>
|
|
|
+ <if test="imagesId != null and imagesId != ''"> and images_id = #{imagesId}</if>
|
|
|
+ <if test="status != null "> and status = #{status}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertCoachEvaluate" parameterType="CoachEvaluate" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ insert into coach_evaluate
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="userId != null">user_id,</if>
|
|
|
+ <if test="coachnum != null">coachnum,</if>
|
|
|
+ <if test="star != null">star,</if>
|
|
|
+ <if test="content != null">content,</if>
|
|
|
+ <if test="labelIds != null">label_ids,</if>
|
|
|
+ <if test="imagesId != null">images_id,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
+ <if test="status != null">status,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="userId != null">#{userId},</if>
|
|
|
+ <if test="coachnum != null">#{coachnum},</if>
|
|
|
+ <if test="star != null">#{star},</if>
|
|
|
+ <if test="content != null">#{content},</if>
|
|
|
+ <if test="labelIds != null">#{labelIds},</if>
|
|
|
+ <if test="imagesId != null">#{imagesId},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
+ <if test="status != null">#{status},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateCoachEvaluate" parameterType="CoachEvaluate">
|
|
|
+ update coach_evaluate
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="userId != null">user_id = #{userId},</if>
|
|
|
+ <if test="coachnum != null">coachnum = #{coachnum},</if>
|
|
|
+ <if test="star != null">star = #{star},</if>
|
|
|
+ <if test="content != null">content = #{content},</if>
|
|
|
+ <if test="labelIds != null">label_ids = #{labelIds},</if>
|
|
|
+ <if test="imagesId != null">images_id = #{imagesId},</if>
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
+ <if test="status != null">status = #{status},</if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+
|
|
|
+</mapper>
|