SettingPrintMapper.xml 7.43 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.diligrp.etrade.admin.dao.SettingPrintMapper">

    <resultMap id="BaseResultMap" type="com.diligrp.etrade.admin.model.SettingPrint">
            <id property="id" column="id" jdbcType="BIGINT"/>
            <result property="marketId" column="market_id" jdbcType="BIGINT"/>
            <result property="sellerId" column="seller_id" jdbcType="BIGINT"/>
            <result property="shopId" column="shop_id" jdbcType="BIGINT"/>
            <result property="deviceId" column="device_id" jdbcType="BIGINT"/>
            <result property="printSwitch" column="print_switch" jdbcType="TINYINT"/>
            <result property="printNumber" column="print_number" jdbcType="TINYINT"/>
            <result property="printType" column="print_type" jdbcType="TINYINT"/>
            <result property="createdTime" column="created_time" jdbcType="TIMESTAMP"/>
            <result property="modifiedTime" column="modified_time" jdbcType="TIMESTAMP"/>
    </resultMap>

    <sql id="Base_Column_List">
        id,market_id,seller_id,
        shop_id,device_id,print_switch,
        print_number,print_type,created_time,
        modified_time
    </sql>

    <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from setting_print
        where  id = #{id,jdbcType=BIGINT} 
    </select>
    <select id="selectByProperty" resultType="com.diligrp.etrade.admin.model.SettingPrint">
        select * from setting_print
        <where>
            1=1
            <if test="marketId != null">
                and market_id = #{marketId,jdbcType=BIGINT}
            </if>
            <if test="sellerId != null">
                and seller_id = #{sellerId,jdbcType=BIGINT}
            </if>
            <if test="shopId != null">
                and shop_id = #{shopId,jdbcType=BIGINT}
            </if>
            <if test="deviceId != null">
                and device_id = #{deviceId,jdbcType=BIGINT}
            </if>
            <if test="printSwitch != null">
                and print_switch = #{printSwitch,jdbcType=TINYINT}
            </if>
            <if test="printNumber != null">
                and print_number = #{printNumber,jdbcType=TINYINT}
            </if>
            <if test="printType != null">
                and print_type = #{printType,jdbcType=TINYINT}
            </if>
            <if test="createdTime != null">
                and created_time = #{createdTime,jdbcType=TIMESTAMP}
            </if>
            <if test="modifiedTime != null">
                and modified_time = #{modifiedTime,jdbcType=TIMESTAMP}
            </if>
        </where>

    </select>

    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
        delete from setting_print
        where  id = #{id,jdbcType=BIGINT} 
    </delete>
    <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.diligrp.etrade.admin.model.SettingPrint" useGeneratedKeys="true">
        insert into setting_print
        ( id,market_id,seller_id
        ,shop_id,device_id,print_switch
        ,print_number,print_type,created_time
        ,modified_time)
        values (#{id,jdbcType=BIGINT},#{marketId,jdbcType=BIGINT},#{sellerId,jdbcType=BIGINT}
        ,#{shopId,jdbcType=BIGINT},#{deviceId,jdbcType=BIGINT},#{printSwitch,jdbcType=TINYINT}
        ,#{printNumber,jdbcType=TINYINT},#{printType,jdbcType=TINYINT},#{createdTime,jdbcType=TIMESTAMP}
        ,#{modifiedTime,jdbcType=TIMESTAMP})
    </insert>
    <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.diligrp.etrade.admin.model.SettingPrint" useGeneratedKeys="true">
        insert into setting_print
        <trim prefix="(" suffix=")" suffixOverrides=",">
                <if test="id != null">id,</if>
                <if test="marketId != null">market_id,</if>
                <if test="sellerId != null">seller_id,</if>
                <if test="shopId != null">shop_id,</if>
                <if test="deviceId != null">device_id,</if>
                <if test="printSwitch != null">print_switch,</if>
                <if test="printNumber != null">print_number,</if>
                <if test="printType != null">print_type,</if>
                <if test="createdTime != null">created_time,</if>
                <if test="modifiedTime != null">modified_time,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
                <if test="id != null">#{id,jdbcType=BIGINT},</if>
                <if test="marketId != null">#{marketId,jdbcType=BIGINT},</if>
                <if test="sellerId != null">#{sellerId,jdbcType=BIGINT},</if>
                <if test="shopId != null">#{shopId,jdbcType=BIGINT},</if>
                <if test="deviceId != null">#{deviceId,jdbcType=BIGINT},</if>
                <if test="printSwitch != null">#{printSwitch,jdbcType=TINYINT},</if>
                <if test="printNumber != null">#{printNumber,jdbcType=TINYINT},</if>
                <if test="printType != null">#{printType,jdbcType=TINYINT},</if>
                <if test="createdTime != null">#{createdTime,jdbcType=TIMESTAMP},</if>
                <if test="modifiedTime != null">#{modifiedTime,jdbcType=TIMESTAMP},</if>
        </trim>
    </insert>
    <update id="updateByPrimaryKeySelective" parameterType="com.diligrp.etrade.admin.model.SettingPrint">
        update setting_print
        <set>
                <if test="marketId != null">
                    market_id = #{marketId,jdbcType=BIGINT},
                </if>
                <if test="sellerId != null">
                    seller_id = #{sellerId,jdbcType=BIGINT},
                </if>
                <if test="shopId != null">
                    shop_id = #{shopId,jdbcType=BIGINT},
                </if>
                <if test="deviceId != null">
                    device_id = #{deviceId,jdbcType=BIGINT},
                </if>
                <if test="printSwitch != null">
                    print_switch = #{printSwitch,jdbcType=TINYINT},
                </if>
                <if test="printNumber != null">
                    print_number = #{printNumber,jdbcType=TINYINT},
                </if>
                <if test="printType != null">
                    print_type = #{printType,jdbcType=TINYINT},
                </if>
                <if test="createdTime != null">
                    created_time = #{createdTime,jdbcType=TIMESTAMP},
                </if>
                <if test="modifiedTime != null">
                    modified_time = #{modifiedTime,jdbcType=TIMESTAMP},
                </if>
        </set>
        where   id = #{id,jdbcType=BIGINT} 
    </update>
    <update id="updateByPrimaryKey" parameterType="com.diligrp.etrade.admin.model.SettingPrint">
        update setting_print
        set 
            market_id =  #{marketId,jdbcType=BIGINT},
            seller_id =  #{sellerId,jdbcType=BIGINT},
            shop_id =  #{shopId,jdbcType=BIGINT},
            device_id =  #{deviceId,jdbcType=BIGINT},
            print_switch =  #{printSwitch,jdbcType=TINYINT},
            print_number =  #{printNumber,jdbcType=TINYINT},
            print_type =  #{printType,jdbcType=TINYINT},
            created_time =  #{createdTime,jdbcType=TIMESTAMP},
            modified_time =  #{modifiedTime,jdbcType=TIMESTAMP}
        where   id = #{id,jdbcType=BIGINT} 
    </update>
</mapper>