<?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.paymentEntry.mapper.BizPaymentSubjectMapper">

    <resultMap type="cn.ezhizao.project.business.paymentEntry.domain.BizPaymentSubject" id="BizPaymentSubjectResult">
        <id column="id" property="id"/>
    </resultMap>


    <select id="getList" parameterType="BizPaymentSubject" resultMap="BizPaymentSubjectResult">
        SELECT * FROM biz_payment_subject
        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
            deleted = 0
            <if test="paymentTypeId!= null "> AND payment_type_id = #{paymentTypeId}</if>
            <if test="tenantId!= null "> AND tenant_id = #{tenantId}</if>

        </trim>
    </select>

    <select id="getListWithPage" parameterType="BizPaymentSubject" resultMap="BizPaymentSubjectResult">
        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
            p.deleted = 0
            <if test="paymentTypeId!= null "> AND p.payment_type_id = #{paymentTypeId}</if>

        </trim>
    </select>

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