<?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.deptUser.mapper.BizDeptProcessMapper">

    <resultMap type="cn.ezhizao.project.business.deptUser.domain.BizDeptProcess" id="BizDeptProcessResult">
        <id column="id" property="id"/>
    </resultMap>


    <select id="getList" parameterType="BizDeptProcess" resultMap="BizDeptProcessResult">
        SELECT * FROM biz_dept_process
        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
            deleted = 0
            <if test="processCode != null  and processCode != ''"> AND process_code like concat('%',#{processCode},'%')</if>
            <if test="processAlias != null  and processAlias != ''"> AND process_alias like concat('%',#{processAlias},'%')</if>
            <if test="deptId != null  and deptId != ''"> AND dept_id = #{deptId}</if>
            <if test="tenantId != null  and tenantId != 0"> AND tenant_id = #{tenantId}</if>
        </trim>
    </select>

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