Commit a7600d4b by duanhq

资源绑定类 by duanht 2019/1/23

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@16959 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent 96b03738
package com.glsx.usercenter.mapper;
import com.glsx.usercenter.pojo.user.SysResourceMatching;
import com.glsx.usercenter.pojo.user.SysResourceMatchingExample;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface SysResourceMatchingMapper {
long countByExample(SysResourceMatchingExample example);
int deleteByExample(SysResourceMatchingExample example);
int deleteByPrimaryKey(Integer id);
int insert(SysResourceMatching record);
int insertSelective(SysResourceMatching record);
List<SysResourceMatching> selectByExample(SysResourceMatchingExample example);
SysResourceMatching selectByPrimaryKey(Integer id);
int updateByExampleSelective(@Param("record") SysResourceMatching record, @Param("example") SysResourceMatchingExample example);
int updateByExample(@Param("record") SysResourceMatching record, @Param("example") SysResourceMatchingExample example);
int updateByPrimaryKeySelective(SysResourceMatching record);
int updateByPrimaryKey(SysResourceMatching record);
}
\ No newline at end of file \ No newline at end of file
package com.glsx.usercenter.pojo.user;
public class SysResourceMatching {
private Integer id;
private Integer merchantId;
private Integer userId;
private Integer serviceId;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getMerchantId() {
return merchantId;
}
public void setMerchantId(Integer merchantId) {
this.merchantId = merchantId;
}
public Integer getUserId() {
return userId;
}
public void setUserId(Integer userId) {
this.userId = userId;
}
public Integer getServiceId() {
return serviceId;
}
public void setServiceId(Integer serviceId) {
this.serviceId = serviceId;
}
}
\ No newline at end of file \ 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.usercenter.mapper.SysResourceMatchingMapper">
<resultMap id="BaseResultMap" type="com.glsx.manager.pojo.SysResourceMatching">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="merchant_id" jdbcType="INTEGER" property="merchantId" />
<result column="user_id" jdbcType="INTEGER" property="userId" />
<result column="service_id" jdbcType="INTEGER" property="serviceId" />
</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="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.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, merchant_id, user_id, service_id
</sql>
<select id="selectByExample" parameterType="com.glsx.manager.pojo.SysResourceMatchingExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
'false' as QUERYID,
<include refid="Base_Column_List" />
from sys_resource_matching
<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_resource_matching
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from sys_resource_matching
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.glsx.manager.pojo.SysResourceMatchingExample">
delete from sys_resource_matching
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.glsx.manager.pojo.SysResourceMatching">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into sys_resource_matching (merchant_id, user_id, service_id
)
values (#{merchantId,jdbcType=INTEGER}, #{userId,jdbcType=INTEGER}, #{serviceId,jdbcType=INTEGER}
)
</insert>
<insert id="insertSelective" parameterType="com.glsx.manager.pojo.SysResourceMatching">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into sys_resource_matching
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="merchantId != null">
merchant_id,
</if>
<if test="userId != null">
user_id,
</if>
<if test="serviceId != null">
service_id,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="merchantId != null">
#{merchantId,jdbcType=INTEGER},
</if>
<if test="userId != null">
#{userId,jdbcType=INTEGER},
</if>
<if test="serviceId != null">
#{serviceId,jdbcType=INTEGER},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.glsx.manager.pojo.SysResourceMatchingExample" resultType="java.lang.Long">
select count(*) from sys_resource_matching
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update sys_resource_matching
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=INTEGER},
</if>
<if test="record.merchantId != null">
merchant_id = #{record.merchantId,jdbcType=INTEGER},
</if>
<if test="record.userId != null">
user_id = #{record.userId,jdbcType=INTEGER},
</if>
<if test="record.serviceId != null">
service_id = #{record.serviceId,jdbcType=INTEGER},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update sys_resource_matching
set id = #{record.id,jdbcType=INTEGER},
merchant_id = #{record.merchantId,jdbcType=INTEGER},
user_id = #{record.userId,jdbcType=INTEGER},
service_id = #{record.serviceId,jdbcType=INTEGER}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.glsx.manager.pojo.SysResourceMatching">
update sys_resource_matching
<set>
<if test="merchantId != null">
merchant_id = #{merchantId,jdbcType=INTEGER},
</if>
<if test="userId != null">
user_id = #{userId,jdbcType=INTEGER},
</if>
<if test="serviceId != null">
service_id = #{serviceId,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.glsx.manager.pojo.SysResourceMatching">
update sys_resource_matching
set merchant_id = #{merchantId,jdbcType=INTEGER},
user_id = #{userId,jdbcType=INTEGER},
service_id = #{serviceId,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>
\ No newline at end of file \ 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!