<?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="cn.ezhizao.project.business.mapper.BizDayworkItemMaxHistoryMapper">

    <resultMap type="cn.ezhizao.project.business.domain.BizDayworkItemMaxHistory" id="BizDayworkItemMaxHistoryResult">
        <id column="id" property="id"/>
    </resultMap>


    <select id="getList" parameterType="BizDayworkItemMaxHistory" resultMap="BizDayworkItemMaxHistoryResult">
        SELECT t1.*, t2.process_alias, t3.nick_name as creatorName FROM biz_daywork_item_max_history t1 left join biz_process t2 on t1.process_id = t2.id left join sys_user t3 on t1.creator_id = t3.user_id
        where t1.deleted = 0 and t2.deleted = 0 and t3.del_flag = 0 and t1.daywork_id = #{dayworkId} order by t1.create_time desc
    </select>

    <delete id="physicalDelete">
        DELETE FROM biz_daywork_item_max_history
        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
            <if test="id != null">
                id = #{id} AND
            </if>
       <!-- 删除条件为其他外键可以在这里加 -->
        </trim>
    </delete>
</mapper>
