<?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.processCompletion.mapper.BizProcessCompletionMapper">

    <resultMap type="cn.ezhizao.project.business.processCompletion.domain.BizProcessCompletion" id="BizProcessCompletionResult">
        <id column="id" property="id"/>
    </resultMap>


    <select id="getList" parameterType="BizProcessCompletion" resultMap="BizProcessCompletionResult">
        SELECT * FROM biz_process_completion
        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
            deleted = 0
            <if test="year != null  and year != ''"> AND year = #{year}</if>
            <if test="month != null  and month != ''"> AND month = #{month}</if>
            <if test="planNum != null "> AND plan_num = #{planNum}</if>
            <if test="actualNum != null "> AND actual_num = #{actualNum}</if>
        </trim>
        order by year,month
    </select>

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