<?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="com.sooka.system.funeral.ashes_renew.mapper.TGuijiAshesRenewMapper">

    <sql id="selectVo">
        select id, BNO, DNAME, DSEX, DAGE, DMZ, DSFZH, ADDRESS, DTIME, JCGNAME, XCSTARTTM, XCENDTM, LINKMAN, LINKMANSFZH, RELATIONSHIP, LINKMANPHONE, OPERTM, OPERID, OPERDW from t_guiji_funeral_ashes_renew
    </sql>

    <select id="selectList" parameterType="TGuijiAshesRenew" resultType="TGuijiAshesRenew">
        <include refid="selectVo"/>
        <where>
            <if test="BNO != null  and BNO != ''"> and BNO like concat('%', #{BNO}, '%')</if>
            <if test="DNAME != null  and DNAME != ''"> and DNAME like concat('%', #{DNAME}, '%')</if>
            <if test="DSEX != null  and DSEX != ''"> and DSEX like concat('%', #{DSEX}, '%')</if>
            <if test="DAGE != null  and DAGE != ''"> and DAGE like concat('%', #{DAGE}, '%')</if>
            <if test="DMZ != null  and DMZ != ''"> and DMZ like concat('%', #{DMZ}, '%')</if>
            <if test="DSFZH != null  and DSFZH != ''"> and DSFZH like concat('%', #{DSFZH}, '%')</if>
            <if test="ADDRESS != null  and ADDRESS != ''"> and ADDRESS like concat('%', #{ADDRESS}, '%')</if>
            <if test="DTIME != null  and DTIME != ''"> and DTIME like concat('%', #{DTIME}, '%')</if>
            <if test="JCGNAME != null  and JCGNAME != ''"> and JCGNAME like concat('%', #{JCGNAME}, '%')</if>
            <if test="XCSTARTTM != null  and XCSTARTTM != ''"> and XCSTARTTM like concat('%', #{XCSTARTTM}, '%')</if>
            <if test="XCENDTM != null  and XCENDTM != ''"> and XCENDTM like concat('%', #{XCENDTM}, '%')</if>
            <if test="LINKMAN != null  and LINKMAN != ''"> and LINKMAN like concat('%', #{LINKMAN}, '%')</if>
            <if test="LINKMANSFZH != null  and LINKMANSFZH != ''"> and LINKMANSFZH like concat('%', #{LINKMANSFZH}, '%')</if>
            <if test="RELATIONSHIP != null  and RELATIONSHIP != ''"> and RELATIONSHIP like concat('%', #{RELATIONSHIP}, '%')</if>
            <if test="LINKMANPHONE != null  and LINKMANPHONE != ''"> and LINKMANPHONE like concat('%', #{LINKMANPHONE}, '%')</if>
            <if test="OPERTM != null  and OPERTM != ''"> and OPERTM like concat('%', #{OPERTM}, '%')</if>
            <if test="OPERID != null  and OPERID != ''"> and OPERID like concat('%', #{OPERID}, '%')</if>
            <if test="OPERDW != null  and OPERDW != ''"> and OPERDW like concat('%', #{OPERDW}, '%')</if>
        </where>
    </select>

    <select id="selectById" parameterType="String" resultType="TGuijiAshesRenew">
        <include refid="selectVo"/>
        where id = #{id}
    </select>

    <insert id="insert" parameterType="TGuijiAshesRenew">
        insert into t_guiji_funeral_ashes_renew
        <trim prefix="(" suffix=")" suffixOverrides=",">
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
         </trim>
    </insert>

    <update id="update" parameterType="TGuijiAshesRenew">
        update t_guiji_funeral_ashes_renew
        <trim prefix="SET" suffixOverrides=",">
        </trim>
        where id = #{id}
    </update>

    <delete id="deleteById" parameterType="String">
        delete from t_guiji_funeral_ashes_renew where id = #{id}
    </delete>

    <delete id="deleteByIds" parameterType="String">
        delete from t_guiji_funeral_ashes_renew where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>

</mapper>
