<?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.yifu.cloud.plus.v1.yifu.social.mapper.TSocialPreDetailMapper">

  <resultMap id="tSocialPreDetailMap" type="com.yifu.cloud.plus.v1.yifu.social.entity.TSocialPreDetail">
    <id property="id" column="ID"/>
    <result property="socialProvince" column="SOCIAL_PROVINCE"/>
    <result property="socialCity" column="SOCIAL_CITY"/>
    <result property="socialTown" column="SOCIAL_TOWN"/>
    <result property="deptName" column="DEPT_NAME"/>
    <result property="deptNo" column="DEPT_NO"/>
    <result property="socialHouseholdName" column="SOCIAL_HOUSEHOLD_NAME"/>
    <result property="registerId" column="REGISTER_ID"/>
    <result property="createBy" column="CREATE_BY"/>
    <result property="updateBy" column="UPDATE_BY"/>
    <result property="createName" column="CREATE_NAME"/>
    <result property="updateTime" column="UPDATE_TIME"/>
    <result property="createTime" column="CREATE_TIME"/>
    <result property="dispatchName" column="DISPATCH_NAME"/>
    <result property="dispatchTime" column="DISPATCH_TIME"/>
  </resultMap>

    <sql id="Base_Column_List">
                a.ID,
                a.SOCIAL_PROVINCE,
                a.SOCIAL_CITY,
                a.SOCIAL_TOWN,
                a.DEPT_NAME,
                a.DEPT_NO,
                a.SOCIAL_HOUSEHOLD_NAME,
                a.REGISTER_ID,
                a.CREATE_BY,
                a.UPDATE_BY,
                a.CREATE_NAME,
                a.UPDATE_TIME,
                a.CREATE_TIME,
                a.DISPATCH_NAME,
                a.DISPATCH_TIME
    </sql>
    <sql id="tSocialPreDetail_where">
        <if test="tSocialPreDetail != null">
                    <if test="tSocialPreDetail.id != null and tSocialPreDetail.id.trim() != ''">
                        AND a.ID = #{tSocialPreDetail.id}
                    </if>
                    <if test="tSocialPreDetail.socialProvince != null and tSocialPreDetail.socialProvince.trim() != ''">
                        AND a.SOCIAL_PROVINCE = #{tSocialPreDetail.socialProvince}
                    </if>
                    <if test="tSocialPreDetail.socialCity != null and tSocialPreDetail.socialCity.trim() != ''">
                        AND a.SOCIAL_CITY = #{tSocialPreDetail.socialCity}
                    </if>
                    <if test="tSocialPreDetail.socialTown != null and tSocialPreDetail.socialTown.trim() != ''">
                        AND a.SOCIAL_TOWN = #{tSocialPreDetail.socialTown}
                    </if>
                    <if test="tSocialPreDetail.deptName != null and tSocialPreDetail.deptName.trim() != ''">
                        AND a.DEPT_NAME = #{tSocialPreDetail.deptName}
                    </if>
                    <if test="tSocialPreDetail.deptNo != null and tSocialPreDetail.deptNo.trim() != ''">
                        AND a.DEPT_NO = #{tSocialPreDetail.deptNo}
                    </if>
                    <if test="tSocialPreDetail.socialHouseholdName != null and tSocialPreDetail.socialHouseholdName.trim() != ''">
                        AND a.SOCIAL_HOUSEHOLD_NAME = #{tSocialPreDetail.socialHouseholdName}
                    </if>
                    <if test="tSocialPreDetail.registerId != null and tSocialPreDetail.registerId.trim() != ''">
                        AND a.REGISTER_ID = #{tSocialPreDetail.registerId}
                    </if>
                    <if test="tSocialPreDetail.createBy != null and tSocialPreDetail.createBy.trim() != ''">
                        AND a.CREATE_BY = #{tSocialPreDetail.createBy}
                    </if>
                    <if test="tSocialPreDetail.updateBy != null and tSocialPreDetail.updateBy.trim() != ''">
                        AND a.UPDATE_BY = #{tSocialPreDetail.updateBy}
                    </if>
                    <if test="tSocialPreDetail.createName != null and tSocialPreDetail.createName.trim() != ''">
                        AND a.CREATE_NAME = #{tSocialPreDetail.createName}
                    </if>
                    <if test="tSocialPreDetail.updateTime != null">
                        AND a.UPDATE_TIME = #{tSocialPreDetail.updateTime}
                    </if>
                    <if test="tSocialPreDetail.createTime != null">
                        AND a.CREATE_TIME = #{tSocialPreDetail.createTime}
                    </if>
                    <if test="tSocialPreDetail.dispatchName != null and tSocialPreDetail.dispatchName.trim() != ''">
                        AND a.DISPATCH_NAME = #{tSocialPreDetail.dispatchName}
                    </if>
                    <if test="tSocialPreDetail.dispatchTime != null">
                        AND a.DISPATCH_TIME = #{tSocialPreDetail.dispatchTime}
                    </if>
        </if>
    </sql>
    <!--tSocialPreDetail简单分页查询-->
    <select id="getTSocialPreDetailPage" resultMap="tSocialPreDetailMap">
        SELECT
        <include refid="Base_Column_List"/>
        FROM t_social_pre_detail a
        <where>
            1=1
            <include refid="tSocialPreDetail_where"/>
        </where>
    </select>
</mapper>
