| | |
| | | AND u.phonenumber like concat('%', #{phonenumber}, '%') |
| | | </if> |
| | | <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 --> |
| | | AND date_format(u.create_time,'%Y%m%d') >= date_format(#{params.beginTime},'%Y%m%d') |
| | | <!-- and <![CDATA[ u.create_time >= convert(datetime, #{params.beginTime}, 20)]]>--> |
| | | and datediff(d, u.create_time, #{params.beginTime}) <![CDATA[<=]]> 0 |
| | | </if> |
| | | <if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 --> |
| | | AND date_format(u.create_time,'%Y%m%d') <= date_format(#{params.endTime},'%Y%m%d') |
| | | <!-- and <![CDATA[ u.create_time <= convert(datetime, #{params.endTime}, 20)]]>--> |
| | | and datediff(d, u.create_time, #{params.endTime}) <![CDATA[>=]]> 0 |
| | | </if> |
| | | <if test="deptId != null and deptId != 0"> |
| | | AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId}, ancestors) )) |
| | | AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE charindex(',' + CONVERT (nvarchar, #{deptId}), ',' + ancestors) > 0 )) |
| | | </if> |
| | | <!-- 数据范围过滤 --> |
| | | ${params.dataScope} |
| | |
| | | </select> |
| | | |
| | | <select id="checkUserNameUnique" parameterType="String" resultMap="SysUserResult"> |
| | | select user_id, user_name from sys_user where user_name = #{userName} and del_flag = '0' limit 1 |
| | | select top(1) user_id, user_name from sys_user where user_name = #{userName} and del_flag = '0' |
| | | </select> |
| | | |
| | | <select id="checkPhoneUnique" parameterType="String" resultMap="SysUserResult"> |
| | | select user_id, phonenumber from sys_user where phonenumber = #{phonenumber} and del_flag = '0' limit 1 |
| | | select top(1) user_id, phonenumber from sys_user where phonenumber = #{phonenumber} and del_flag = '0' |
| | | </select> |
| | | |
| | | <select id="checkEmailUnique" parameterType="String" resultMap="SysUserResult"> |
| | | select user_id, email from sys_user where email = #{email} and del_flag = '0' limit 1 |
| | | select top(1) user_id, email from sys_user where email = #{email} and del_flag = '0' |
| | | </select> |
| | | |
| | | <insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId"> |
| | |
| | | <if test="status != null and status != ''">#{status},</if> |
| | | <if test="createBy != null and createBy != ''">#{createBy},</if> |
| | | <if test="remark != null and remark != ''">#{remark},</if> |
| | | sysdate() |
| | | getdate() |
| | | ) |
| | | </insert> |
| | | |
| | |
| | | <if test="loginDate != null">login_date = #{loginDate},</if> |
| | | <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> |
| | | <if test="remark != null">remark = #{remark},</if> |
| | | update_time = sysdate() |
| | | update_time = getdate() |
| | | </set> |
| | | where user_id = #{userId} |
| | | </update> |