<?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.nbclass.szxgl.mapper.ProjectTaskJournalMapper">
  <resultMap id="BaseResultMap" type="com.nbclass.szxgl.model.ProjectTaskJournal">
    <!--
      WARNING - @mbg.generated
    -->
    <id column="id" jdbcType="CHAR" property="id" />
    <result column="_project_task_id" jdbcType="CHAR" property="projectTaskId" />
    <result column="_start_time" jdbcType="TIMESTAMP" property="startTime" />
    <result column="_end_time" jdbcType="TIMESTAMP" property="endTime" />
    <result column="_content" jdbcType="VARCHAR" property="content" />
    <result column="_journal" jdbcType="VARCHAR" property="journal" />
    <result column="_create_user_id" jdbcType="CHAR" property="createUserId" />
    <result column="_create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="_update_time" jdbcType="TIMESTAMP" property="updateTime" />
  </resultMap>
	
	<select id="getList" resultType="com.nbclass.szxgl.model.ProjectTaskJournal">
  		select j.*, sy_users.true_name as createUserName 
		from project_task_journal j 
		left join sy_users ON j._create_user_id = sy_users.id 
		where j._project_task_id = #{taskId} 
  		order by j._create_time desc 
	</select>

    <delete id="deleteByTaskId" parameterType="java.lang.String">
        delete from project_task_journal where _project_task_id = #{projectTaskId}
    </delete>
  	
</mapper>