<?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.nantian.cloud.jljc.mapper.TTceMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.nantian.cloud.jljc.entity.TTce">
        <id column="id" property="id"/>
        <result column="cmp_name" property="cmpName"/>
        <result column="enterprise_code" property="enterpriseCode"/>
        <result column="tce" property="tce"/>
        <result column="year" property="year"/>
        <result column="userid" property="userid"/>
        <result column="update_time" property="updateTime"/>
        <result column="del_flag" property="delFlag"/>
        <result column="dept_id" property="deptId"/>
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, cmp_name, enterprise_code, tce, year, userid, update_time, del_flag, dept_id
    </sql>

    <select id="getTTcePage" resultType="com.nantian.cloud.jljc.entity.TTce">
        select <include refid="Base_Column_List"></include>
        from t_tce
        where del_flag = "1"
        <if test="tTce.enterpriseCode!=null and tTce.enterpriseCode!=''">
            and enterprise_code like concat("%",#{tTce.enterpriseCode},"%")
        </if>
        <if test="tTce.cmpName!=null and tTce.cmpName!=''">
            and cmp_name like concat("%",#{tTce.cmpName},"%")
        </if>
        <if test="tTce.year!=null and tTce.year!=''">
            and year = #{tTce.year}
        </if>
    </select>

</mapper>
