<?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.taskType.mapper.BizTaskTypeMapper">

    <resultMap type="cn.ezhizao.project.business.taskType.domain.BizTaskType" id="BizTaskTypeResult">
        <id column="id" property="id"/>
    </resultMap>


    <select id="getList" parameterType="BizTaskType" resultMap="BizTaskTypeResult">
        SELECT * FROM biz_task_type
        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
            deleted = 0
            <if test="id != null "> AND id = #{id}</if>
            <if test="name != null  and name != ''"> AND name like concat('%', #{name}, '%')</if>
            <if test="subName != null  and subName != ''"> AND sub_name like concat('%', #{subName}, '%')</if>
            <if test="type != null "> AND type = #{type}</if>
        </trim>
    </select>

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