RoadInfoMapper.xml 1.66 KB
<?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.zteits.urbanops.module.gloabl.dal.mapper.roadinfo.RoadInfoMapper">
    <resultMap id="BaseResultMap" type="com.zteits.urbanops.module.gloabl.dal.dataobject.roadinfo.RoadInfoDO">
        <result column="m_code" jdbcType="VARCHAR" property="mCode"/>
        <result column="sz_id" jdbcType="VARCHAR" property="szId"/>
        <result column="yl_id" jdbcType="VARCHAR" property="ylId"/>
        <result column="wy_id" jdbcType="VARCHAR" property="wyId"/>
        <result column="road_name" jdbcType="VARCHAR" property="roadName"/>
        <result column="street_code" jdbcType="VARCHAR" property="streetCode"/>
        <result column="street_name" jdbcType="VARCHAR" property="streetName"/>
    </resultMap>
    <select id="selectRoadInfoByCondition"
            parameterType="com.zteits.urbanops.module.gloabl.controller.admin.roadinfo.vo.RoadInfoReqVO"
            resultMap="BaseResultMap">
        select * from global_master_road_info
        <where>
            <if test="streetCode != null  and streetCode != ''">
                and street_code = #{streetCode}
            </if>
            <if test="mCode != null  and mCode != ''">
                and m_code = #{mCode}
            </if>
            <if test="roadName != null  and roadName != ''">
                and road_name like CONCAT('%', #{roadName}, '%')
            </if>
            <if test="streetName != null  and streetName != ''">
                and street_name like CONCAT('%', #{streetName}, '%')
            </if>
        </where>
    </select>
</mapper>