CTCareProvMapper.xml 6.92 KB
<?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.phxl.modules.goods.dao.ctcareprov.CTCareProvDao">

	<!--BaseResultMap -->
	<resultMap id="BaseResultMap"
		type="com.phxl.modules.goods.entity.ctcareprov.CTCareProv">
		<id column="id" property="id" jdbcType="BIGINT" />
		<result column="mfmed_staff_code" property="mfmedStaffCode" jdbcType="VARCHAR" />
		<result column="logon_user" property="logonUser" jdbcType="VARCHAR" />
		<result column="real_name" property="realName" jdbcType="VARCHAR" />
		<result column="help_code" property="helpCode" jdbcType="VARCHAR" />
		<result column="sex" property="sex" jdbcType="VARCHAR" />
		<result column="mobile_tel" property="mobileTel" jdbcType="VARCHAR" />
		<result column="web_chat_code" property="webChatCode" jdbcType="VARCHAR" />
		<result column="idcode" property="idcode" jdbcType="VARCHAR" />
		<result column="e_mail" property="e_mail" jdbcType="VARCHAR" />
		<result column="hdept_code" property="hdeptCode" jdbcType="VARCHAR" />
		<result column="category" property="category" jdbcType="VARCHAR" />
		<result column="ishadministrator" property="ishadministrator" jdbcType="VARCHAR" />
		<result column="update_time" property="update_time" jdbcType="TIMESTAMP" />
	</resultMap>

	<!--Base_Column_List -->
	<sql id="Base_Column_List">id,mfmed_staff_code,logon_user,real_name,help_code,sex,mobile_tel,web_chat_code,idcode,e_mail,hdept_code,category,ishadministrator,update_time</sql>

	<!--批量插入MedPlanDetail -->
	<insert id="batchInsert" parameterType="list">
		insert into med_hli_care_prov (id,mfmed_staff_code,logon_user,real_name,help_code,sex,mobile_tel,web_chat_code,idcode,e_mail,hdept_code,category,ishadministrator,update_time)
		values
		<foreach collection ="list" item="obj" separator =",">
		<trim prefix=" (" suffix=")" suffixOverrides=",">
				#{obj.id},
				#{obj.mfmedStaffCode},
				#{obj.logonUser},
				#{obj.realName},
				#{obj.helpCode},
				#{obj.sex},
				#{obj.mobileTel},
				#{obj.webChatCode},
				#{obj.idcode},
				#{obj.e_mail},
				#{obj.hdeptCode},
				#{obj.category},
				#{obj.ishadministrator},
				#{obj.update_time}
			</trim>
          </foreach>
	</insert>
	
	<!-- 批量查询HisCtDept -->
	<select id="batchSelect" resultMap="BaseResultMap" parameterType="java.util.HashMap">
		select
		<include refid="Base_Column_List" />
		from med_hli_care_prov
		<if test="ryCodes != null">
			where mfmed_staff_code in
			<foreach item="item" index="index" collection="ryCodes" open="(" separator="," close=")">
				#{item}
			</foreach>
		</if>
	</select>
	
	<update id="batchUpdate" parameterType="list">
		update med_hli_care_prov
		<trim prefix="set" suffixOverrides=",">
			<trim prefix="mfmed_staff_code=case" suffix="end,">
				<foreach collection="list" item="obj" index="index">
					<if test="obj.mfmedStaffCode != null and obj.mfmedStaffCode != ''">
						when id = #{obj.id}
						then #{obj.mfmedStaffCode,jdbcType=VARCHAR}
					</if>
				</foreach>
			</trim>
			<trim prefix="logon_user=case" suffix="end,">
				<foreach collection="list" item="obj" index="index">
					<if test="obj.logonUser != null  and obj.logonUser != ''">
						when id = #{obj.id}
						then
						#{obj.logonUser,jdbcType=VARCHAR}
					</if>
				</foreach>
			</trim>
			<trim prefix="help_code=case" suffix="end,">
				<foreach collection="list" item="obj" index="index">
					<if test="obj.helpCode != null and obj.helpCode != ''">
						when id = #{obj.id}
						then #{obj.helpCode,jdbcType=VARCHAR}
					</if>
				</foreach>
			</trim>
			<trim prefix="real_name=case" suffix="end,">
				<foreach collection="list" item="obj" index="index">
					<if test="obj.realName != null and obj.realName != ''">
						when id = #{obj.id}
						then #{obj.realName,jdbcType=VARCHAR}
					</if>
				</foreach>
			</trim>
			<trim prefix="help_code=case" suffix="end,">
				<foreach collection="list" item="obj" index="index">
					<if test="obj.helpCode != null and obj.helpCode != ''">
						when id = #{obj.id}
						then #{obj.helpCode,jdbcType=VARCHAR}
					</if>
				</foreach>
			</trim>
			<trim prefix="sex=case" suffix="end,">
				<foreach collection="list" item="obj" index="index">
					<if test="obj.sex != null and obj.sex != ''">
						when id = #{obj.id}
						then #{obj.sex,jdbcType=VARCHAR}
					</if>
				</foreach>
			</trim>
			<trim prefix="mobile_tel=case" suffix="end,">
				<foreach collection="list" item="obj" index="index">
					<if test="obj.mobileTel != null and obj.mobileTel != ''">
						when id = #{obj.id}
						then #{obj.mobileTel,jdbcType=VARCHAR}
					</if>
				</foreach>
			</trim>
			<trim prefix="category=case" suffix="end,">
				<foreach collection="list" item="obj" index="index">
					<if test="obj.category != null and obj.category != ''">
						when id = #{obj.id}
						then #{obj.category,jdbcType=VARCHAR}
					</if>
				</foreach>
			</trim>
			<trim prefix="web_chat_code=case" suffix="end,">
				<foreach collection="list" item="obj" index="index">
					<if test="obj.webChatCode != null and obj.webChatCode != ''">
						when id = #{obj.id}
						then #{obj.webChatCode,jdbcType=VARCHAR}
					</if>
				</foreach>
			</trim>
			<trim prefix="idcode=case" suffix="end,">
				<foreach collection="list" item="obj" index="index">
					<if test="obj.idcode != null and obj.idcode != ''">
						when id = #{obj.id}
						then #{obj.idcode,jdbcType=VARCHAR}
					</if>
				</foreach>
			</trim>
			<trim prefix="hdept_code=case" suffix="end,">
				<foreach collection="list" item="obj" index="index">
					<if test="obj.hdeptCode != null and obj.hdeptCode != ''">
						when id = #{obj.id}
						then #{obj.hdeptCode,jdbcType=VARCHAR}
					</if>
				</foreach>
			</trim>
			<trim prefix="e_mail=case" suffix="end,">
				<foreach collection="list" item="obj" index="index">
					<if test="obj.e_mail != null and obj.e_mail != ''">
						when id = #{obj.id}
						then #{obj.e_mail,jdbcType=VARCHAR}
					</if>
				</foreach>
			</trim>
			<trim prefix="ishadministrator=case" suffix="end,">
				<foreach collection="list" item="obj" index="index">
					<if test="obj.ishadministrator != null and obj.ishadministrator != ''">
						when id = #{obj.id}
						then #{obj.ishadministrator,jdbcType=VARCHAR}
					</if>
				</foreach>
			</trim>
			<trim prefix="category=case" suffix="end,">
				<foreach collection="list" item="obj" index="index">
					<if test="obj.category != null and obj.category != ''">
						when id = #{obj.id}
						then #{obj.category,jdbcType=VARCHAR}
					</if>
				</foreach>
			</trim>
			<trim prefix="update_time=case" suffix="end,">
				<foreach collection="list" item="obj" index="index">
					<if test="obj.update_time != null and obj.update_time != ''">
						when id = #{obj.id}
						then #{obj.update_time,jdbcType=VARCHAR}
					</if>
				</foreach>
			</trim>
		</trim>
		where
		<foreach collection="list" separator="or" item="obj" index="index">
			id
			= #{obj.id}
		</foreach>
	</update>
	

</mapper>