<?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.WarehouseMapperAuto"> <select id="selectListEntityByLike" 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 like #{code} </if> <if test="name != null"> AND name like #{name} </if> <if test="companyId != null"> AND companyId = #{companyId} </if> <if test="address1 != null"> AND address1 like #{address1} </if> <if test="address2 != null"> AND address2 like #{address2} </if> <if test="city != null"> AND city like #{city} </if> <if test="province != null"> AND province like #{province} </if> <if test="district != null"> AND district like #{district} </if> <if test="country != null"> AND country like #{country} </if> <if test="postalCode != null"> AND postalCode like #{postalCode} </if> <if test="attentionTo != null"> AND attentionTo like #{attentionTo} </if> <if test="phoneNum != null"> AND phoneNum like #{phoneNum} </if> <if test="faxNum != null"> AND faxNum like #{faxNum} </if> <if test="email != null"> AND email like #{email} </if> <if test="hostCode != null"> AND hostCode like #{hostCode} </if> <if test="created != null"> AND created = #{created} </if> <if test="createdBy != null"> AND createdBy like #{createdBy} </if> <if test="lastUpdated != null"> AND lastUpdated = #{lastUpdated} </if> <if test="lastUpdatedBy != null"> AND lastUpdatedBy like #{lastUpdatedBy} </if> <if test="enable != null"> AND enable = #{enable} </if> <if test="deleted != null"> AND deleted = #{deleted} </if> <if test="userDef1 != null"> AND userDef1 like #{userDef1} </if> <if test="userDef2 != null"> AND userDef2 like #{userDef2} </if> <if test="userDef3 != null"> AND userDef3 like #{userDef3} </if> </where> </select> <select id="selectListEntityByEqual" 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="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> <select id="selectListMapByEqual" resultType="java.util.HashMap"> SELECT ${columns} FROM warehouse <where> <if test="condition.id != null"> AND id = #{condition.id} </if> <if test="condition.code != null"> AND code = #{condition.code} </if> <if test="condition.name != null"> AND name = #{condition.name} </if> <if test="condition.companyId != null"> AND companyId = #{condition.companyId} </if> <if test="condition.address1 != null"> AND address1 = #{condition.address1} </if> <if test="condition.address2 != null"> AND address2 = #{condition.address2} </if> <if test="condition.city != null"> AND city = #{condition.city} </if> <if test="condition.province != null"> AND province = #{condition.province} </if> <if test="condition.district != null"> AND district = #{condition.district} </if> <if test="condition.country != null"> AND country = #{condition.country} </if> <if test="condition.postalCode != null"> AND postalCode = #{condition.postalCode} </if> <if test="condition.attentionTo != null"> AND attentionTo = #{condition.attentionTo} </if> <if test="condition.phoneNum != null"> AND phoneNum = #{condition.phoneNum} </if> <if test="condition.faxNum != null"> AND faxNum = #{condition.faxNum} </if> <if test="condition.email != null"> AND email = #{condition.email} </if> <if test="condition.hostCode != null"> AND hostCode = #{condition.hostCode} </if> <if test="condition.created != null"> AND created = #{condition.created} </if> <if test="condition.createdBy != null"> AND createdBy = #{condition.createdBy} </if> <if test="condition.lastUpdated != null"> AND lastUpdated = #{condition.lastUpdated} </if> <if test="condition.lastUpdatedBy != null"> AND lastUpdatedBy = #{condition.lastUpdatedBy} </if> <if test="condition.enable != null"> AND enable = #{condition.enable} </if> <if test="condition.deleted != null"> AND deleted = #{condition.deleted} </if> <if test="condition.userDef1 != null"> AND userDef1 = #{condition.userDef1} </if> <if test="condition.userDef2 != null"> AND userDef2 = #{condition.userDef2} </if> <if test="condition.userDef3 != null"> AND userDef3 = #{condition.userDef3} </if> </where> </select> <select id="selectEntityById" 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 id = #{id} </select> <select id="selectFirstEntity" 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="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> LIMIT 1 </select> <select id="selectFirstMap" resultType="java.util.HashMap"> SELECT ${columns} FROM warehouse <where> <if test="condition.id != null"> AND id = #{condition.id} </if> <if test="condition.code != null"> AND code = #{condition.code} </if> <if test="condition.name != null"> AND name = #{condition.name} </if> <if test="condition.companyId != null"> AND companyId = #{condition.companyId} </if> <if test="condition.address1 != null"> AND address1 = #{condition.address1} </if> <if test="condition.address2 != null"> AND address2 = #{condition.address2} </if> <if test="condition.city != null"> AND city = #{condition.city} </if> <if test="condition.province != null"> AND province = #{condition.province} </if> <if test="condition.district != null"> AND district = #{condition.district} </if> <if test="condition.country != null"> AND country = #{condition.country} </if> <if test="condition.postalCode != null"> AND postalCode = #{condition.postalCode} </if> <if test="condition.attentionTo != null"> AND attentionTo = #{condition.attentionTo} </if> <if test="condition.phoneNum != null"> AND phoneNum = #{condition.phoneNum} </if> <if test="condition.faxNum != null"> AND faxNum = #{condition.faxNum} </if> <if test="condition.email != null"> AND email = #{condition.email} </if> <if test="condition.hostCode != null"> AND hostCode = #{condition.hostCode} </if> <if test="condition.created != null"> AND created = #{condition.created} </if> <if test="condition.createdBy != null"> AND createdBy = #{condition.createdBy} </if> <if test="condition.lastUpdated != null"> AND lastUpdated = #{condition.lastUpdated} </if> <if test="condition.lastUpdatedBy != null"> AND lastUpdatedBy = #{condition.lastUpdatedBy} </if> <if test="condition.enable != null"> AND enable = #{condition.enable} </if> <if test="condition.deleted != null"> AND deleted = #{condition.deleted} </if> <if test="condition.userDef1 != null"> AND userDef1 = #{condition.userDef1} </if> <if test="condition.userDef2 != null"> AND userDef2 = #{condition.userDef2} </if> <if test="condition.userDef3 != null"> AND userDef3 = #{condition.userDef3} </if> </where> LIMIT 1 </select> <insert id="insert" parameterType="com.huaheng.pc.general.warehouse.domain.Warehouse" keyProperty="id" useGeneratedKeys="true" > INSERT INTO warehouse <trim prefix="(" suffix=")" suffixOverrides=","> <if test="code != null"> code, </if> <if test="name != null"> name, </if> <if test="companyId != null"> companyId, </if> <if test="address1 != null"> address1, </if> <if test="address2 != null"> address2, </if> <if test="city != null"> city, </if> <if test="province != null"> province, </if> <if test="district != null"> district, </if> <if test="country != null"> country, </if> <if test="postalCode != null"> postalCode, </if> <if test="attentionTo != null"> attentionTo, </if> <if test="phoneNum != null"> phoneNum, </if> <if test="faxNum != null"> faxNum, </if> <if test="email != null"> email, </if> <if test="hostCode != null"> hostCode, </if> <if test="created != null"> created, </if> <if test="createdBy != null"> createdBy, </if> <if test="lastUpdated != null"> lastUpdated, </if> <if test="lastUpdatedBy != null"> lastUpdatedBy, </if> <if test="enable != null"> enable, </if> <if test="deleted != null"> deleted, </if> <if test="userDef1 != null"> userDef1, </if> <if test="userDef2 != null"> userDef2, </if> <if test="userDef3 != null"> userDef3, </if> </trim> <trim prefix=" values (" suffix=")" suffixOverrides=","> <if test="code != null"> #{code, jdbcType=VARCHAR}, </if> <if test="name != null"> #{name, jdbcType=VARCHAR}, </if> <if test="companyId != null"> #{companyId, jdbcType=INTEGER}, </if> <if test="address1 != null"> #{address1, jdbcType=VARCHAR}, </if> <if test="address2 != null"> #{address2, jdbcType=VARCHAR}, </if> <if test="city != null"> #{city, jdbcType=VARCHAR}, </if> <if test="province != null"> #{province, jdbcType=VARCHAR}, </if> <if test="district != null"> #{district, jdbcType=VARCHAR}, </if> <if test="country != null"> #{country, jdbcType=VARCHAR}, </if> <if test="postalCode != null"> #{postalCode, jdbcType=VARCHAR}, </if> <if test="attentionTo != null"> #{attentionTo, jdbcType=VARCHAR}, </if> <if test="phoneNum != null"> #{phoneNum, jdbcType=VARCHAR}, </if> <if test="faxNum != null"> #{faxNum, jdbcType=VARCHAR}, </if> <if test="email != null"> #{email, jdbcType=VARCHAR}, </if> <if test="hostCode != null"> #{hostCode, jdbcType=VARCHAR}, </if> <if test="created != null"> #{created, jdbcType=TIMESTAMP}, </if> <if test="createdBy != null"> #{createdBy, jdbcType=VARCHAR}, </if> <if test="lastUpdated != null"> #{lastUpdated, jdbcType=TIMESTAMP}, </if> <if test="lastUpdatedBy != null"> #{lastUpdatedBy, jdbcType=VARCHAR}, </if> <if test="enable != null"> #{enable, jdbcType=BIT}, </if> <if test="deleted != null"> #{deleted, jdbcType=BIT}, </if> <if test="userDef1 != null"> #{userDef1, jdbcType=VARCHAR}, </if> <if test="userDef2 != null"> #{userDef2, jdbcType=VARCHAR}, </if> <if test="userDef3 != null"> #{userDef3, jdbcType=VARCHAR}, </if> </trim> </insert> <update id="updateByModel"> UPDATE warehouse <set> <if test="code != null"> code = #{code, jdbcType=VARCHAR}, </if> <if test="name != null"> name = #{name, jdbcType=VARCHAR}, </if> <if test="companyId != null"> companyId = #{companyId, jdbcType=INTEGER}, </if> <if test="address1 != null"> address1 = #{address1, jdbcType=VARCHAR}, </if> <if test="address2 != null"> address2 = #{address2, jdbcType=VARCHAR}, </if> <if test="city != null"> city = #{city, jdbcType=VARCHAR}, </if> <if test="province != null"> province = #{province, jdbcType=VARCHAR}, </if> <if test="district != null"> district = #{district, jdbcType=VARCHAR}, </if> <if test="country != null"> country = #{country, jdbcType=VARCHAR}, </if> <if test="postalCode != null"> postalCode = #{postalCode, jdbcType=VARCHAR}, </if> <if test="attentionTo != null"> attentionTo = #{attentionTo, jdbcType=VARCHAR}, </if> <if test="phoneNum != null"> phoneNum = #{phoneNum, jdbcType=VARCHAR}, </if> <if test="faxNum != null"> faxNum = #{faxNum, jdbcType=VARCHAR}, </if> <if test="email != null"> email = #{email, jdbcType=VARCHAR}, </if> <if test="hostCode != null"> hostCode = #{hostCode, jdbcType=VARCHAR}, </if> <if test="created != null"> created = #{created, jdbcType=TIMESTAMP}, </if> <if test="createdBy != null"> createdBy = #{createdBy, jdbcType=VARCHAR}, </if> <if test="lastUpdated != null"> lastUpdated = #{lastUpdated, jdbcType=TIMESTAMP}, </if> <if test="lastUpdatedBy != null"> lastUpdatedBy = #{lastUpdatedBy, jdbcType=VARCHAR}, </if> <if test="enable != null"> enable = #{enable, jdbcType=BIT}, </if> <if test="deleted != null"> deleted = #{deleted, jdbcType=BIT}, </if> <if test="userDef1 != null"> userDef1 = #{userDef1, jdbcType=VARCHAR}, </if> <if test="userDef2 != null"> userDef2 = #{userDef2, jdbcType=VARCHAR}, </if> <if test="userDef3 != null"> userDef3 = #{userDef3, jdbcType=VARCHAR}, </if> </set> WHERE id = #{id,jdbcType=INTEGER} </update> <update id="updateByCondition"> UPDATE warehouse <set> <if test="record.code != null"> code = #{record.code, jdbcType=VARCHAR}, </if> <if test="record.name != null"> name = #{record.name, jdbcType=VARCHAR}, </if> <if test="record.companyId != null"> companyId = #{record.companyId, jdbcType=INTEGER}, </if> <if test="record.address1 != null"> address1 = #{record.address1, jdbcType=VARCHAR}, </if> <if test="record.address2 != null"> address2 = #{record.address2, jdbcType=VARCHAR}, </if> <if test="record.city != null"> city = #{record.city, jdbcType=VARCHAR}, </if> <if test="record.province != null"> province = #{record.province, jdbcType=VARCHAR}, </if> <if test="record.district != null"> district = #{record.district, jdbcType=VARCHAR}, </if> <if test="record.country != null"> country = #{record.country, jdbcType=VARCHAR}, </if> <if test="record.postalCode != null"> postalCode = #{record.postalCode, jdbcType=VARCHAR}, </if> <if test="record.attentionTo != null"> attentionTo = #{record.attentionTo, jdbcType=VARCHAR}, </if> <if test="record.phoneNum != null"> phoneNum = #{record.phoneNum, jdbcType=VARCHAR}, </if> <if test="record.faxNum != null"> faxNum = #{record.faxNum, jdbcType=VARCHAR}, </if> <if test="record.email != null"> email = #{record.email, jdbcType=VARCHAR}, </if> <if test="record.hostCode != null"> hostCode = #{record.hostCode, jdbcType=VARCHAR}, </if> <if test="record.created != null"> created = #{record.created, jdbcType=TIMESTAMP}, </if> <if test="record.createdBy != null"> createdBy = #{record.createdBy, jdbcType=VARCHAR}, </if> <if test="record.lastUpdated != null"> lastUpdated = #{record.lastUpdated, jdbcType=TIMESTAMP}, </if> <if test="record.lastUpdatedBy != null"> lastUpdatedBy = #{record.lastUpdatedBy, jdbcType=VARCHAR}, </if> <if test="record.enable != null"> enable = #{record.enable, jdbcType=BIT}, </if> <if test="record.deleted != null"> deleted = #{record.deleted, jdbcType=BIT}, </if> <if test="record.userDef1 != null"> userDef1 = #{record.userDef1, jdbcType=VARCHAR}, </if> <if test="record.userDef2 != null"> userDef2 = #{record.userDef2, jdbcType=VARCHAR}, </if> <if test="record.userDef3 != null"> userDef3 = #{record.userDef3, jdbcType=VARCHAR}, </if> </set> <where> <if test="condition.id != null"> AND id = #{condition.id} </if> <if test="condition.code != null"> AND code = #{condition.code} </if> <if test="condition.name != null"> AND name = #{condition.name} </if> <if test="condition.companyId != null"> AND companyId = #{condition.companyId} </if> <if test="condition.address1 != null"> AND address1 = #{condition.address1} </if> <if test="condition.address2 != null"> AND address2 = #{condition.address2} </if> <if test="condition.city != null"> AND city = #{condition.city} </if> <if test="condition.province != null"> AND province = #{condition.province} </if> <if test="condition.district != null"> AND district = #{condition.district} </if> <if test="condition.country != null"> AND country = #{condition.country} </if> <if test="condition.postalCode != null"> AND postalCode = #{condition.postalCode} </if> <if test="condition.attentionTo != null"> AND attentionTo = #{condition.attentionTo} </if> <if test="condition.phoneNum != null"> AND phoneNum = #{condition.phoneNum} </if> <if test="condition.faxNum != null"> AND faxNum = #{condition.faxNum} </if> <if test="condition.email != null"> AND email = #{condition.email} </if> <if test="condition.hostCode != null"> AND hostCode = #{condition.hostCode} </if> <if test="condition.created != null"> AND created = #{condition.created} </if> <if test="condition.createdBy != null"> AND createdBy = #{condition.createdBy} </if> <if test="condition.lastUpdated != null"> AND lastUpdated = #{condition.lastUpdated} </if> <if test="condition.lastUpdatedBy != null"> AND lastUpdatedBy = #{condition.lastUpdatedBy} </if> <if test="condition.enable != null"> AND enable = #{condition.enable} </if> <if test="condition.deleted != null"> AND deleted = #{condition.deleted} </if> <if test="condition.userDef1 != null"> AND userDef1 = #{condition.userDef1} </if> <if test="condition.userDef2 != null"> AND userDef2 = #{condition.userDef2} </if> <if test="condition.userDef3 != null"> AND userDef3 = #{condition.userDef3} </if> </where> </update> <delete id="deleteById"> DELETE FROM warehouse WHERE id = #{id, jdbcType=INTEGER} </delete> <delete id="deleteByCondition"> DELETE 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="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> </delete> </mapper>