| | |
| | | |
| | | <resultMap type="ProjectExpertDetail" id="ProjectExpertDetailResult"> |
| | | <result property="id" column="id" /> |
| | | <result property="projectExpert" column="project_expert" /> |
| | | <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" /> |
| | |
| | | </resultMap> |
| | | |
| | | <sql id="selectProjectExpertDetailVo"> |
| | | select id, project_expert, content, score, del_flag, create_by, create_time, update_by, update_time from project_expert_detail |
| | | 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> |
| | | <if test="projectExpert != null "> and project_expert = #{projectExpert}</if> |
| | | <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"> |
| | |
| | | <insert id="insertProjectExpertDetail" parameterType="ProjectExpertDetail" useGeneratedKeys="true" keyProperty="id"> |
| | | insert into project_expert_detail |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="projectExpert != null">project_expert,</if> |
| | | <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="updateTime != null">update_time,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="projectExpert != null">#{projectExpert},</if> |
| | | <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> |
| | |
| | | </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="projectExpert != null">project_expert = #{projectExpert},</if> |
| | | <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> |
| | |
| | | where id = #{id} |
| | | </update> |
| | | |
| | | <delete id="deleteProjectExpertDetailById" parameterType="Long"> |
| | | delete from project_expert_detail where id = #{id} |
| | | </delete> |
| | | <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> |
| | | |
| | | <delete id="deleteProjectExpertDetailByIds" parameterType="String"> |
| | | delete from project_expert_detail where id in |
| | | <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> |
| | | </delete> |
| | | </update> |
| | | </mapper> |