<?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.glxp.mipsdl.thirddao.njxyy.ThrCorpMapper">
    <select id="filterThrCorps" parameterType="com.glxp.mipsdl.req.base.UdiwmsUnitRequest"
            resultType="com.glxp.mipsdl.entity.thrsys.ThrCorpEntity">
        SELECT *
        FROM thr_corp
        <where>
            <if test="unitId != '' and unitId != null">
                AND unitId like concat('%', #{unitId}, '%')
            </if>
            <if test="name != '' and name != null">
                AND (name LIKE concat('%', #{name}, '%') or spell LIKE concat('%', #{name}, '%'))
            </if>
        </where>
        ORDER BY updateTime DESC
    </select>
</mapper>
