123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457 |
- <?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.jsh.erp.datasource.mappers.MaterialExtendMapper">
- <resultMap id="BaseResultMap" type="com.jsh.erp.datasource.entities.MaterialExtend">
- <id column="id" jdbcType="BIGINT" property="id" />
- <result column="material_id" jdbcType="BIGINT" property="materialId" />
- <result column="commodity_unit" jdbcType="VARCHAR" property="commodityUnit" />
- <result column="sku" jdbcType="VARCHAR" property="sku" />
- <result column="purchase_decimal" jdbcType="DECIMAL" property="purchaseDecimal" />
- <result column="commodity_decimal" jdbcType="DECIMAL" property="commodityDecimal" />
- <result column="wholesale_decimal" jdbcType="DECIMAL" property="wholesaleDecimal" />
- <result column="low_decimal" jdbcType="DECIMAL" property="lowDecimal" />
- <result column="default_flag" jdbcType="VARCHAR" property="defaultFlag" />
- <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
- <result column="create_serial" jdbcType="VARCHAR" property="createSerial" />
- <result column="update_serial" jdbcType="VARCHAR" property="updateSerial" />
- <result column="update_time" jdbcType="BIGINT" property="updateTime" />
- <result column="tenant_id" jdbcType="BIGINT" property="tenantId" />
- <result column="delete_Flag" jdbcType="VARCHAR" property="deleteFlag" />
- <result column="production_date" jdbcType="DATE" property="productionDate" />
- <result column="expiry_num" jdbcType="INTEGER" property="expiryNum" />
- <result column="supplier_id" jdbcType="BIGINT" property="supplierId" />
- <result column="bar_code" jdbcType="VARCHAR" property="barCode" />
- <result column="batch_number" jdbcType="VARCHAR" property="batchNumber" />
- <result column="inventory" jdbcType="BIGINT" property="inventory" />
- <result column="depot_id" jdbcType="BIGINT" property="depotId" />
- <result column="position" jdbcType="VARCHAR" property="position" />
- </resultMap>
- <sql id="Example_Where_Clause">
- <where>
- <foreach collection="oredCriteria" item="criteria" separator="or">
- <if test="criteria.valid">
- <trim prefix="(" prefixOverrides="and" suffix=")">
- <foreach collection="criteria.criteria" item="criterion">
- <choose>
- <when test="criterion.noValue">
- and ${criterion.condition}
- </when>
- <when test="criterion.singleValue">
- and ${criterion.condition} #{criterion.value}
- </when>
- <when test="criterion.betweenValue">
- and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
- </when>
- <when test="criterion.listValue">
- and ${criterion.condition}
- <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
- #{listItem}
- </foreach>
- </when>
- </choose>
- </foreach>
- </trim>
- </if>
- </foreach>
- </where>
- </sql>
- <sql id="Update_By_Example_Where_Clause">
- <where>
- <foreach collection="example.oredCriteria" item="criteria" separator="or">
- <if test="criteria.valid">
- <trim prefix="(" prefixOverrides="and" suffix=")">
- <foreach collection="criteria.criteria" item="criterion">
- <choose>
- <when test="criterion.noValue">
- and ${criterion.condition}
- </when>
- <when test="criterion.singleValue">
- and ${criterion.condition} #{criterion.value}
- </when>
- <when test="criterion.betweenValue">
- and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
- </when>
- <when test="criterion.listValue">
- and ${criterion.condition}
- <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
- #{listItem}
- </foreach>
- </when>
- </choose>
- </foreach>
- </trim>
- </if>
- </foreach>
- </where>
- </sql>
- <sql id="Base_Column_List">
- id, material_id, bar_code, commodity_unit, sku, purchase_decimal, commodity_decimal,
- wholesale_decimal, low_decimal, default_flag, create_time, create_serial, update_serial,
- update_time, tenant_id, delete_Flag
- </sql>
- <select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.MaterialExtendExample" resultMap="BaseResultMap">
- select
- <if test="distinct">
- distinct
- </if>
- <include refid="Base_Column_List" />
- from jsh_material_extend
- <if test="_parameter != null">
- <include refid="Example_Where_Clause" />
- </if>
- <if test="orderByClause != null">
- order by ${orderByClause}
- </if>
- </select>
- <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from jsh_material_extend
- where id = #{id,jdbcType=BIGINT}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
- delete from jsh_material_extend
- where id = #{id,jdbcType=BIGINT}
- </delete>
- <delete id="deleteByExample" parameterType="com.jsh.erp.datasource.entities.MaterialExtendExample">
- delete from jsh_material_extend
- <if test="_parameter != null">
- <include refid="Example_Where_Clause" />
- </if>
- </delete>
- <insert id="insert" parameterType="com.jsh.erp.datasource.entities.MaterialExtend">
- insert into jsh_material_extend (id, material_id, bar_code,
- commodity_unit, sku, purchase_decimal,
- commodity_decimal, wholesale_decimal, low_decimal,
- default_flag, create_time, create_serial,
- update_serial, update_time, tenant_id,
- delete_Flag)
- values (#{id,jdbcType=BIGINT}, #{materialId,jdbcType=BIGINT}, #{barCode,jdbcType=VARCHAR},
- #{commodityUnit,jdbcType=VARCHAR}, #{sku,jdbcType=VARCHAR}, #{purchaseDecimal,jdbcType=DECIMAL},
- #{commodityDecimal,jdbcType=DECIMAL}, #{wholesaleDecimal,jdbcType=DECIMAL}, #{lowDecimal,jdbcType=DECIMAL},
- #{defaultFlag,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{createSerial,jdbcType=VARCHAR},
- #{updateSerial,jdbcType=VARCHAR}, #{updateTime,jdbcType=BIGINT}, #{tenantId,jdbcType=BIGINT},
- #{deleteFlag,jdbcType=VARCHAR})
- </insert>
- <insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.MaterialExtend">
- insert into jsh_material_extend
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">
- id,
- </if>
- <if test="materialId != null">
- material_id,
- </if>
- <if test="commodityUnit != null">
- commodity_unit,
- </if>
- <if test="sku != null">
- sku,
- </if>
- <if test="purchaseDecimal != null">
- purchase_decimal,
- </if>
- <if test="commodityDecimal != null">
- commodity_decimal,
- </if>
- <if test="wholesaleDecimal != null">
- wholesale_decimal,
- </if>
- <if test="lowDecimal != null">
- low_decimal,
- </if>
- <if test="defaultFlag != null">
- default_flag,
- </if>
- <if test="createTime != null">
- create_time,
- </if>
- <if test="createSerial != null">
- create_serial,
- </if>
- <if test="updateSerial != null">
- update_serial,
- </if>
- <if test="updateTime != null">
- update_time,
- </if>
- <if test="tenantId != null">
- tenant_id,
- </if>
- <if test="deleteFlag != null">
- delete_Flag,
- </if>
- <if test="productionDate != null">
- production_date,
- </if>
- <if test="expiryNum != null">
- expiry_num,
- </if>
- <if test="supplierId != null">
- supplier_id,
- </if>
- <if test="barCode != null">
- bar_code,
- </if>
- <if test="batchNumber != null">
- batch_number,
- </if>
- <if test="inventory != null">
- inventory,
- </if>
- <if test="depotId != null">
- depot_id,
- </if>
- <if test="position != null">
- position,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null">
- #{id,jdbcType=BIGINT},
- </if>
- <if test="materialId != null">
- #{materialId,jdbcType=BIGINT},
- </if>
- <if test="commodityUnit != null">
- #{commodityUnit,jdbcType=VARCHAR},
- </if>
- <if test="sku != null">
- #{sku,jdbcType=VARCHAR},
- </if>
- <if test="purchaseDecimal != null">
- #{purchaseDecimal,jdbcType=DECIMAL},
- </if>
- <if test="commodityDecimal != null">
- #{commodityDecimal,jdbcType=DECIMAL},
- </if>
- <if test="wholesaleDecimal != null">
- #{wholesaleDecimal,jdbcType=DECIMAL},
- </if>
- <if test="lowDecimal != null">
- #{lowDecimal,jdbcType=DECIMAL},
- </if>
- <if test="defaultFlag != null">
- #{defaultFlag,jdbcType=VARCHAR},
- </if>
- <if test="createTime != null">
- #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="createSerial != null">
- #{createSerial,jdbcType=VARCHAR},
- </if>
- <if test="updateSerial != null">
- #{updateSerial,jdbcType=VARCHAR},
- </if>
- <if test="updateTime != null">
- #{updateTime,jdbcType=BIGINT},
- </if>
- <if test="tenantId != null">
- #{tenantId,jdbcType=BIGINT},
- </if>
- <if test="deleteFlag != null">
- #{deleteFlag,jdbcType=VARCHAR},
- </if>
- <if test="productionDate != null">
- #{productionDate,jdbcType=DATE},
- </if>
- <if test="expiryNum != null">
- #{expiryNum,jdbcType=INTEGER},
- </if>
- <if test="supplierId != null">
- #{supplierId,jdbcType=BIGINT},
- </if>
- <if test="barCode != null">
- #{barCode,jdbcType=VARCHAR},
- </if>
- <if test="batchNumber != null">
- #{batchNumber,jdbcType=VARCHAR},
- </if>
- <if test="inventory != null">
- #{inventory,jdbcType=DECIMAL},
- </if>
- <if test="depotId != null">
- #{depotId,jdbcType=BIGINT},
- </if>
- <if test="position != null">
- #{position,jdbcType=VARCHAR},
- </if>
- </trim>
- </insert>
- <select id="countByExample" parameterType="com.jsh.erp.datasource.entities.MaterialExtendExample" resultType="java.lang.Long">
- select count(*) from jsh_material_extend
- <if test="_parameter != null">
- <include refid="Example_Where_Clause" />
- </if>
- </select>
- <update id="updateByExampleSelective" parameterType="map">
- update jsh_material_extend
- <set>
- <if test="record.id != null">
- id = #{record.id,jdbcType=BIGINT},
- </if>
- <if test="record.materialId != null">
- material_id = #{record.materialId,jdbcType=BIGINT},
- </if>
- <if test="record.barCode != null">
- bar_code = #{record.barCode,jdbcType=VARCHAR},
- </if>
- <if test="record.commodityUnit != null">
- commodity_unit = #{record.commodityUnit,jdbcType=VARCHAR},
- </if>
- <if test="record.sku != null">
- sku = #{record.sku,jdbcType=VARCHAR},
- </if>
- <if test="record.purchaseDecimal != null">
- purchase_decimal = #{record.purchaseDecimal,jdbcType=DECIMAL},
- </if>
- <if test="record.commodityDecimal != null">
- commodity_decimal = #{record.commodityDecimal,jdbcType=DECIMAL},
- </if>
- <if test="record.wholesaleDecimal != null">
- wholesale_decimal = #{record.wholesaleDecimal,jdbcType=DECIMAL},
- </if>
- <if test="record.lowDecimal != null">
- low_decimal = #{record.lowDecimal,jdbcType=DECIMAL},
- </if>
- <if test="record.defaultFlag != null">
- default_flag = #{record.defaultFlag,jdbcType=VARCHAR},
- </if>
- <if test="record.createTime != null">
- create_time = #{record.createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="record.createSerial != null">
- create_serial = #{record.createSerial,jdbcType=VARCHAR},
- </if>
- <if test="record.updateSerial != null">
- update_serial = #{record.updateSerial,jdbcType=VARCHAR},
- </if>
- <if test="record.updateTime != null">
- update_time = #{record.updateTime,jdbcType=BIGINT},
- </if>
- <if test="record.tenantId != null">
- tenant_id = #{record.tenantId,jdbcType=BIGINT},
- </if>
- <if test="record.deleteFlag != null">
- delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR},
- </if>
- </set>
- <if test="_parameter != null">
- <include refid="Update_By_Example_Where_Clause" />
- </if>
- </update>
- <update id="updateByExample" parameterType="map">
- update jsh_material_extend
- set id = #{record.id,jdbcType=BIGINT},
- material_id = #{record.materialId,jdbcType=BIGINT},
- bar_code = #{record.barCode,jdbcType=VARCHAR},
- commodity_unit = #{record.commodityUnit,jdbcType=VARCHAR},
- sku = #{record.sku,jdbcType=VARCHAR},
- purchase_decimal = #{record.purchaseDecimal,jdbcType=DECIMAL},
- commodity_decimal = #{record.commodityDecimal,jdbcType=DECIMAL},
- wholesale_decimal = #{record.wholesaleDecimal,jdbcType=DECIMAL},
- low_decimal = #{record.lowDecimal,jdbcType=DECIMAL},
- default_flag = #{record.defaultFlag,jdbcType=VARCHAR},
- create_time = #{record.createTime,jdbcType=TIMESTAMP},
- create_serial = #{record.createSerial,jdbcType=VARCHAR},
- update_serial = #{record.updateSerial,jdbcType=VARCHAR},
- update_time = #{record.updateTime,jdbcType=BIGINT},
- tenant_id = #{record.tenantId,jdbcType=BIGINT},
- delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR}
- <if test="_parameter != null">
- <include refid="Update_By_Example_Where_Clause" />
- </if>
- </update>
- <update id="updateByPrimaryKeySelective" parameterType="com.jsh.erp.datasource.entities.MaterialExtend">
- update jsh_material_extend
- <set>
- <if test="materialId != null">
- material_id = #{materialId,jdbcType=BIGINT},
- </if>
- <if test="commodityUnit != null">
- commodity_unit = #{commodityUnit,jdbcType=VARCHAR},
- </if>
- <if test="sku != null">
- sku = #{sku,jdbcType=VARCHAR},
- </if>
- <if test="purchaseDecimal != null">
- purchase_decimal = #{purchaseDecimal,jdbcType=DECIMAL},
- </if>
- <if test="commodityDecimal != null">
- commodity_decimal = #{commodityDecimal,jdbcType=DECIMAL},
- </if>
- <if test="wholesaleDecimal != null">
- wholesale_decimal = #{wholesaleDecimal,jdbcType=DECIMAL},
- </if>
- <if test="lowDecimal != null">
- low_decimal = #{lowDecimal,jdbcType=DECIMAL},
- </if>
- <if test="defaultFlag != null">
- default_flag = #{defaultFlag,jdbcType=VARCHAR},
- </if>
- <if test="createTime != null">
- create_time = #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="createSerial != null">
- create_serial = #{createSerial,jdbcType=VARCHAR},
- </if>
- <if test="updateSerial != null">
- update_serial = #{updateSerial,jdbcType=VARCHAR},
- </if>
- <if test="updateTime != null">
- update_time = #{updateTime,jdbcType=BIGINT},
- </if>
- <if test="tenantId != null">
- tenant_id = #{tenantId,jdbcType=BIGINT},
- </if>
- <if test="deleteFlag != null">
- delete_Flag = #{deleteFlag,jdbcType=VARCHAR},
- </if>
- <if test="productionDate != null">
- production_date = #{productionDate,jdbcType=DATE},
- </if>
- <if test="expiryNum != null">
- expiry_num = #{expiryNum,jdbcType=INTEGER},
- </if>
- <if test="supplierId != null">
- supplier_id = #{supplierId,jdbcType=BIGINT},
- </if>
- <if test="barCode != null">
- bar_code = #{barCode,jdbcType=VARCHAR},
- </if>
- <if test="inventory != null">
- inventory = #{inventory,jdbcType=DECIMAL},
- </if>
- <if test="depotId != null">
- depot_id = #{depotId,jdbcType=BIGINT},
- </if>
- <if test="position != null">
- position = #{position,jdbcType=VARCHAR},
- </if>
- </set>
- where id = #{id,jdbcType=BIGINT}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.jsh.erp.datasource.entities.MaterialExtend">
- update jsh_material_extend
- set material_id = #{materialId,jdbcType=BIGINT},
- bar_code = #{barCode,jdbcType=VARCHAR},
- commodity_unit = #{commodityUnit,jdbcType=VARCHAR},
- sku = #{sku,jdbcType=VARCHAR},
- purchase_decimal = #{purchaseDecimal,jdbcType=DECIMAL},
- commodity_decimal = #{commodityDecimal,jdbcType=DECIMAL},
- wholesale_decimal = #{wholesaleDecimal,jdbcType=DECIMAL},
- low_decimal = #{lowDecimal,jdbcType=DECIMAL},
- default_flag = #{defaultFlag,jdbcType=VARCHAR},
- create_time = #{createTime,jdbcType=TIMESTAMP},
- create_serial = #{createSerial,jdbcType=VARCHAR},
- update_serial = #{updateSerial,jdbcType=VARCHAR},
- update_time = #{updateTime,jdbcType=BIGINT},
- tenant_id = #{tenantId,jdbcType=BIGINT},
- delete_Flag = #{deleteFlag,jdbcType=VARCHAR}
- where id = #{id,jdbcType=BIGINT}
- </update>
- </mapper>
|