<?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.container.mapper.ContainerMapperAuto"> <select id="selectListEntityByLike" resultType="com.huaheng.pc.general.container.domain.Container"> SELECT id, code, warehouseId, warehouseCode, type, locationId, locationCode, status, printCount, created, createdBy, lastUpdated, lastUpdatedBy, enable, deleted, userDef1, userDef2, userDef3, userDef4, userDef5 FROM container <where> <if test="id != null "> AND id = #{id} </if> <if test="code != null and code != ''"> <bind name="codePattern" value="'%' + code + '%'" /> AND code like #{codePattern} </if> <if test="warehouseId != null "> AND warehouseId = #{warehouseId} </if> <if test="warehouseCode != null and warehouseCode != ''"> <bind name="warehouseCodePattern" value="'%' + warehouseCode + '%'" /> AND warehouseCode like #{warehouseCodePattern} </if> <if test="type != null and type != ''"> <bind name="typePattern" value="'%' + type + '%'" /> AND type like #{typePattern} </if> <if test="locationId != null "> AND locationId = #{locationId} </if> <if test="locationCode != null and locationCode != ''"> <bind name="locationCodePattern" value="'%' + locationCode + '%'" /> AND locationCode like #{locationCodePattern} </if> <if test="status != null and status != ''"> <bind name="statusPattern" value="'%' + status + '%'" /> AND status like #{statusPattern} </if> <if test="printCount != null "> AND printCount = #{printCount} </if> <if test="params != null and params.createdBegin != null and params.createdBegin != ''"> AND created >= #{params.createdBegin} </if> <if test="params != null and params.createdEnd != null and params.createdEnd != ''"> AND created <= #{params.createdEnd} </if> <if test="createdBy != null and createdBy != ''"> <bind name="createdByPattern" value="'%' + createdBy + '%'" /> AND createdBy like #{createdByPattern} </if> <if test="params != null and params.lastUpdatedBegin != null and params.lastUpdatedBegin != ''"> AND lastUpdated >= #{params.lastUpdatedBegin} </if> <if test="params != null and params.lastUpdatedEnd != null and params.lastUpdatedEnd != ''"> AND lastUpdated <= #{params.lastUpdatedEnd} </if> <if test="lastUpdatedBy != null and lastUpdatedBy != ''"> <bind name="lastUpdatedByPattern" value="'%' + lastUpdatedBy + '%'" /> AND lastUpdatedBy like #{lastUpdatedByPattern} </if> <if test="enable != null "> AND enable = #{enable} </if> <if test="deleted != null "> AND deleted = #{deleted} </if> <if test="userDef1 != null and userDef1 != ''"> <bind name="userDef1Pattern" value="'%' + userDef1 + '%'" /> AND userDef1 like #{userDef1Pattern} </if> <if test="userDef2 != null and userDef2 != ''"> <bind name="userDef2Pattern" value="'%' + userDef2 + '%'" /> AND userDef2 like #{userDef2Pattern} </if> <if test="userDef3 != null and userDef3 != ''"> <bind name="userDef3Pattern" value="'%' + userDef3 + '%'" /> AND userDef3 like #{userDef3Pattern} </if> <if test="userDef4 != null and userDef4 != ''"> <bind name="userDef4Pattern" value="'%' + userDef4 + '%'" /> AND userDef4 like #{userDef4Pattern} </if> <if test="userDef5 != null and userDef5 != ''"> <bind name="userDef5Pattern" value="'%' + userDef5 + '%'" /> AND userDef5 like #{userDef5Pattern} </if> </where> </select> <select id="selectListEntityByEqual" resultType="com.huaheng.pc.general.container.domain.Container"> SELECT id, code, warehouseId, warehouseCode, type, locationId, locationCode, status, printCount, created, createdBy, lastUpdated, lastUpdatedBy, enable, deleted, userDef1, userDef2, userDef3, userDef4, userDef5 FROM container <where> <if test="id != null"> AND id = #{id} </if> <if test="code != null"> AND code = #{code} </if> <if test="warehouseId != null"> AND warehouseId = #{warehouseId} </if> <if test="warehouseCode != null"> AND warehouseCode = #{warehouseCode} </if> <if test="type != null"> AND type = #{type} </if> <if test="locationId != null"> AND locationId = #{locationId} </if> <if test="locationCode != null"> AND locationCode = #{locationCode} </if> <if test="status != null"> AND status = #{status} </if> <if test="printCount != null"> AND printCount = #{printCount} </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> <if test="userDef4 != null"> AND userDef4 = #{userDef4} </if> <if test="userDef5 != null"> AND userDef5 = #{userDef5} </if> </where> </select> <select id="selectListMapByEqual" resultType="java.util.HashMap"> SELECT ${columns} FROM container <where> <if test="condition.id != null"> AND id = #{condition.id} </if> <if test="condition.code != null"> AND code = #{condition.code} </if> <if test="condition.warehouseId != null"> AND warehouseId = #{condition.warehouseId} </if> <if test="condition.warehouseCode != null"> AND warehouseCode = #{condition.warehouseCode} </if> <if test="condition.type != null"> AND type = #{condition.type} </if> <if test="condition.locationId != null"> AND locationId = #{condition.locationId} </if> <if test="condition.locationCode != null"> AND locationCode = #{condition.locationCode} </if> <if test="condition.status != null"> AND status = #{condition.status} </if> <if test="condition.printCount != null"> AND printCount = #{condition.printCount} </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> <if test="condition.userDef4 != null"> AND userDef4 = #{condition.userDef4} </if> <if test="condition.userDef5 != null"> AND userDef5 = #{condition.userDef5} </if> </where> </select> <select id="selectEntityById" resultType="com.huaheng.pc.general.container.domain.Container"> SELECT id, code, warehouseId, warehouseCode, type, locationId, locationCode, status, printCount, created, createdBy, lastUpdated, lastUpdatedBy, enable, deleted, userDef1, userDef2, userDef3, userDef4, userDef5 FROM container WHERE id = #{id} </select> <select id="selectFirstEntity" resultType="com.huaheng.pc.general.container.domain.Container"> SELECT id, code, warehouseId, warehouseCode, type, locationId, locationCode, status, printCount, created, createdBy, lastUpdated, lastUpdatedBy, enable, deleted, userDef1, userDef2, userDef3, userDef4, userDef5 FROM container <where> <if test="id != null"> AND id = #{id} </if> <if test="code != null"> AND code = #{code} </if> <if test="warehouseId != null"> AND warehouseId = #{warehouseId} </if> <if test="warehouseCode != null"> AND warehouseCode = #{warehouseCode} </if> <if test="type != null"> AND type = #{type} </if> <if test="locationId != null"> AND locationId = #{locationId} </if> <if test="locationCode != null"> AND locationCode = #{locationCode} </if> <if test="status != null"> AND status = #{status} </if> <if test="printCount != null"> AND printCount = #{printCount} </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> <if test="userDef4 != null"> AND userDef4 = #{userDef4} </if> <if test="userDef5 != null"> AND userDef5 = #{userDef5} </if> </where> LIMIT 1 </select> <select id="selectFirstMap" resultType="java.util.HashMap"> SELECT ${columns} FROM container <where> <if test="condition.id != null"> AND id = #{condition.id} </if> <if test="condition.code != null"> AND code = #{condition.code} </if> <if test="condition.warehouseId != null"> AND warehouseId = #{condition.warehouseId} </if> <if test="condition.warehouseCode != null"> AND warehouseCode = #{condition.warehouseCode} </if> <if test="condition.type != null"> AND type = #{condition.type} </if> <if test="condition.locationId != null"> AND locationId = #{condition.locationId} </if> <if test="condition.locationCode != null"> AND locationCode = #{condition.locationCode} </if> <if test="condition.status != null"> AND status = #{condition.status} </if> <if test="condition.printCount != null"> AND printCount = #{condition.printCount} </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> <if test="condition.userDef4 != null"> AND userDef4 = #{condition.userDef4} </if> <if test="condition.userDef5 != null"> AND userDef5 = #{condition.userDef5} </if> </where> LIMIT 1 </select> <insert id="insert" parameterType="com.huaheng.pc.general.container.domain.Container" keyProperty="id" useGeneratedKeys="true" > INSERT INTO container <trim prefix="(" suffix=")" suffixOverrides=","> <if test="code != null"> code, </if> <if test="warehouseId != null"> warehouseId, </if> <if test="warehouseCode != null"> warehouseCode, </if> <if test="type != null"> type, </if> <if test="locationId != null"> locationId, </if> <if test="locationCode != null"> locationCode, </if> <if test="status != null"> status, </if> <if test="printCount != null"> printCount, </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> <if test="userDef4 != null"> userDef4, </if> <if test="userDef5 != null"> userDef5, </if> </trim> <trim prefix=" values (" suffix=")" suffixOverrides=","> <if test="code != null"> #{code, jdbcType=VARCHAR}, </if> <if test="warehouseId != null"> #{warehouseId, jdbcType=INTEGER}, </if> <if test="warehouseCode != null"> #{warehouseCode, jdbcType=VARCHAR}, </if> <if test="type != null"> #{type, jdbcType=VARCHAR}, </if> <if test="locationId != null"> #{locationId, jdbcType=INTEGER}, </if> <if test="locationCode != null"> #{locationCode, jdbcType=VARCHAR}, </if> <if test="status != null"> #{status, jdbcType=VARCHAR}, </if> <if test="printCount != null"> #{printCount, jdbcType=INTEGER}, </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> <if test="userDef4 != null"> #{userDef4, jdbcType=VARCHAR}, </if> <if test="userDef5 != null"> #{userDef5, jdbcType=VARCHAR}, </if> </trim> </insert> <update id="updateByModel"> UPDATE container <set> <if test="code != null"> code = #{code, jdbcType=VARCHAR}, </if> <if test="warehouseId != null"> warehouseId = #{warehouseId, jdbcType=INTEGER}, </if> <if test="warehouseCode != null"> warehouseCode = #{warehouseCode, jdbcType=VARCHAR}, </if> <if test="type != null"> type = #{type, jdbcType=VARCHAR}, </if> <if test="locationId != null"> locationId = #{locationId, jdbcType=INTEGER}, </if> <if test="locationCode != null"> locationCode = #{locationCode, jdbcType=VARCHAR}, </if> <if test="status != null"> status = #{status, jdbcType=VARCHAR}, </if> <if test="printCount != null"> printCount = #{printCount, jdbcType=INTEGER}, </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> <if test="userDef4 != null"> userDef4 = #{userDef4, jdbcType=VARCHAR}, </if> <if test="userDef5 != null"> userDef5 = #{userDef5, jdbcType=VARCHAR}, </if> </set> WHERE id = #{id,jdbcType=INTEGER} </update> <update id="updateByCondition"> UPDATE container <set> <if test="record.code != null"> code = #{record.code, jdbcType=VARCHAR}, </if> <if test="record.warehouseId != null"> warehouseId = #{record.warehouseId, jdbcType=INTEGER}, </if> <if test="record.warehouseCode != null"> warehouseCode = #{record.warehouseCode, jdbcType=VARCHAR}, </if> <if test="record.type != null"> type = #{record.type, jdbcType=VARCHAR}, </if> <if test="record.locationId != null"> locationId = #{record.locationId, jdbcType=INTEGER}, </if> <if test="record.locationCode != null"> locationCode = #{record.locationCode, jdbcType=VARCHAR}, </if> <if test="record.status != null"> status = #{record.status, jdbcType=VARCHAR}, </if> <if test="record.printCount != null"> printCount = #{record.printCount, jdbcType=INTEGER}, </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> <if test="record.userDef4 != null"> userDef4 = #{record.userDef4, jdbcType=VARCHAR}, </if> <if test="record.userDef5 != null"> userDef5 = #{record.userDef5, 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.warehouseId != null"> AND warehouseId = #{condition.warehouseId} </if> <if test="condition.warehouseCode != null"> AND warehouseCode = #{condition.warehouseCode} </if> <if test="condition.type != null"> AND type = #{condition.type} </if> <if test="condition.locationId != null"> AND locationId = #{condition.locationId} </if> <if test="condition.locationCode != null"> AND locationCode = #{condition.locationCode} </if> <if test="condition.status != null"> AND status = #{condition.status} </if> <if test="condition.printCount != null"> AND printCount = #{condition.printCount} </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> <if test="condition.userDef4 != null"> AND userDef4 = #{condition.userDef4} </if> <if test="condition.userDef5 != null"> AND userDef5 = #{condition.userDef5} </if> </where> </update> <delete id="deleteById"> DELETE FROM container WHERE id = #{id, jdbcType=INTEGER} </delete> <delete id="deleteByCondition"> DELETE FROM container <where> <if test="id != null"> AND id = #{id} </if> <if test="code != null"> AND code = #{code} </if> <if test="warehouseId != null"> AND warehouseId = #{warehouseId} </if> <if test="warehouseCode != null"> AND warehouseCode = #{warehouseCode} </if> <if test="type != null"> AND type = #{type} </if> <if test="locationId != null"> AND locationId = #{locationId} </if> <if test="locationCode != null"> AND locationCode = #{locationCode} </if> <if test="status != null"> AND status = #{status} </if> <if test="printCount != null"> AND printCount = #{printCount} </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> <if test="userDef4 != null"> AND userDef4 = #{userDef4} </if> <if test="userDef5 != null"> AND userDef5 = #{userDef5} </if> </where> </delete> </mapper>