123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184 |
- <?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.xinxin.topro.pubservice.mysqlmapper.SysWardPermissionMapper" >
- <resultMap id="BaseResultMap" type="com.xinxin.topro.pubservice.mysqlModel.SysWardPermission" >
- <id column="SWP_ID" property="swpId" jdbcType="INTEGER" />
- <result column="HI_ID" property="hiId" jdbcType="INTEGER" />
- <result column="DW_WardDm" property="dwWarddm" jdbcType="VARCHAR" />
- <result column="UI_Code" property="uiCode" jdbcType="VARCHAR" />
- <result column="SS_ID" property="ssId" jdbcType="INTEGER" />
- <result column="SWP_Recordor" property="swpRecordor" jdbcType="VARCHAR" />
- <result column="SWP_Record_Time" property="swpRecordTime" jdbcType="TIMESTAMP" />
- <result column="SWP_IsDel" property="swpIsdel" jdbcType="INTEGER" />
- <result column="SWP_IsDefault" property="swpIsdefault" jdbcType="INTEGER" />
- </resultMap>
- <resultMap id="ExtendsMap" type="com.xinxin.topro.pubservice.mysqlModel.SysWardPermissionVO" extends="BaseResultMap">
- <result column="RecordorName" property="recorderName" jdbcType="VARCHAR" />
- <result column="DW_WardName" property="wardName" jdbcType="VARCHAR" />
- </resultMap>
- <sql id="Base_Column_List" >
- SWP_ID, HI_ID, DW_WardDm, UI_Code, SS_ID, SWP_Recordor, SWP_Record_Time, SWP_IsDel,
- SWP_IsDefault
- </sql>
- <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
- select
- <include refid="Base_Column_List" />
- from sys_ward_permission
- where SWP_ID = #{swpId,jdbcType=INTEGER}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
- delete from sys_ward_permission
- where SWP_ID = #{swpId,jdbcType=INTEGER}
- </delete>
- <insert id="insert" parameterType="com.xinxin.topro.pubservice.mysqlModel.SysWardPermission" >
- insert into sys_ward_permission (SWP_ID, HI_ID, DW_WardDm,
- UI_Code, SS_ID, SWP_Recordor,
- SWP_Record_Time, SWP_IsDel, SWP_IsDefault
- )
- values (#{swpId,jdbcType=INTEGER}, #{hiId,jdbcType=INTEGER}, #{dwWarddm,jdbcType=VARCHAR},
- #{uiCode,jdbcType=VARCHAR}, #{ssId,jdbcType=INTEGER}, #{swpRecordor,jdbcType=VARCHAR},
- #{swpRecordTime,jdbcType=TIMESTAMP}, #{swpIsdel,jdbcType=INTEGER}, #{swpIsdefault,jdbcType=INTEGER}
- )
- </insert>
- <insert id="insertSelective" parameterType="com.xinxin.topro.pubservice.mysqlModel.SysWardPermission" >
- insert into sys_ward_permission
- <trim prefix="(" suffix=")" suffixOverrides="," >
- <if test="swpId != null" >
- SWP_ID,
- </if>
- <if test="hiId != null" >
- HI_ID,
- </if>
- <if test="dwWarddm != null" >
- DW_WardDm,
- </if>
- <if test="uiCode != null" >
- UI_Code,
- </if>
- <if test="ssId != null" >
- SS_ID,
- </if>
- <if test="swpRecordor != null" >
- SWP_Recordor,
- </if>
- <if test="swpRecordTime != null" >
- SWP_Record_Time,
- </if>
- <if test="swpIsdel != null" >
- SWP_IsDel,
- </if>
- <if test="swpIsdefault != null" >
- SWP_IsDefault,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides="," >
- <if test="swpId != null" >
- #{swpId,jdbcType=INTEGER},
- </if>
- <if test="hiId != null" >
- #{hiId,jdbcType=INTEGER},
- </if>
- <if test="dwWarddm != null" >
- #{dwWarddm,jdbcType=VARCHAR},
- </if>
- <if test="uiCode != null" >
- #{uiCode,jdbcType=VARCHAR},
- </if>
- <if test="ssId != null" >
- #{ssId,jdbcType=INTEGER},
- </if>
- <if test="swpRecordor != null" >
- #{swpRecordor,jdbcType=VARCHAR},
- </if>
- <if test="swpRecordTime != null" >
- #{swpRecordTime,jdbcType=TIMESTAMP},
- </if>
- <if test="swpIsdel != null" >
- #{swpIsdel,jdbcType=INTEGER},
- </if>
- <if test="swpIsdefault != null" >
- #{swpIsdefault,jdbcType=INTEGER},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.xinxin.topro.pubservice.mysqlModel.SysWardPermission" >
- update sys_ward_permission
- <set >
- <if test="hiId != null" >
- HI_ID = #{hiId,jdbcType=INTEGER},
- </if>
- <if test="dwWarddm != null" >
- DW_WardDm = #{dwWarddm,jdbcType=VARCHAR},
- </if>
- <if test="uiCode != null" >
- UI_Code = #{uiCode,jdbcType=VARCHAR},
- </if>
- <if test="ssId != null" >
- SS_ID = #{ssId,jdbcType=INTEGER},
- </if>
- <if test="swpRecordor != null" >
- SWP_Recordor = #{swpRecordor,jdbcType=VARCHAR},
- </if>
- <if test="swpRecordTime != null" >
- SWP_Record_Time = #{swpRecordTime,jdbcType=TIMESTAMP},
- </if>
- <if test="swpIsdel != null" >
- SWP_IsDel = #{swpIsdel,jdbcType=INTEGER},
- </if>
- <if test="swpIsdefault != null" >
- SWP_IsDefault = #{swpIsdefault,jdbcType=INTEGER},
- </if>
- </set>
- where SWP_ID = #{swpId,jdbcType=INTEGER}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.xinxin.topro.pubservice.mysqlModel.SysWardPermission" >
- update sys_ward_permission
- set HI_ID = #{hiId,jdbcType=INTEGER},
- DW_WardDm = #{dwWarddm,jdbcType=VARCHAR},
- UI_Code = #{uiCode,jdbcType=VARCHAR},
- SS_ID = #{ssId,jdbcType=INTEGER},
- SWP_Recordor = #{swpRecordor,jdbcType=VARCHAR},
- SWP_Record_Time = #{swpRecordTime,jdbcType=TIMESTAMP},
- SWP_IsDel = #{swpIsdel,jdbcType=INTEGER},
- SWP_IsDefault = #{swpIsdefault,jdbcType=INTEGER}
- where SWP_ID = #{swpId,jdbcType=INTEGER}
- </update>
- <update id="updateByUiCode">
- update sys_ward_permission
- set SWP_IsDefault = 0
- where UI_Code = #{uiCode,jdbcType=VARCHAR} and SWP_IsDel = 0
- </update>
- <update id="updateByUiCodeAndWardDm">
- update sys_ward_permission
- set SWP_IsDefault = 1
- where UI_Code = #{uiCode,jdbcType=VARCHAR} and DW_WardDm = #{wardDm,jdbcType=VARCHAR} and SWP_IsDel = 0
- </update>
- <select id="selectByUiCode" resultMap="BaseResultMap" parameterType="java.lang.String" >
- select
- <include refid="Base_Column_List" />
- from sys_ward_permission
- where SWP_IsDel = 0 and UI_Code = #{uiCode,jdbcType=VARCHAR}
- </select>
- <select id="selectByUICode" resultMap="ExtendsMap" parameterType="java.lang.String">
- select <include refid="Base_Column_List"/>,
- (SELECT c.UI_Name from sys_userinfo c where c.UI_Code=a.SWP_Recordor) RecordorName,
- (SELECT b.DW_WardName from dic_ward b where b.DW_WardDm=a.DW_WardDm) DW_WardName
- from sys_ward_permission a
- where a.UI_Code = #{uiCode,jdbcType=VARCHAR} and SWP_IsDel=0
- </select>
- <insert id="addPermission" parameterType="com.xinxin.topro.pubservice.mysqlModel.SysWardPermission" >
- insert into sys_ward_permission (HI_ID, DW_WardDm,
- UI_Code, SS_ID, SWP_Recordor,
- SWP_Record_Time, SWP_IsDel, SWP_IsDefault
- )
- values (#{hiId,jdbcType=INTEGER}, #{dwWarddm,jdbcType=VARCHAR},
- #{uiCode,jdbcType=VARCHAR}, #{ssId,jdbcType=INTEGER}, #{swpRecordor,jdbcType=VARCHAR},
- now(), #{swpIsdel,jdbcType=INTEGER}, #{swpIsdefault,jdbcType=INTEGER}
- )
- </insert>
- <update id="delPermission" parameterType="java.lang.Integer">
- update sys_ward_permission set SWP_IsDel = -1 where SWP_ID = #{swpId,jdbcType=INTEGER}
- </update>
- </mapper>
|