<?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.scpwxyy.A004Mapper">
  <resultMap id="BaseResultMap" type="com.glxp.mipsdl.entity.scpwxyy.A004">
    <!--@mbg.generated-->
    <!--@Table udi_wms_ywj.a004-->
    <id column="CODE" jdbcType="VARCHAR" property="code" />
    <result column="NAME" jdbcType="VARCHAR" property="name" />
    <result column="REMARK" jdbcType="VARCHAR" property="remark" />
    <result column="DETAILS" jdbcType="LONGVARCHAR" property="details" />
  </resultMap>
  <sql id="Base_Column_List">
    <!--@mbg.generated-->
    CODE, `NAME`, REMARK, DETAILS
  </sql>

  <select id="filterList" resultType="com.glxp.mipsdl.entity.scpwxyy.A004">
        select *
        from a004
        <where>
            <if test="udiwmsWarehouseRequest.inventoryCode != null and udiwmsWarehouseRequest.inventoryCode != ''  and udiwmsWarehouseRequest.databaseProductName == 'MySQL'">
                AND (
                    CODE like concat('%', #{udiwmsWarehouseRequest.inventoryCode}, '%')
                    )
            </if>
            <if test="udiwmsWarehouseRequest.inventoryCode != null and udiwmsWarehouseRequest.inventoryCode != ''  and udiwmsWarehouseRequest.databaseProductName == 'Oracle'">
                AND (
                    CODE LIKE '%' || #{udiwmsWarehouseRequest.inventoryCode} || '%'
                    )
            </if>
        </where>
        order by CODE
    </select>

</mapper>