123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172 |
- <?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.bz.smart_city.dao.PlanMapper">
- <!--auto generated Code-->
- <resultMap id="BaseResultMap" type="com.bz.smart_city.entity.Plan">
- <result column="id" property="id" jdbcType="INTEGER"/>
- <result column="site_id" property="siteId" jdbcType="INTEGER"/>
- <result column="plan_name" property="planName" jdbcType="VARCHAR"/>
- <result column="picture" property="picture" jdbcType="VARCHAR"/>
- <result column="length" property="length" jdbcType="VARCHAR"/>
- <result column="width" property="width" jdbcType="VARCHAR"/>
- <result column="proportion" property="proportion" jdbcType="VARCHAR"/>
- <result column="status" property="status" jdbcType="INTEGER"/>
- <result column="date_create" property="dateCreate" jdbcType="TIMESTAMP"/>
- <result column="date_update" property="dateUpdate" jdbcType="TIMESTAMP"/>
- <result column="create_by" property="createBy" jdbcType="VARCHAR"/>
- <result column="update_by" property="updateBy" jdbcType="VARCHAR"/>
- </resultMap>
- <!--auto generated Code-->
- <sql id="Base_Column_List">
- id,
- site_id,
- plan_name,
- picture,
- length,
- width,
- proportion,
- status,
- date_create,
- date_update,
- create_by,
- update_by
- </sql>
- <!--auto generated Code-->
- <insert id="insert" useGeneratedKeys="true" keyProperty="plan.id">
- INSERT INTO sc_plan (
- id,
- site_id,
- plan_name,
- picture,
- length,
- width,
- proportion,
- status,
- date_create,
- date_update,
- create_by,
- update_by
- ) VALUES (
- #{plan.id,jdbcType=INTEGER},
- #{plan.siteId,jdbcType=INTEGER},
- #{plan.planName,jdbcType=VARCHAR},
- #{plan.picture,jdbcType=VARCHAR},
- #{plan.length,jdbcType=VARCHAR},
- #{plan.width,jdbcType=VARCHAR},
- #{plan.proportion,jdbcType=VARCHAR},
- #{plan.status,jdbcType=INTEGER},
- #{plan.dateCreate,jdbcType=TIMESTAMP},
- #{plan.dateUpdate,jdbcType=TIMESTAMP},
- #{plan.createBy,jdbcType=VARCHAR},
- #{plan.updateBy,jdbcType=VARCHAR}
- )
- </insert>
- <!--auto generated Code-->
- <insert id="insertSelective" useGeneratedKeys="true" keyProperty="plan.id">
- INSERT INTO sc_plan
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="plan.id!=null"> id,</if>
- <if test="plan.siteId!=null"> site_id,</if>
- <if test="plan.planName!=null"> plan_name,</if>
- <if test="plan.picture!=null"> picture,</if>
- <if test="plan.length!=null"> length,</if>
- <if test="plan.width!=null"> width,</if>
- <if test="plan.proportion!=null"> proportion,</if>
- <if test="plan.status!=null"> status,</if>
- <if test="plan.dateCreate!=null"> date_create,</if>
- <if test="plan.dateUpdate!=null"> date_update,</if>
- <if test="plan.createBy!=null"> create_by,</if>
- <if test="plan.updateBy!=null"> update_by,</if>
- </trim>
- VALUES
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="plan.id!=null">#{plan.id,jdbcType=INTEGER},
- </if>
- <if test="plan.siteId!=null">#{plan.siteId,jdbcType=INTEGER},
- </if>
- <if test="plan.planName!=null">#{plan.planName,jdbcType=VARCHAR},
- </if>
- <if test="plan.picture!=null">#{plan.picture,jdbcType=VARCHAR},
- </if>
- <if test="plan.length!=null">#{plan.length,jdbcType=VARCHAR},
- </if>
- <if test="plan.width!=null">#{plan.width,jdbcType=VARCHAR},
- </if>
- <if test="plan.proportion!=null">#{plan.proportion,jdbcType=VARCHAR},
- </if>
- <if test="plan.status!=null">#{plan.status,jdbcType=INTEGER},
- </if>
- <if test="plan.dateCreate!=null">#{plan.dateCreate,jdbcType=TIMESTAMP},
- </if>
- <if test="plan.dateUpdate!=null">#{plan.dateUpdate,jdbcType=TIMESTAMP},
- </if>
- <if test="plan.createBy!=null">#{plan.createBy,jdbcType=VARCHAR},
- </if>
- <if test="plan.updateBy!=null">#{plan.updateBy,jdbcType=VARCHAR},
- </if>
- </trim>
- </insert>
- <!--auto generated Code-->
- <insert id="insertList">
- INSERT INTO sc_plan (
- id,
- site_id,
- plan_name,
- picture,
- length,
- width,
- proportion,
- status,
- date_create,
- date_update,
- create_by,
- update_by
- )VALUES
- <foreach collection="plans" item="plan" index="index" separator=",">
- (
- #{plan.id,jdbcType=INTEGER},
- #{plan.siteId,jdbcType=INTEGER},
- #{plan.planName,jdbcType=VARCHAR},
- #{plan.picture,jdbcType=VARCHAR},
- #{plan.length,jdbcType=VARCHAR},
- #{plan.width,jdbcType=VARCHAR},
- #{plan.proportion,jdbcType=VARCHAR},
- #{plan.status,jdbcType=INTEGER},
- #{plan.dateCreate,jdbcType=TIMESTAMP},
- #{plan.dateUpdate,jdbcType=TIMESTAMP},
- #{plan.createBy,jdbcType=VARCHAR},
- #{plan.updateBy,jdbcType=VARCHAR}
- )
- </foreach>
- </insert>
- <!--auto generated Code-->
- <update id="updateByPrimaryKeySelective">
- UPDATE sc_plan
- <set>
- <if test="plan.siteId != null"> site_id= #{plan.siteId,jdbcType=INTEGER},</if>
- <if test="plan.planName != null"> plan_name= #{plan.planName,jdbcType=VARCHAR},</if>
- <if test="plan.picture != null"> picture= #{plan.picture,jdbcType=VARCHAR},</if>
- <if test="plan.length != null"> length= #{plan.length,jdbcType=VARCHAR},</if>
- <if test="plan.width != null"> width= #{plan.width,jdbcType=VARCHAR},</if>
- <if test="plan.proportion != null"> proportion= #{plan.proportion,jdbcType=VARCHAR},</if>
- <if test="plan.status != null"> status= #{plan.status,jdbcType=INTEGER},</if>
- <if test="plan.dateCreate != null"> date_create= #{plan.dateCreate,jdbcType=TIMESTAMP},</if>
- <if test="plan.dateUpdate != null"> date_update= #{plan.dateUpdate,jdbcType=TIMESTAMP},</if>
- <if test="plan.createBy != null"> create_by= #{plan.createBy,jdbcType=VARCHAR},</if>
- <if test="plan.updateBy != null"> update_by= #{plan.updateBy,jdbcType=VARCHAR}</if>
- </set>
- WHERE id = #{plan.id,jdbcType=INTEGER}
- </update>
- <select id="getList" resultMap="BaseResultMap">
- select <include refid="Base_Column_List"/> from sc_plan
- where status = 1
- <if test="siteId != null"> and site_id = #{siteId} </if>
- </select>
- </mapper>
|