|
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- <?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.iformall.mapper.WxCUserBasicSignMapper">
- <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxCUserBasicSign">
- <id column="id" jdbcType="BIGINT" property="id" />
- <result column="tenant_id" jdbcType="VARCHAR" property="tenantId" />
- <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId"/>
- <result column="user_id" jdbcType="BIGINT" property="userId" />
-
- <result column="type" jdbcType="INTEGER" property="type" />
-
- <result column="signin_date" jdbcType="TIMESTAMP" property="signinDate"/>
- <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
- <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
-
- <result column="continue_month_sign" jdbcType="INTEGER" property="continueMonthSign" />
- <result column="count_month_sign" jdbcType="INTEGER" property="countMonthSign" />
-
- <result column="continue_year_sign" jdbcType="INTEGER" property="continueYearSign" />
- <result column="count_year_sign" jdbcType="INTEGER" property="countYearSign" />
-
- <result column="continue_sign" jdbcType="INTEGER" property="continueSign" />
- <result column="count_sign" jdbcType="INTEGER" property="countSign" />
-
- <result column="mark" jdbcType="VARCHAR" property="mark" />
-
- </resultMap>
-
- <sql id="allColumns">
- `id`,`tenant_id`,`parent_tenant_id`,`user_id`,`type`,`signin_date`,`create_date`,`update_date`,
- `continue_month_sign`,`count_month_sign`,`continue_year_sign`,`count_year_sign`,
- `continue_sign`,`count_sign`,`mark`
- </sql>
-
- <sql id="dynamicWhereConditions">
- where 1 = 1
- <if test=" null != id ">
- and `id` = #{id}
- </if>
- <if test=" null != tenantId and '' != tenantId">
- and `tenant_id` = #{tenantId}
- </if>
- <if test=" null != parentTenantId and '' != parentTenantId">
- and `parent_tenant_id` = #{parentTenantId}
- </if>
- <if test=" null != userId ">
- and `user_id` = #{userId}
- </if>
- <if test=" null != type ">
- and `type` = #{type}
- </if>
-
- <if test=" null != startDate ">
- and `signin_date` >= #{startDate}
- </if>
- <if test=" null != endDate">
- and `signin_date` <= #{endDate}
- </if>
-
- <if test=" null != ids ">
- and id in
- <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
- #{idItem}
- </foreach>
- </if>
- order by `signin_date` desc
-
- </sql>
-
- <select id="findList" parameterType="com.iformall.domain.po.WxCUserBasicSign" resultMap="BaseResultMap">
- select <include refid="allColumns" />
- from wx_c_user_basic_sign
- <include refid="dynamicWhereConditions" />
- </select>
-
- <select id="getLastSignIn" parameterType="com.iformall.domain.po.WxCUserBasicSign" resultMap="BaseResultMap">
- select <include refid="allColumns" /> from wx_c_user_basic_sign
- where 1 = 1
- <if test=" null != tenantId and '' != tenantId">
- and `tenant_id` = #{tenantId}
- </if>
- <if test=" null != parentTenantId and '' != parentTenantId">
- and `parent_tenant_id` = #{parentTenantId}
- </if>
- <if test=" null != userId ">
- and `user_id` = #{userId}
- </if>
- order by `signin_date` desc limit 1
- </select>
-
- </mapper>
|