<?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.newfiber.api.pc.dao.RiverManage.PartolManagePicDao"> <resultMap id="BaseResultMap" type="com.newfiber.api.pc.model.River.PartolManagePic"> <id column="id" jdbcType="BIGINT" property="id" /> <result column="pic_no" jdbcType="VARCHAR" property="picNo" /> <result column="pic_name" jdbcType="VARCHAR" property="picName" /> <result column="pic_address" jdbcType="VARCHAR" property="picAddress" /> <result column="create_user_no" jdbcType="VARCHAR" property="createUserNo" /> <result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> <result column="type" jdbcType="TINYINT" property="type" /> </resultMap> <sql id="Base_Column_List"> id, pic_no, pic_name, pic_address, create_user_no, create_time, type </sql> <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> select <include refid="Base_Column_List" /> from partol_manage_pic where id = #{id,jdbcType=BIGINT} </select> <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> delete from partol_manage_pic where id = #{id,jdbcType=BIGINT} </delete> <insert id="insert" parameterType="com.newfiber.api.pc.model.River.PartolManagePic"> insert into partol_manage_pic (id, pic_no, pic_name, pic_address, create_user_no, create_time, type) values (#{id,jdbcType=BIGINT}, #{picNo,jdbcType=VARCHAR}, #{picName,jdbcType=VARCHAR}, #{picAddress,jdbcType=VARCHAR}, #{createUserNo,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{type,jdbcType=TINYINT}) </insert> <insert id="insertSelective" parameterType="com.newfiber.api.pc.model.River.PartolManagePic"> insert into partol_manage_pic <trim prefix="(" suffix=")" suffixOverrides=","> <if test="id != null"> id, </if> <if test="picNo != null"> pic_no, </if> <if test="picName != null"> pic_name, </if> <if test="picAddress != null"> pic_address, </if> <if test="createUserNo != null"> create_user_no, </if> <if test="createTime != null"> create_time, </if> <if test="type != null"> type, </if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> <if test="id != null"> #{id,jdbcType=BIGINT}, </if> <if test="picNo != null"> #{picNo,jdbcType=VARCHAR}, </if> <if test="picName != null"> #{picName,jdbcType=VARCHAR}, </if> <if test="picAddress != null"> #{picAddress,jdbcType=VARCHAR}, </if> <if test="createUserNo != null"> #{createUserNo,jdbcType=VARCHAR}, </if> <if test="createTime != null"> #{createTime,jdbcType=TIMESTAMP}, </if> <if test="type != null"> #{type,jdbcType=TINYINT}, </if> </trim> </insert> <update id="updateByPrimaryKeySelective" parameterType="com.newfiber.api.pc.model.River.PartolManagePic"> update partol_manage_pic <set> <if test="picNo != null"> pic_no = #{picNo,jdbcType=VARCHAR}, </if> <if test="picName != null"> pic_name = #{picName,jdbcType=VARCHAR}, </if> <if test="picAddress != null"> pic_address = #{picAddress,jdbcType=VARCHAR}, </if> <if test="createUserNo != null"> create_user_no = #{createUserNo,jdbcType=VARCHAR}, </if> <if test="createTime != null"> create_time = #{createTime,jdbcType=TIMESTAMP}, </if> <if test="type != null"> type = #{type,jdbcType=TINYINT}, </if> </set> where id = #{id,jdbcType=BIGINT} </update> <update id="updateByPrimaryKey" parameterType="com.newfiber.api.pc.model.River.PartolManagePic"> update partol_manage_pic set pic_no = #{picNo,jdbcType=VARCHAR}, pic_name = #{picName,jdbcType=VARCHAR}, pic_address = #{picAddress,jdbcType=VARCHAR}, create_user_no = #{createUserNo,jdbcType=VARCHAR}, create_time = #{createTime,jdbcType=TIMESTAMP}, type = #{type,jdbcType=TINYINT} where id = #{id,jdbcType=BIGINT} </update> <insert id="insertBatch"> insert into partol_manage_pic (pic_no,pic_name,pic_address,create_user_no,type) values <foreach collection="list" item="item" separator=","> (#{item.picNo},#{item.picName},#{item.picAddress},#{item.createUserNo},#{item.type}) </foreach> </insert> <select id="selectByPicNo" resultMap="BaseResultMap"> SELECT <include refid="Base_Column_List"/> FROM `partol_manage_pic` pic where 1=1 <if test="collect != null and collect.size > 0"> and pic.pic_no in <foreach collection="collect" index="index" item="item" open="(" separator="," close=")"> #{item} </foreach> </if> </select> </mapper>