<?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.ssj.mapper.sys.SysMapper">
    <select id="findCodeExchangeListByPage" parameterType="java.util.Map" resultType="com.ssj.bean.sys.codeexchange.CodeExchange">
        select t.id,
            t.code,
            t.is_valid isValid,
            t.user_id userId,
            t.user_name userName,
            t.module,
            t.type,
            t.months,
            t.days,
            t.start_time startTime,
            t.end_time endTime,
            t.is_lock isLock,
            t.create_time createTime
        from tb_code_exchange t
        where 1=1
        <if test="map.code != null and map.code != '' ">
            and t.code regexp #{map.code}
        </if>
        <if test="map.user_name != null and map.user_name != '' ">
            and t.user_name regexp #{map.user_name}
        </if>
        <if test="map.module != null and map.module != '' ">
            and t.module = #{map.module}
        </if>
    </select>
</mapper>