<?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.statementAccount.mapper.BizStatementAccountOnceMapper">

    <resultMap type="cn.ezhizao.project.business.statementAccount.domain.BizStatementAccountOnce" id="BizStatementAccountOnceResult">
        <id column="id" property="id"/>
    </resultMap>


    <select id="getList" parameterType="BizStatementAccountOnce" resultMap="BizStatementAccountOnceResult">
        SELECT * FROM biz_statement_account_once
        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
            deleted = 0
            <if test="companyId != null "> AND company_id = #{companyId}</if>
            <if test="workOrderId != null "> AND work_order_id = #{workOrderId}</if>
            <if test="description != null  and description != ''"> AND description = #{description}</if>
            <if test="amount != null "> AND amount = #{amount}</if>
            <if test="entrustDate != null "> AND entrust_date = #{entrustDate}</if>
            <if test="finishedDate != null "> AND finished_date = #{finishedDate}</if>
            <if test="tenantId != null "> AND tenant_id = #{tenantId}</if>
            <if test="entrustOrderId != null "> AND entrust_order_id = #{entrustOrderId}</if>
        </trim>
    </select>

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