<?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.priceRecord.mapper.BizTaskTypePriceRecordMapper">

    <resultMap type="cn.ezhizao.project.business.priceRecord.domain.BizTaskTypePriceRecord" id="BizTaskTypePriceRecordResult">
        <id column="id" property="id"/>
    </resultMap>


    <select id="getList" parameterType="BizTaskTypePriceRecord" resultMap="BizTaskTypePriceRecordResult">
        SELECT * FROM biz_task_type_price_record
        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
            deleted = 0
            <if test="id != null "> AND id = #{id}</if>
            <if test="startDate != null "> AND start_date = #{startDate}</if>
            <if test="endDate != null "> AND end_date = #{endDate}</if>
            <if test="taskTypeId != null "> AND task_type_id = #{taskTypeId}</if>
            <if test="taskTypeDetailId != null "> AND task_type_detail_id = #{taskTypeDetailId}</if>
            <if test="price != null "> AND price = #{price}</if>
            <if test="hasChanged != null "> AND has_changed = #{hasChanged}</if>
            <if test="provinceCode != null  and provinceCode != ''"> AND province_code = #{provinceCode}</if>
            <if test="province != null  and province != ''"> AND province = #{province}</if>
            <if test="cityCode != null  and cityCode != ''"> AND city_code = #{cityCode}</if>
            <if test="city != null  and city != ''"> AND city = #{city}</if>
            <if test="districtCode != null  and districtCode != ''"> AND district_code = #{districtCode}</if>
            <if test="district != null  and district != ''"> AND district = #{district}</if>
        </trim>
    </select>

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