Commit d46cab24 by duanhq

修改用户对应服务项信息 by duanht 2019/2/28

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@17416 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent a6cbe4d9
package com.glsx.usercenter.mapper;
import com.glsx.usercenter.pojo.user.SysUserServices;
import com.glsx.usercenter.pojo.user.SysUserServicesExample;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface SysUserServicesMapper {
long countByExample(SysUserServicesExample example);
int deleteByExample(SysUserServicesExample example);
int deleteByPrimaryKey(Integer id);
int insert(SysUserServices record);
int insertSelective(SysUserServices record);
List<SysUserServices> selectByExample(SysUserServicesExample example);
SysUserServices selectByPrimaryKey(Integer id);
int updateByExampleSelective(@Param("record") SysUserServices record, @Param("example") SysUserServicesExample example);
int updateByExample(@Param("record") SysUserServices record, @Param("example") SysUserServicesExample example);
int updateByPrimaryKeySelective(SysUserServices record);
int updateByPrimaryKey(SysUserServices record);
int deleteByUserIdAndServiceId(@Param(value = "userId") int userId ,@Param(value = "item") String item);
}
\ No newline at end of file \ No newline at end of file
package com.glsx.usercenter.pojo.user;
public class SysUserServices {
private Integer id;
private Integer userId;
private String serviceKey;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getUserId() {
return userId;
}
public void setUserId(Integer userId) {
this.userId = userId;
}
public String getServiceKey() {
return serviceKey;
}
public void setServiceKey(String serviceKey) {
this.serviceKey = serviceKey;
}
}
\ 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.SysUserServicesMapper">
<resultMap id="BaseResultMap" type="com.glsx.usercenter.pojo.user.SysUserServices">
<id column="id" jdbcType="INTEGER" property="id"/>
<result column="user_id" jdbcType="INTEGER" property="userId"/>
<result column="service_key" jdbcType="INTEGER" property="service_key"/>
</resultMap>
<sql id="Base_Column_List">
id, user_id, service_key
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from sys_user_services
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
DELETE FROM sys_user_services
WHERE id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.glsx.usercenter.pojo.user.SysUserServices">
INSERT INTO sys_user_services (id, user_id, service_key
)
VALUES (#{id,jdbcType=INTEGER}, #{userId,jdbcType=INTEGER}, #{serviceKey,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.glsx.usercenter.pojo.user.SysUserServices">
insert into sys_user_services
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="userId != null">
user_id,
</if>
<if test="serviceKey != null">
service_key,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="userId != null">
#{userId,jdbcType=INTEGER},
</if>
<if test="serviceKey != null">
#{serviceKey,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.glsx.usercenter.pojo.user.SysUserServices">
update sys_user_services
<set>
<if test="userId != null">
user_id = #{userId,jdbcType=INTEGER},
</if>
<if test="serviceKey != null">
service_key = #{serviceKey,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.glsx.usercenter.pojo.user.SysUserServices">
UPDATE sys_user_services
SET user_id = #{userId,jdbcType=INTEGER},
service_key = #{serviceKey,jdbcType=VARCHAR}
WHERE id = #{id,jdbcType=INTEGER}
</update>
<delete id="deleteByUserIdAndserviceKey">
DELETE FROM sys_user_services
WHERE user_id = #{userId,jdbcType=INTEGER} AND service_key = #{item,jdbcType=VARCHAR}
</delete>
<!--<select id="getOrgByUserId" parameterType="java.lang.Integer" resultTySysUserServicesices">-->
<!--SELECT-->
<!--so.id serviceKey,-->
<!--so.name orgName-->
<!--FROM sys_user su LEFT JOIN sys_user_services suo ON su.id = suo.user_id-->
<!--LEFT JOIN sys_organization so ON suo.service_key = so.id-->
<!--WHERE su.id = #{id,jdbcType=TINYINT}-->
<!--</select>-->
</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!