WarehouseMapper.xml 3.38 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.huaheng.pc.general.warehouse.mapper.WarehouseMapper">

    <select id="selectEntity" resultType="com.huaheng.pc.general.warehouse.domain.Warehouse">
        SELECT id, code, name, companyId, address1, address2, city, province, district, country, postalCode, attentionTo, phoneNum, faxNum, email, hostCode, created, createdBy, lastUpdated, lastUpdatedBy, enable, deleted, userDef1, userDef2, userDef3
        FROM warehouse
        <where>
            <if test="id != null">
                AND id = #{id}
            </if>
            <if test="code != null">
                AND code = #{code}
            </if>
            <if test="name != null">
                AND name = #{name}
            </if>
            <if test="companyIdList != null and companyIdList.size() > 0 ">
                AND companyId in
                <foreach collection="companyIdList" item="companyIdItem" open="(" separator="," close=")">
                    #{companyIdItem}
                </foreach>
            </if>
            <if test="companyId != null">
                AND companyId = #{companyId}
            </if>
            <if test="address1 != null">
                AND address1 = #{address1}
            </if>
            <if test="address2 != null">
                AND address2 = #{address2}
            </if>
            <if test="city != null">
                AND city = #{city}
            </if>
            <if test="province != null">
                AND province = #{province}
            </if>
            <if test="district != null">
                AND district = #{district}
            </if>
            <if test="country != null">
                AND country = #{country}
            </if>
            <if test="postalCode != null">
                AND postalCode = #{postalCode}
            </if>
            <if test="attentionTo != null">
                AND attentionTo = #{attentionTo}
            </if>
            <if test="phoneNum != null">
                AND phoneNum = #{phoneNum}
            </if>
            <if test="faxNum != null">
                AND faxNum = #{faxNum}
            </if>
            <if test="email != null">
                AND email = #{email}
            </if>
            <if test="hostCode != null">
                AND hostCode = #{hostCode}
            </if>
            <if test="created != null">
                AND created = #{created}
            </if>
            <if test="createdBy != null">
                AND createdBy = #{createdBy}
            </if>
            <if test="lastUpdated != null">
                AND lastUpdated = #{lastUpdated}
            </if>
            <if test="lastUpdatedBy != null">
                AND lastUpdatedBy = #{lastUpdatedBy}
            </if>
            <if test="enable != null">
                AND enable = #{enable}
            </if>
            <if test="deleted != null">
                AND deleted = #{deleted}
            </if>
            <if test="userDef1 != null">
                AND userDef1 = #{userDef1}
            </if>
            <if test="userDef2 != null">
                AND userDef2 = #{userDef2}
            </if>
            <if test="userDef3 != null">
                AND userDef3 = #{userDef3}
            </if>
        </where>
    </select>
</mapper>