Notes![what is notes.io? What is notes.io?](/theme/images/whatisnotesio.png)
![]() ![]() Notes - notes.io |
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import com.ge.entity.playWeb.group.log.GroupLogWebPo;
/**
* @package com.ge.mapp.playWeb.log
* @author LiuHY
* @date 2018-3-7上午9:54:17
* @Description 日文件
*/
@Repository("logWebMapper")
public interface LogWebMapper {
/**
* @Title com.ge.mapper.playWeb.group.log.findLog
* @Description 查询
* @return GroupLogWebPo
*/
public GroupLogWebPo findLog(@Param("tableName") String tableName,
@Param("phone") Long phone);
/**
* 统计登录状态(查询并统计该手机号登录过的几个月,一个月登录多次算一)
*/
public int findLoginStatus(@Param("tableNames") String[] tableNames, @Param("phone") Long phone);
/**
* 根据表名查询表名
*/
public String findTableNameByTableName(@Param("tableName") String tableName);
/**
* 在phonebusinlogdb库下查找table
*/
public Integer isTableExist(@Param("tableName") String tableName);
}
<?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">
<!-- @Description: 用户成长体系 -->
<!-- @Author: liuhy -->
<!-- @CreateDate: 2017-10-23 10:31:18 -->
<mapper namespace="com.ge.mapp.playWeb.log.LogWebMapper">
<resultMap id="logWebMap" type="groupLogWeb">
<result property="inputDate" column="input_date" jdbcType="TIMESTAMP" /> <!--添加时间 -->
<result property="inputName" column="input_name" jdbcType="DECIMAL" /> <!--记录添加人 -->
<result property="updateDate" column="update_date" jdbcType="TIMESTAMP" /> <!--修改时间 -->
<result property="updateName" column="update_name" jdbcType="DECIMAL" /> <!--记录修改人 -->
<result property="delsign" column="delsign" jdbcType="DECIMAL" /> <!--1:表示删除 -->
<result property="no" column="no" jdbcType="DECIMAL" /> <!--流水号(JAVA生成) -->
<result property="phone" column="PHONE" jdbcType="DECIMAL" /> <!--手机号 -->
<result property="channel" column="CHANNEL" jdbcType="VARCHAR" /> <!--设备 -->
<result property="num" column="NUM" jdbcType="DECIMAL" /> <!--次数 -->
</resultMap>
<!-- 查询 -->
<select id="findLog" resultMap="logWebMap">
<![CDATA[
select *
from ${tableName}
where DELSIGN = 0
and PHONE = #{phone}
]]>
</select>
<!-- 统计登录状态(查询并统计该手机号登录过的几个月,一个月登录多次算一) -->
<select id="findLoginStatus" resultType="int">
<![CDATA[
select
]]>
<foreach collection="tableNames" item="tableName" open="" close="" index="index" separator=" + ">
<![CDATA[
(select case count(*) when 0 then 0 else 1 end
from ${tableName} where phone = #{phone} and delsign = 0 )
]]>
</foreach>
as count
from dual
</select>
<!-- 根据表名查询表名 -->
<select id="findTableNameByTableName" resultType="String">
<![CDATA[
select table_name
from information_schema.tables
where TABLE_NAME = #{tableName}
]]>
</select>
<!-- 查询表是否存在 -->
<select id="isTableExist" resultType="Integer">
<![CDATA[
SELECT
COUNT(1)
FROM
information_schema.tables
WHERE table_schema = 'phonebusinlogdb'
AND table_name = #{tableName}
]]>
</select>
</mapper>
![]() |
Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 14 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team