123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173 |
- <?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.inpnurseservice.mysqlmapper.DicConsulationUserMapper" >
- <resultMap id="BaseResultMap" type="com.xinxin.topro.inpnurseservice.mysqlmodel.DicConsulationUser" >
- <id column="DCU_ID" property="dcuId" jdbcType="INTEGER" />
- <result column="DCT_ID" property="dctId" jdbcType="INTEGER" />
- <result column="DCU_User" property="dcuUser" jdbcType="VARCHAR" />
- <result column="DCU_Recordor" property="dcuRecordor" jdbcType="VARCHAR" />
- <result column="DCU_Record_Time" property="dcuRecordTime" jdbcType="TIMESTAMP" />
- <result column="DCU_IsDel" property="dcuIsdel" jdbcType="INTEGER" />
- </resultMap>
- <sql id="Base_Column_List" >
- DCU_ID, DCT_ID, DCU_User, DCU_Recordor, DCU_Record_Time, DCU_IsDel
- </sql>
- <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
- select
- <include refid="Base_Column_List" />
- from dic_consulation_user
- where DCU_IsDel = 0 and DCU_ID = #{dcuId,jdbcType=INTEGER}
- </select>
- <select id="selectAll" resultType="com.xinxin.topro.inpnurseservice.vo.DicConsulationUserVO">
- SELECT
- dcu.DCU_ID as dcuId,
- dcu.DCT_ID as dctId,
- dcu.DCU_User as dcuUser,
- su.UI_Name as dcuUserName
- FROM dic_consulation_user dcu
- LEFT JOIN sys_userinfo su
- on dcu.DCU_User = su.UI_Code
- where dcu.DCU_IsDel = 0 and su.SS_ISDel = 0 and su.SU_Status = 0
- </select>
- <select id="selectByIds" resultType="com.xinxin.topro.inpnurseservice.vo.DicConsulationUserVO">
- SELECT
- dcu.DCU_ID as dcuId,
- dcu.DCT_ID as dctId,
- dcu.DCU_User as dcuUser,
- su.UI_Name as dcuUserName
- FROM dic_consulation_user dcu
- LEFT JOIN sys_userinfo su
- on dcu.DCU_User = su.UI_Code
- where dcu.DCU_IsDel = 0 and su.SS_ISDel = 0 and su.SU_Status = 0
- and dcu.DCT_ID in <foreach collection="list" item="item" separator="," index="index" open="(" close=")">
- #{item,jdbcType=INTEGER}
- </foreach>
- </select>
- <select id="selectUserCode" resultMap="BaseResultMap" parameterType="java.lang.String" >
- select
- <include refid="Base_Column_List" />
- from dic_consulation_user
- where DCU_IsDel = 0 and DCU_User = #{code,jdbcType=VARCHAR}
- </select>
- <select id="selectTeamByUserCode"
- resultType="com.xinxin.topro.inpnurseservice.mysqlmodel.DicConsultationTeam">
- select
- dct.DCT_ID as dctId,
- dct.DCT_Name as dctName
- from dic_consulation_user dcu
- left join dic_consultation_team dct
- on dcu.DCT_ID = dct.DCT_ID
- where dcu.DCU_User = #{uiCode}
- and dcu.DCU_IsDel = 0
- and dct.DCT_IsDel = 0
- and dct.DCT_Type = 1
- </select>
- <select id="selectUserByTeamCode" resultType="java.lang.String">
- select
- dcu.DCU_User
- from dic_consulation_user dcu
- inner join dic_consultation_team dct
- on dcu.DCT_ID = dct.DCT_ID
- where dct.DCT_PinyinCode = #{code}
- and dcu.DCU_IsDel = 0
- and dct.DCT_IsDel = 0
- and dct.DCT_Type = 1
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
- delete from dic_consulation_user
- where DCU_ID = #{dcuId,jdbcType=INTEGER}
- </delete>
- <insert id="insert" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.DicConsulationUser" >
- insert into dic_consulation_user (DCU_ID, DCT_ID, DCU_User,
- DCU_Recordor, DCU_Record_Time, DCU_IsDel
- )
- values (#{dcuId,jdbcType=INTEGER}, #{dctId,jdbcType=INTEGER}, #{dcuUser,jdbcType=VARCHAR},
- #{dcuRecordor,jdbcType=VARCHAR}, #{dcuRecordTime,jdbcType=TIMESTAMP}, #{dcuIsdel,jdbcType=INTEGER}
- )
- </insert>
- <insert id="insertSelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.DicConsulationUser" >
- insert into dic_consulation_user
- <trim prefix="(" suffix=")" suffixOverrides="," >
- <if test="dcuId != null" >
- DCU_ID,
- </if>
- <if test="dctId != null" >
- DCT_ID,
- </if>
- <if test="dcuUser != null" >
- DCU_User,
- </if>
- <if test="dcuRecordor != null" >
- DCU_Recordor,
- </if>
- <if test="dcuRecordTime != null" >
- DCU_Record_Time,
- </if>
- <if test="dcuIsdel != null" >
- DCU_IsDel,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides="," >
- <if test="dcuId != null" >
- #{dcuId,jdbcType=INTEGER},
- </if>
- <if test="dctId != null" >
- #{dctId,jdbcType=INTEGER},
- </if>
- <if test="dcuUser != null" >
- #{dcuUser,jdbcType=VARCHAR},
- </if>
- <if test="dcuRecordor != null" >
- #{dcuRecordor,jdbcType=VARCHAR},
- </if>
- <if test="dcuRecordTime != null" >
- #{dcuRecordTime,jdbcType=TIMESTAMP},
- </if>
- <if test="dcuIsdel != null" >
- #{dcuIsdel,jdbcType=INTEGER},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.DicConsulationUser" >
- update dic_consulation_user
- <set >
- <if test="dctId != null" >
- DCT_ID = #{dctId,jdbcType=INTEGER},
- </if>
- <if test="dcuUser != null" >
- DCU_User = #{dcuUser,jdbcType=VARCHAR},
- </if>
- <if test="dcuRecordor != null" >
- DCU_Recordor = #{dcuRecordor,jdbcType=VARCHAR},
- </if>
- <if test="dcuRecordTime != null" >
- DCU_Record_Time = #{dcuRecordTime,jdbcType=TIMESTAMP},
- </if>
- <if test="dcuIsdel != null" >
- DCU_IsDel = #{dcuIsdel,jdbcType=INTEGER},
- </if>
- </set>
- where DCU_ID = #{dcuId,jdbcType=INTEGER}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.DicConsulationUser" >
- update dic_consulation_user
- set DCT_ID = #{dctId,jdbcType=INTEGER},
- DCU_User = #{dcuUser,jdbcType=VARCHAR},
- DCU_Recordor = #{dcuRecordor,jdbcType=VARCHAR},
- DCU_Record_Time = #{dcuRecordTime,jdbcType=TIMESTAMP},
- DCU_IsDel = #{dcuIsdel,jdbcType=INTEGER}
- where DCU_ID = #{dcuId,jdbcType=INTEGER}
- </update>
- </mapper>
|