Commit 46b0405d by zhengxj

finish 区域地址相关的mapper,实体类 on 20190123 by zhengxj

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@16947 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent 99887760
package com.glsx.ordercenter.mapper;
import java.util.List;
import com.glsx.ordercenter.pojo.SysArea;
import com.glsx.ordercenter.pojo.SysAreaExample;
public interface SysAreaMapper {
long countByExample(SysAreaExample example);
int deleteByPrimaryKey(Integer id);
int insert(SysArea record);
int insertSelective(SysArea record);
List<SysArea> selectByExample(SysAreaExample example);
SysArea selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(SysArea record);
int updateByPrimaryKey(SysArea record);
}
\ No newline at end of file
package com.glsx.ordercenter.pojo;
import java.util.Date;
public class SysArea {
private Integer id;
private String areaName;
private String areaCode;
private Integer parentId;
private Date initDate;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getAreaName() {
return areaName;
}
public void setAreaName(String areaName) {
this.areaName = areaName == null ? null : areaName.trim();
}
public String getAreaCode() {
return areaCode;
}
public void setAreaCode(String areaCode) {
this.areaCode = areaCode == null ? null : areaCode.trim();
}
public Integer getParentId() {
return parentId;
}
public void setParentId(Integer parentId) {
this.parentId = parentId;
}
public Date getInitDate() {
return initDate;
}
public void setInitDate(Date initDate) {
this.initDate = initDate;
}
}
\ No newline at end of file
<?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.glsx.ordercenter.mapper.SysAreaMapper">
<resultMap id="BaseResultMap" type="com.glsx.ordercenter.pojo.SysArea">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="area_name" jdbcType="VARCHAR" property="areaName" />
<result column="area_code" jdbcType="VARCHAR" property="areaCode" />
<result column="parent_id" jdbcType="INTEGER" property="parentId" />
<result column="init_date" jdbcType="TIMESTAMP" property="initDate" />
</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="Base_Column_List">
id, area_name, area_code, parent_id, init_date
</sql>
<select id="selectByExample" parameterType="com.glsx.ordercenter.pojo.SysAreaExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
'false' as QUERYID,
<include refid="Base_Column_List" />
from sys_area
<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.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from sys_area
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from sys_area
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.glsx.ordercenter.pojo.SysArea">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into sys_area (area_name, area_code, parent_id,
init_date)
values (#{areaName,jdbcType=VARCHAR}, #{areaCode,jdbcType=VARCHAR}, #{parentId,jdbcType=INTEGER},
#{initDate,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.glsx.ordercenter.pojo.SysArea">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into sys_area
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="areaName != null">
area_name,
</if>
<if test="areaCode != null">
area_code,
</if>
<if test="parentId != null">
parent_id,
</if>
<if test="initDate != null">
init_date,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="areaName != null">
#{areaName,jdbcType=VARCHAR},
</if>
<if test="areaCode != null">
#{areaCode,jdbcType=VARCHAR},
</if>
<if test="parentId != null">
#{parentId,jdbcType=INTEGER},
</if>
<if test="initDate != null">
#{initDate,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.glsx.ordercenter.pojo.SysAreaExample" resultType="java.lang.Long">
select count(*) from sys_area
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByPrimaryKeySelective" parameterType="com.glsx.ordercenter.pojo.SysArea">
update sys_area
<set>
<if test="areaName != null">
area_name = #{areaName,jdbcType=VARCHAR},
</if>
<if test="areaCode != null">
area_code = #{areaCode,jdbcType=VARCHAR},
</if>
<if test="parentId != null">
parent_id = #{parentId,jdbcType=INTEGER},
</if>
<if test="initDate != null">
init_date = #{initDate,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.glsx.ordercenter.pojo.SysArea">
update sys_area
set area_name = #{areaName,jdbcType=VARCHAR},
area_code = #{areaCode,jdbcType=VARCHAR},
parent_id = #{parentId,jdbcType=INTEGER},
init_date = #{initDate,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!