<?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.personSeal.mapper.BizPersonalSealMapper">

    <resultMap type="cn.ezhizao.project.business.personSeal.domain.BizPersonalSeal" id="BizPersonalSealResult">
        <id column="id" property="id"/>
    </resultMap>


    <select id="getList" parameterType="BizPersonalSeal" resultMap="BizPersonalSealResult">
        SELECT * FROM biz_personal_seal
        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
            deleted = 0
            <if test="url != null  and url != ''"> AND url = #{url}</if>
            <if test="userId != null  and userId != ''"> AND user_id = #{userId}</if>
            <if test="code != null  and code != ''"> AND code = #{code}</if>
            <if test="nickName != null  and nickName != ''"> AND nick_name like concat('%', #{nickName}, '%')</if>
        </trim>
        order by create_time desc
    </select>

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