279 lines
10 KiB
XML
279 lines
10 KiB
XML
<?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.rzyc.mapper.ent.EntPromiseUserMapper">
|
|
<resultMap id="BaseResultMap" type="com.rzyc.model.ent.EntPromiseUser">
|
|
<id column="EntPromiseUserId" jdbcType="VARCHAR" property="entpromiseuserid" />
|
|
<result column="EntPromiseId" jdbcType="VARCHAR" property="entpromiseid" />
|
|
<result column="SysEntUserId" jdbcType="VARCHAR" property="sysentuserid" />
|
|
<result column="Sign" jdbcType="VARCHAR" property="sign" />
|
|
<result column="CreatedBy" jdbcType="VARCHAR" property="createdby" />
|
|
<result column="CreatedOn" jdbcType="TIMESTAMP" property="createdon" />
|
|
<result column="ModifiedOn" jdbcType="TIMESTAMP" property="modifiedon" />
|
|
<result column="ModifiedBy" jdbcType="VARCHAR" property="modifiedby" />
|
|
</resultMap>
|
|
<sql id="Example_Where_Clause">
|
|
<where>
|
|
<foreach collection="oredCriteria" item="criteria" separator="or">
|
|
<if test="criteria.valid">
|
|
<trim prefix="(" prefixOverrides="and" suffix=")">
|
|
<foreach collection="criteria.criteria" item="criterion">
|
|
<choose>
|
|
<when test="criterion.noValue">
|
|
and ${criterion.condition}
|
|
</when>
|
|
<when test="criterion.singleValue">
|
|
and ${criterion.condition} #{criterion.value}
|
|
</when>
|
|
<when test="criterion.betweenValue">
|
|
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
|
</when>
|
|
<when test="criterion.listValue">
|
|
and ${criterion.condition}
|
|
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
|
#{listItem}
|
|
</foreach>
|
|
</when>
|
|
</choose>
|
|
</foreach>
|
|
</trim>
|
|
</if>
|
|
</foreach>
|
|
</where>
|
|
</sql>
|
|
<sql id="Update_By_Example_Where_Clause">
|
|
<where>
|
|
<foreach collection="example.oredCriteria" item="criteria" separator="or">
|
|
<if test="criteria.valid">
|
|
<trim prefix="(" prefixOverrides="and" suffix=")">
|
|
<foreach collection="criteria.criteria" item="criterion">
|
|
<choose>
|
|
<when test="criterion.noValue">
|
|
and ${criterion.condition}
|
|
</when>
|
|
<when test="criterion.singleValue">
|
|
and ${criterion.condition} #{criterion.value}
|
|
</when>
|
|
<when test="criterion.betweenValue">
|
|
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
|
</when>
|
|
<when test="criterion.listValue">
|
|
and ${criterion.condition}
|
|
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
|
#{listItem}
|
|
</foreach>
|
|
</when>
|
|
</choose>
|
|
</foreach>
|
|
</trim>
|
|
</if>
|
|
</foreach>
|
|
</where>
|
|
</sql>
|
|
<sql id="Base_Column_List">
|
|
EntPromiseUserId, EntPromiseId, SysEntUserId, Sign, CreatedBy, CreatedOn, ModifiedOn,
|
|
ModifiedBy
|
|
</sql>
|
|
<select id="selectByExample" parameterType="com.rzyc.model.ent.EntPromiseUserExample" resultMap="BaseResultMap">
|
|
select
|
|
<if test="distinct">
|
|
distinct
|
|
</if>
|
|
<include refid="Base_Column_List" />
|
|
from EntPromiseUser
|
|
<if test="_parameter != null">
|
|
<include refid="Example_Where_Clause" />
|
|
</if>
|
|
<if test="orderByClause != null">
|
|
order by ${orderByClause}
|
|
</if>
|
|
<if test="limit != null">
|
|
<if test="offset != null">
|
|
limit ${offset}, ${limit}
|
|
</if>
|
|
<if test="offset == null">
|
|
limit ${limit}
|
|
</if>
|
|
</if>
|
|
</select>
|
|
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
|
|
select
|
|
<include refid="Base_Column_List" />
|
|
from EntPromiseUser
|
|
where EntPromiseUserId = #{entpromiseuserid,jdbcType=VARCHAR}
|
|
</select>
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
|
|
delete from EntPromiseUser
|
|
where EntPromiseUserId = #{entpromiseuserid,jdbcType=VARCHAR}
|
|
</delete>
|
|
<delete id="deleteByExample" parameterType="com.rzyc.model.ent.EntPromiseUserExample">
|
|
delete from EntPromiseUser
|
|
<if test="_parameter != null">
|
|
<include refid="Example_Where_Clause" />
|
|
</if>
|
|
</delete>
|
|
<insert id="insert" parameterType="com.rzyc.model.ent.EntPromiseUser">
|
|
insert into EntPromiseUser (EntPromiseUserId, EntPromiseId, SysEntUserId,
|
|
Sign, CreatedBy, CreatedOn,
|
|
ModifiedOn, ModifiedBy)
|
|
values (#{entpromiseuserid,jdbcType=VARCHAR}, #{entpromiseid,jdbcType=VARCHAR}, #{sysentuserid,jdbcType=VARCHAR},
|
|
#{sign,jdbcType=VARCHAR}, #{createdby,jdbcType=VARCHAR}, #{createdon,jdbcType=TIMESTAMP},
|
|
#{modifiedon,jdbcType=TIMESTAMP}, #{modifiedby,jdbcType=VARCHAR})
|
|
</insert>
|
|
<insert id="insertSelective" parameterType="com.rzyc.model.ent.EntPromiseUser">
|
|
insert into EntPromiseUser
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="entpromiseuserid != null">
|
|
EntPromiseUserId,
|
|
</if>
|
|
<if test="entpromiseid != null">
|
|
EntPromiseId,
|
|
</if>
|
|
<if test="sysentuserid != null">
|
|
SysEntUserId,
|
|
</if>
|
|
<if test="sign != null">
|
|
Sign,
|
|
</if>
|
|
<if test="createdby != null">
|
|
CreatedBy,
|
|
</if>
|
|
<if test="createdon != null">
|
|
CreatedOn,
|
|
</if>
|
|
<if test="modifiedon != null">
|
|
ModifiedOn,
|
|
</if>
|
|
<if test="modifiedby != null">
|
|
ModifiedBy,
|
|
</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="entpromiseuserid != null">
|
|
#{entpromiseuserid,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="entpromiseid != null">
|
|
#{entpromiseid,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="sysentuserid != null">
|
|
#{sysentuserid,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="sign != null">
|
|
#{sign,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="createdby != null">
|
|
#{createdby,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="createdon != null">
|
|
#{createdon,jdbcType=TIMESTAMP},
|
|
</if>
|
|
<if test="modifiedon != null">
|
|
#{modifiedon,jdbcType=TIMESTAMP},
|
|
</if>
|
|
<if test="modifiedby != null">
|
|
#{modifiedby,jdbcType=VARCHAR},
|
|
</if>
|
|
</trim>
|
|
</insert>
|
|
<select id="countByExample" parameterType="com.rzyc.model.ent.EntPromiseUserExample" resultType="java.lang.Long">
|
|
select count(*) from EntPromiseUser
|
|
<if test="_parameter != null">
|
|
<include refid="Example_Where_Clause" />
|
|
</if>
|
|
</select>
|
|
<update id="updateByExampleSelective" parameterType="map">
|
|
update EntPromiseUser
|
|
<set>
|
|
<if test="record.entpromiseuserid != null">
|
|
EntPromiseUserId = #{record.entpromiseuserid,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="record.entpromiseid != null">
|
|
EntPromiseId = #{record.entpromiseid,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="record.sysentuserid != null">
|
|
SysEntUserId = #{record.sysentuserid,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="record.sign != null">
|
|
Sign = #{record.sign,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="record.createdby != null">
|
|
CreatedBy = #{record.createdby,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="record.createdon != null">
|
|
CreatedOn = #{record.createdon,jdbcType=TIMESTAMP},
|
|
</if>
|
|
<if test="record.modifiedon != null">
|
|
ModifiedOn = #{record.modifiedon,jdbcType=TIMESTAMP},
|
|
</if>
|
|
<if test="record.modifiedby != null">
|
|
ModifiedBy = #{record.modifiedby,jdbcType=VARCHAR},
|
|
</if>
|
|
</set>
|
|
<if test="_parameter != null">
|
|
<include refid="Update_By_Example_Where_Clause" />
|
|
</if>
|
|
</update>
|
|
<update id="updateByExample" parameterType="map">
|
|
update EntPromiseUser
|
|
set EntPromiseUserId = #{record.entpromiseuserid,jdbcType=VARCHAR},
|
|
EntPromiseId = #{record.entpromiseid,jdbcType=VARCHAR},
|
|
SysEntUserId = #{record.sysentuserid,jdbcType=VARCHAR},
|
|
Sign = #{record.sign,jdbcType=VARCHAR},
|
|
CreatedBy = #{record.createdby,jdbcType=VARCHAR},
|
|
CreatedOn = #{record.createdon,jdbcType=TIMESTAMP},
|
|
ModifiedOn = #{record.modifiedon,jdbcType=TIMESTAMP},
|
|
ModifiedBy = #{record.modifiedby,jdbcType=VARCHAR}
|
|
<if test="_parameter != null">
|
|
<include refid="Update_By_Example_Where_Clause" />
|
|
</if>
|
|
</update>
|
|
<update id="updateByPrimaryKeySelective" parameterType="com.rzyc.model.ent.EntPromiseUser">
|
|
update EntPromiseUser
|
|
<set>
|
|
<if test="entpromiseid != null">
|
|
EntPromiseId = #{entpromiseid,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="sysentuserid != null">
|
|
SysEntUserId = #{sysentuserid,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="sign != null">
|
|
Sign = #{sign,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="createdby != null">
|
|
CreatedBy = #{createdby,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="createdon != null">
|
|
CreatedOn = #{createdon,jdbcType=TIMESTAMP},
|
|
</if>
|
|
<if test="modifiedon != null">
|
|
ModifiedOn = #{modifiedon,jdbcType=TIMESTAMP},
|
|
</if>
|
|
<if test="modifiedby != null">
|
|
ModifiedBy = #{modifiedby,jdbcType=VARCHAR},
|
|
</if>
|
|
</set>
|
|
where EntPromiseUserId = #{entpromiseuserid,jdbcType=VARCHAR}
|
|
</update>
|
|
<update id="updateByPrimaryKey" parameterType="com.rzyc.model.ent.EntPromiseUser">
|
|
update EntPromiseUser
|
|
set EntPromiseId = #{entpromiseid,jdbcType=VARCHAR},
|
|
SysEntUserId = #{sysentuserid,jdbcType=VARCHAR},
|
|
Sign = #{sign,jdbcType=VARCHAR},
|
|
CreatedBy = #{createdby,jdbcType=VARCHAR},
|
|
CreatedOn = #{createdon,jdbcType=TIMESTAMP},
|
|
ModifiedOn = #{modifiedon,jdbcType=TIMESTAMP},
|
|
ModifiedBy = #{modifiedby,jdbcType=VARCHAR}
|
|
where EntPromiseUserId = #{entpromiseuserid,jdbcType=VARCHAR}
|
|
</update>
|
|
|
|
<!--非法人用户 半年已承诺数量-->
|
|
<select id="findByMonth" resultMap="BaseResultMap">
|
|
SELECT * FROM EntPromiseUser eu
|
|
left join EntPromise ep on ep.`EntPromiseId` = eu.`EntPromiseId`
|
|
WHERE
|
|
eu.`SysEntUserId` = #{sysUserId}
|
|
and ep.`EntPromiseId` is not null
|
|
AND eu.`CreatedOn` > #{startTime}
|
|
AND eu.`CreatedOn` < #{endTime}
|
|
</select>
|
|
</mapper>
|