<?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.gkhy.system.mapper.ProjectExpertDetailMapper">
|
|
<resultMap type="ProjectExpertDetail" id="ProjectExpertDetailResult">
|
<result property="id" column="id" />
|
<result property="projectExpertId" column="project_expert_id" />
|
<result property="content" column="content" />
|
<result property="score" column="score" />
|
<result property="scoreType" column="score_type" />
|
<result property="delFlag" column="del_flag" />
|
<result property="createBy" column="create_by" />
|
<result property="createTime" column="create_time" />
|
<result property="updateBy" column="update_by" />
|
<result property="updateTime" column="update_time" />
|
</resultMap>
|
|
<sql id="selectProjectExpertDetailVo">
|
select id, project_expert_id, content, score, del_flag,score_type, create_by, create_time, update_by, update_time from project_expert_detail
|
</sql>
|
|
<select id="selectProjectExpertDetailList" parameterType="ProjectExpertDetail" resultMap="ProjectExpertDetailResult">
|
<include refid="selectProjectExpertDetailVo"/>
|
<where>
|
and del_flag = 0
|
<if test="projectExpertId != null "> and project_expert_id = #{projectExpertId}</if>
|
<if test="content != null and content != ''"> and content = #{content}</if>
|
<if test="score != null "> and score = #{score}</if>
|
</where>
|
order by create_time desc
|
</select>
|
|
<select id="selectProjectExpertDetailById" parameterType="Long" resultMap="ProjectExpertDetailResult">
|
<include refid="selectProjectExpertDetailVo"/>
|
where id = #{id}
|
</select>
|
|
<insert id="insertProjectExpertDetail" parameterType="ProjectExpertDetail" useGeneratedKeys="true" keyProperty="id">
|
insert into project_expert_detail
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="projectExpertId != null">project_expert_id,</if>
|
<if test="content != null and content != ''">content,</if>
|
<if test="score != null">score,</if>
|
<if test="scoreType != null and scoreType != ''">score_type,</if>
|
<if test="delFlag != null">del_flag,</if>
|
<if test="createBy != null">create_by,</if>
|
<if test="createTime != null">create_time,</if>
|
<if test="updateBy != null">update_by,</if>
|
<if test="updateTime != null">update_time,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="projectExpertId != null">#{projectExpertId},</if>
|
<if test="content != null and content != ''">#{content},</if>
|
<if test="score != null">#{score},</if>
|
<if test="scoreType != null and scoreType != ''">#{scoreType},</if>
|
<if test="delFlag != null">#{delFlag},</if>
|
<if test="createBy != null">#{createBy},</if>
|
<if test="createTime != null">#{createTime},</if>
|
<if test="updateBy != null">#{updateBy},</if>
|
<if test="updateTime != null">#{updateTime},</if>
|
</trim>
|
</insert>
|
|
<insert id="batchInsertProjectExpertDetail" parameterType="java.util.List" >
|
insert into project_expert_detail
|
( project_expert_id, content, score, score_type, create_by)
|
values
|
<foreach collection="list" item="item" separator=",">
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="item.projectExpertId != null">#{item.projectExpertId},</if>
|
<if test="item.content != null and item.content != ''">#{item.content},</if>
|
<if test="item.score != null">#{item.score},</if>
|
<if test="item.scoreType != null and item.scoreType != ''">#{item.scoreType},</if>
|
<if test="item.createBy != null">#{item.createBy},</if>
|
</trim>
|
</foreach>
|
</insert>
|
|
|
|
<update id="updateProjectExpertDetail" parameterType="ProjectExpertDetail">
|
update project_expert_detail
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="projectExpertId != null">project_expert_id = #{projectExpertId},</if>
|
<if test="content != null and content != ''">content = #{content},</if>
|
<if test="score != null">score = #{score},</if>
|
<if test="scoreType != null and scoreType != ''">score_type = #{scoreType},</if>
|
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
<if test="createBy != null">create_by = #{createBy},</if>
|
<if test="createTime != null">create_time = #{createTime},</if>
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
</trim>
|
where id = #{id}
|
</update>
|
|
<update id="batchUpdateProjectExpertDetail" parameterType="java.util.List">
|
<foreach collection="list" item="item" separator=";">
|
update project_expert_detail
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="item.projectExpertId != null">project_expert_id = #{item.projectExpertId},</if>
|
<if test="item.content != null and item.content != ''">content = #{item.content},</if>
|
<if test="item.score != null">score = #{item.score},</if>
|
<if test="item.scoreType != null and item.scoreType != ''">score_type = #{item.scoreType},</if>
|
<if test="item.delFlag != null">del_flag = #{item.delFlag},</if>
|
<if test="item.createBy != null">create_by = #{item.createBy},</if>
|
<if test="item.createTime != null">create_time = #{item.createTime},</if>
|
<if test="item.updateBy != null">update_by = #{item.updateBy},</if>
|
<if test="item.updateTime != null">update_time = #{item.updateTime},</if>
|
</trim>
|
where id = #{item.id}
|
</foreach>
|
</update>
|
|
<update id="deleteProjectExpertDetailById" parameterType="Long">
|
update project_expert_detail set del_flag = 1 where id = #{id}
|
</update>
|
|
<update id="deleteProjectExpertDetailByIds" parameterType="String">
|
update project_expert_detail set del_flag = 1 where id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</update>
|
</mapper>
|