<?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.ruixuan.salesLeads.mapper.TestMapper">


	<!--
	<select id="selectDemoList" resultType="com.ruixuan.salesLeads.pojo.TestPojo">

		select * from test

	</select>
	-->


	<!-- 批量用户信息 init-->
	<insert id="replaceUserInfoBatchInit">
		replace into sys_user(
		dept_id,
		user_name,
		nick_name,
		email,
		phonenumber,
		password,
		create_by,
		create_time)
		values
		<foreach collection="userList" item="info" separator=",">
			(
			#{info.deptId},
			#{info.userName},
			#{info.nickName},
			#{info.email},
			#{info.phonenumber},
			'$2a$10$sZHmOSoeopPqXWFgPz0nbemoguGvLzl5YAkbbhMFWBgZI5dzNvWnq',
			'admin',
			NOW()
			)
		</foreach>
	</insert>


	<select id="getDeptNameByName" resultType="com.alibaba.fastjson.JSONObject">
		SELECT * FROM sys_dept
		WHERE dept_name = #{deptName}
			limit 1

	</select>





</mapper> 