<?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_remove.mapper.TGuijiAshesRemoveMapper">

    <sql id="selectVo">
        select id, BNO, DNAME, DSEX, DAGE, DMZ, DSFZH, ADDRESS, DTIME, JCGCODE, JCGNAME, JCPRICE, STARTTM, GETQZTM, GETMAN, GETMANSFZH, GETRLP, GETMANPHONE, OPERTM, OPERID, OPERDW from t_guiji_funeral_ashes_remove
    </sql>

    <select id="selectList" parameterType="TGuijiAshesRemove" resultType="TGuijiAshesRemove">
        <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="JCGCODE != null  and JCGCODE != ''"> and JCGCODE like concat('%', #{JCGCODE}, '%')</if>
            <if test="JCGNAME != null  and JCGNAME != ''"> and JCGNAME like concat('%', #{JCGNAME}, '%')</if>
            <if test="JCPRICE != null  and JCPRICE != ''"> and JCPRICE like concat('%', #{JCPRICE}, '%')</if>
            <if test="STARTTM != null  and STARTTM != ''"> and STARTTM like concat('%', #{STARTTM}, '%')</if>
            <if test="GETQZTM != null  and GETQZTM != ''"> and GETQZTM like concat('%', #{GETQZTM}, '%')</if>
            <if test="GETMAN != null  and GETMAN != ''"> and GETMAN like concat('%', #{GETMAN}, '%')</if>
            <if test="GETMANSFZH != null  and GETMANSFZH != ''"> and GETMANSFZH like concat('%', #{GETMANSFZH}, '%')</if>
            <if test="GETRLP != null  and GETRLP != ''"> and GETRLP like concat('%', #{GETRLP}, '%')</if>
            <if test="GETMANPHONE != null  and GETMANPHONE != ''"> and GETMANPHONE like concat('%', #{GETMANPHONE}, '%')</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="TGuijiAshesRemove">
        <include refid="selectVo"/>
        where id = #{id}
    </select>

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

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

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

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

</mapper>
