<?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.receipt.receiptContainerHeader.mapper.ReceiptContainerHeaderAutoMapper"> <select id="selectListEntityByLike" resultType="com.huaheng.pc.receipt.receiptContainerHeader.domain.ReceiptContainerHeader"> SELECT id, receiptContainerCode, locationCode, warehouseId, warehouseCode, taskType, status, created, createdBy FROM receipt_container_header <where> <if test="id != null"> AND id = #{id} </if> <if test="receiptContainerCode != null"> AND receiptContainerCode like #{receiptContainerCode} </if> <if test="locationCode != null"> AND locationCode like #{locationCode} </if> <if test="warehouseId != null"> AND warehouseId = #{warehouseId} </if> <if test="warehouseCode != null"> AND warehouseCode like #{warehouseCode} </if> <if test="taskType != null"> AND taskType = #{taskType} </if> <if test="status != null"> AND status = #{status} </if> <if test="created != null"> AND created = #{created} </if> <if test="createdBy != null"> AND createdBy like #{createdBy} </if> </where> </select> <select id="selectListEntityByEqual" resultType="com.huaheng.pc.receipt.receiptContainerHeader.domain.ReceiptContainerHeader"> SELECT id, receiptContainerCode, locationCode, warehouseId, warehouseCode, taskType, status, created, createdBy FROM receipt_container_header <where> <if test="id != null"> AND id = #{id} </if> <if test="receiptContainerCode != null"> AND receiptContainerCode = #{receiptContainerCode} </if> <if test="locationCode != null"> AND locationCode = #{locationCode} </if> <if test="warehouseId != null"> AND warehouseId = #{warehouseId} </if> <if test="warehouseCode != null"> AND warehouseCode = #{warehouseCode} </if> <if test="taskType != null"> AND taskType = #{taskType} </if> <if test="status != null"> AND status = #{status} </if> <if test="created != null"> AND created = #{created} </if> <if test="createdBy != null"> AND createdBy = #{createdBy} </if> </where> </select> <select id="selectListMapByEqual" resultType="java.util.HashMap"> SELECT #{columns} FROM receipt_container_header <where> <if test="condition.id != null"> AND id = #{condition.id} </if> <if test="condition.receiptContainerCode != null"> AND receiptContainerCode = #{condition.receiptContainerCode} </if> <if test="condition.locationCode != null"> AND locationCode = #{condition.locationCode} </if> <if test="condition.warehouseId != null"> AND warehouseId = #{condition.warehouseId} </if> <if test="condition.warehouseCode != null"> AND warehouseCode = #{condition.warehouseCode} </if> <if test="condition.taskType != null"> AND taskType = #{condition.taskType} </if> <if test="condition.status != null"> AND status = #{condition.status} </if> <if test="condition.created != null"> AND created = #{condition.created} </if> <if test="condition.createdBy != null"> AND createdBy = #{condition.createdBy} </if> </where> </select> <select id="selectEntityById" resultType="com.huaheng.pc.receipt.receiptContainerHeader.domain.ReceiptContainerHeader"> SELECT id, receiptContainerCode, locationCode, warehouseId, warehouseCode, taskType, status, created, createdBy FROM receipt_container_header WHERE id = #{id} </select> <select id="selectFirstEntity" resultType="com.huaheng.pc.receipt.receiptContainerHeader.domain.ReceiptContainerHeader"> SELECT id, receiptContainerCode, locationCode, warehouseId, warehouseCode, taskType, status, created, createdBy FROM receipt_container_header <where> <if test="id != null"> AND id = #{id} </if> <if test="receiptContainerCode != null"> AND receiptContainerCode = #{receiptContainerCode} </if> <if test="locationCode != null"> AND locationCode = #{locationCode} </if> <if test="warehouseId != null"> AND warehouseId = #{warehouseId} </if> <if test="warehouseCode != null"> AND warehouseCode = #{warehouseCode} </if> <if test="taskType != null"> AND taskType = #{taskType} </if> <if test="status != null"> AND status = #{status} </if> <if test="created != null"> AND created = #{created} </if> <if test="createdBy != null"> AND createdBy = #{createdBy} </if> </where> LIMIT 1 </select> <select id="selectFirstMap" resultType="java.util.HashMap"> SELECT #{columns} FROM receipt_container_header <where> <if test="condition.id != null"> AND id = #{condition.id} </if> <if test="condition.receiptContainerCode != null"> AND receiptContainerCode = #{condition.receiptContainerCode} </if> <if test="condition.locationCode != null"> AND locationCode = #{condition.locationCode} </if> <if test="condition.warehouseId != null"> AND warehouseId = #{condition.warehouseId} </if> <if test="condition.warehouseCode != null"> AND warehouseCode = #{condition.warehouseCode} </if> <if test="condition.taskType != null"> AND taskType = #{condition.taskType} </if> <if test="condition.status != null"> AND status = #{condition.status} </if> <if test="condition.created != null"> AND created = #{condition.created} </if> <if test="condition.createdBy != null"> AND createdBy = #{condition.createdBy} </if> </where> LIMIT 1 </select> <insert id="insert" parameterType="com.huaheng.pc.receipt.receiptContainerHeader.domain.ReceiptContainerHeader" keyProperty="id" useGeneratedKeys="true" > INSERT INTO receipt_container_header <trim prefix="(" suffix=")" suffixOverrides=","> <if test="receiptContainerCode != null"> receiptContainerCode, </if> <if test="locationCode != null"> locationCode, </if> <if test="warehouseId != null"> warehouseId, </if> <if test="warehouseCode != null"> warehouseCode, </if> <if test="taskType != null"> taskType, </if> <if test="status != null"> status, </if> <if test="created != null"> created, </if> <if test="createdBy != null"> createdBy, </if> </trim> <trim prefix=" values (" suffix=")" suffixOverrides=","> <if test="receiptContainerCode != null"> #{receiptContainerCode, jdbcType=VARCHAR}, </if> <if test="locationCode != null"> #{locationCode, jdbcType=VARCHAR}, </if> <if test="warehouseId != null"> #{warehouseId, jdbcType=INTEGER}, </if> <if test="warehouseCode != null"> #{warehouseCode, jdbcType=VARCHAR}, </if> <if test="taskType != null"> #{taskType, jdbcType=SMALLINT}, </if> <if test="status != null"> #{status, jdbcType=SMALLINT}, </if> <if test="created != null"> #{created, jdbcType=TIMESTAMP}, </if> <if test="createdBy != null"> #{createdBy, jdbcType=VARCHAR}, </if> </trim> </insert> <update id="updateByModel"> UPDATE receipt_container_header <set> <if test="receiptContainerCode != null"> receiptContainerCode = #{receiptContainerCode, jdbcType=VARCHAR}, </if> <if test="locationCode != null"> locationCode = #{locationCode, jdbcType=VARCHAR}, </if> <if test="warehouseId != null"> warehouseId = #{warehouseId, jdbcType=INTEGER}, </if> <if test="warehouseCode != null"> warehouseCode = #{warehouseCode, jdbcType=VARCHAR}, </if> <if test="taskType != null"> taskType = #{taskType, jdbcType=SMALLINT}, </if> <if test="status != null"> status = #{status, jdbcType=SMALLINT}, </if> <if test="created != null"> created = #{created, jdbcType=TIMESTAMP}, </if> <if test="createdBy != null"> createdBy = #{createdBy, jdbcType=VARCHAR}, </if> </set> WHERE id = #{id,jdbcType=INTEGER} </update> <update id="updateByCondition"> UPDATE receipt_container_header <set> <if test="record.receiptContainerCode != null"> receiptContainerCode = #{record.receiptContainerCode, jdbcType=VARCHAR}, </if> <if test="record.locationCode != null"> locationCode = #{record.locationCode, 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.taskType != null"> taskType = #{record.taskType, jdbcType=SMALLINT}, </if> <if test="record.status != null"> status = #{record.status, jdbcType=SMALLINT}, </if> <if test="record.created != null"> created = #{record.created, jdbcType=TIMESTAMP}, </if> <if test="record.createdBy != null"> createdBy = #{record.createdBy, jdbcType=VARCHAR}, </if> </set> <where> <if test="condition.id != null"> AND id = #{condition.id} </if> <if test="condition.receiptContainerCode != null"> AND receiptContainerCode = #{condition.receiptContainerCode} </if> <if test="condition.locationCode != null"> AND locationCode = #{condition.locationCode} </if> <if test="condition.warehouseId != null"> AND warehouseId = #{condition.warehouseId} </if> <if test="condition.warehouseCode != null"> AND warehouseCode = #{condition.warehouseCode} </if> <if test="condition.taskType != null"> AND taskType = #{condition.taskType} </if> <if test="condition.status != null"> AND status = #{condition.status} </if> <if test="condition.created != null"> AND created = #{condition.created} </if> <if test="condition.createdBy != null"> AND createdBy = #{condition.createdBy} </if> </where> </update> <delete id="deleteById"> DELETE FROM receipt_container_header WHERE id = #{id, jdbcType=INTEGER} </delete> <delete id="deleteByCondition"> DELETE FROM receipt_container_header <where> <if test="id != null"> AND id = #{id} </if> <if test="receiptContainerCode != null"> AND receiptContainerCode = #{receiptContainerCode} </if> <if test="locationCode != null"> AND locationCode = #{locationCode} </if> <if test="warehouseId != null"> AND warehouseId = #{warehouseId} </if> <if test="warehouseCode != null"> AND warehouseCode = #{warehouseCode} </if> <if test="taskType != null"> AND taskType = #{taskType} </if> <if test="status != null"> AND status = #{status} </if> <if test="created != null"> AND created = #{created} </if> <if test="createdBy != null"> AND createdBy = #{createdBy} </if> </where> </delete> </mapper>