123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169 |
- <?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.sysservice.dao.mysqlmapper.DicConsulationUserMapper" >
- <resultMap id="BaseResultMap" type="com.xinxin.topro.sysservice.dao.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>
- <resultMap id="ListRequestMap" extends="BaseResultMap" type="com.xinxin.topro.sysservice.dao.mysqlmodel.DicConsulationUserVO">
- <result column="UI_Name" property="userName" jdbcType="VARCHAR" />
- <result column="UI_Name" property="recordorName" jdbcType="VARCHAR" />
- <result column="SS_Type" property="ssType" 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_ID = #{dcuId,jdbcType=INTEGER}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
- delete from dic_consulation_user
- where DCU_ID = #{dcuId,jdbcType=INTEGER}
- </delete>
- <delete id="deleteByDctId" parameterType="java.lang.Integer" >
- update dic_consulation_user set DCU_IsDel = -1
- where DCT_ID = #{dctId,jdbcType=INTEGER}
- </delete>
- <insert id="insert" parameterType="com.xinxin.topro.sysservice.dao.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.sysservice.dao.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.sysservice.dao.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.sysservice.dao.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>
- <update id="delDicConsulationUser" parameterType="java.lang.Integer" >
- update dic_consulation_user
- set DCU_IsDel = -1
- where DCU_ID = #{dcuId,jdbcType=INTEGER}
- </update>
- <select id="getDicConsulationUserByDctId" parameterType="java.lang.Integer" resultMap="ListRequestMap">
- select
- <include refid="Base_Column_List" />,
- b.UI_Name userName,
- b.SS_Type ssType,
- c.UI_Name recordorName
- from dic_consulation_user a
- left join sys_userinfo b on a.DCU_User = b.UI_Code
- left join sys_userinfo c on a.DCU_Recordor = c.UI_Code
- where DCT_ID= #{dctId,jdbcType=INTEGER} and DCU_IsDel = 0
- </select>
- <insert id="insertList" parameterType="com.xinxin.topro.sysservice.dao.mysqlmodel.DicConsulationUser" >
- insert into dic_consulation_user (DCT_ID, DCU_User,
- DCU_Recordor, DCU_Record_Time, DCU_IsDel)
- values
- <foreach collection="list" separator="," item="item">
- (#{item.dctId,jdbcType=INTEGER}, #{item.dcuUser,jdbcType=VARCHAR},
- #{item.dcuRecordor,jdbcType=VARCHAR}, now(), #{item.dcuIsdel,jdbcType=INTEGER})
- </foreach>
- </insert>
- <update id="updateList" parameterType="com.xinxin.topro.sysservice.dao.mysqlmodel.DicConsulationUser">
- <foreach item='item' index='index' collection='list' open='' separator=';' close=''>
- update dic_consulation_user
- set DCT_ID=#{item.dctId,jdbcType=INTEGER},
- DCU_User= #{item.dcuUser,jdbcType=VARCHAR},
- DCU_Recordor= #{item.dcuRecordor,jdbcType=VARCHAR},
- DCU_Record_Time=now()
- where DCU_ID = #{item.dcuId,jdbcType=INTEGER}
- </foreach>
- </update>
- <select id="selectByDctId" resultType="com.xinxin.topro.sysservice.response.ConsultationUserResponse" parameterType="java.lang.Integer">
- SELECT
- dcu.DCU_ID AS dcuId,
- su.UI_Code AS uiCode,
- su.UI_Name AS uiName,
- dd.DD_DepName AS depName
- FROM
- dic_consulation_user dcu
- LEFT JOIN sys_userinfo su ON dcu.DCU_User = su.UI_Code
- LEFT JOIN dic_department dd ON su.SS_DepartmentID = dd.DD_ID
- WHERE
- dcu.DCT_ID = #{dctId,jdbcType=INTEGER}
- AND DCU_IsDel = 0
- </select>
- <update id="deleteTeamUser">
- UPDATE dic_consulation_user
- SET DCU_IsDel = -1
- WHERE DCT_ID = #{dctId,jdbcType=INTEGER}
- </update>
- </mapper>
|