123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- <?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.ygj.yuemum.dao.admin.JlRegionDao" >
- <resultMap id="BaseResultMap" type="com.ygj.yuemum.domain.admin.JlRegion" >
- <id column="id" property="id" jdbcType="INTEGER" />
- <result column="pid" property="pid" jdbcType="INTEGER" />
- <result column="name" property="name" jdbcType="VARCHAR" />
- <result column="sort" property="sort" jdbcType="INTEGER" />
- <result column="code" property="code" jdbcType="VARCHAR" />
- <result column="type" property="type" jdbcType="INTEGER" />
- <result column="is_service" property="is_service" jdbcType="INTEGER" />
- <result column="updated_at" property="updated_at" jdbcType="DATE" />
- </resultMap>
- <sql id="Base_Column_List" >
- id, pid, name,sort,code,type,is_service,updated_at
- </sql>
- <!-- 得到所有的城市信息 -->
- <select id="getAll" resultMap="BaseResultMap" >
- select
- <include refid="Base_Column_List" />
- from jl_region
- </select>
- <!-- 根据id查找某个城市信息 -->
- <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
- select
- <include refid="Base_Column_List" />
- from jl_region
- where pid = #{pid,jdbcType=INTEGER}
- </select>
- <!-- 根据id删除某个城市信息 -->
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
- delete from jl_region
- where id = #{id,jdbcType=INTEGER}
- </delete>
- <!-- 插入一条城市信息 -->
- <insert id="insertSelective" parameterType="com.ygj.yuemum.domain.admin.JlRegion" >
- insert into jl_region
- <trim prefix="(" suffix=")" suffixOverrides="," >
- <if test="pid != null" >
- pid,
- </if>
- <if test="name != null" >
- name,
- </if>
- <if test="sort != null" >
- sort,
- </if>
- <if test="code != null" >
- code,
- </if>
- <if test="type != null" >
- type,
- </if>
- <if test="is_service != null" >
- is_service,
- </if>
- <if test="updated_at != null" >
- updated_at,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides="," >
- <if test="pid != null" >
- #{pid,jdbcType=INTEGER},
- </if>
- <if test="name != null" >
- #{name,jdbcType=VARCHAR},
- </if>
- <if test="sort != null" >
- #{sort,jdbcType=INTEGER},
- </if>
- <if test="code != null" >
- #{code,jdbcType=VARCHAR},
- </if>
- <if test="type != null" >
- #{type,jdbcType=INTEGER},
- </if>
- <if test="is_service != null" >
- #{is_service,jdbcType=INTEGER},
- </if>
- <if test="updated_at != null" >
- #{updated_at,jdbcType=DATE},
- </if>
- </trim>
- </insert>
- <!-- 根据id更新一条城市信息 -->
- <update id="updateByPrimaryKeySelective" parameterType="com.ygj.yuemum.domain.admin.JlRegion" >
- update jl_region
- <set >
- <if test="pid != null" >
- pid = #{pid,jdbcType=INTEGER},
- </if>
- <if test="name != null" >
- name = #{name,jdbcType=VARCHAR},
- </if>
- <if test="sort != null" >
- sort = #{sort,jdbcType=INTEGER},
- </if>
- <if test="code != null" >
- code = #{code,jdbcType=VARCHAR},
- </if>
- <if test="type != null" >
- type = #{type,jdbcType=INTEGER},
- </if>
- <if test="is_service != null" >
- is_service = #{is_service,jdbcType=INTEGER},
- </if>
- <if test="updated_at != null" >
- updated_at = #{updated_at,jdbcType=DATE},
- </if>
- </set>
- where id = #{id,jdbcType=INTEGER}
- </update>
- </mapper>
|