123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292 |
- <?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.idea.saleManage.mapper.CheckInMapper">
- <resultMap id="BaseResultMap" type="com.idea.saleManage.model.CheckIn">
- <id column="id" jdbcType="VARCHAR" property="id"/>
- <result column="contract_manage_id" jdbcType="VARCHAR" property="contractManageId"/>
- <result column="status" jdbcType="VARCHAR" property="status"/>
- <result column="in_date" jdbcType="TIMESTAMP" property="inDate"/>
- <result column="remark" jdbcType="VARCHAR" property="remark"/>
- <result column="operate_time" jdbcType="TIMESTAMP" property="operateTime"/>
- <result column="operater_id" jdbcType="VARCHAR" property="operaterId"/>
- </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">
- id
- , contract_manage_id, status, in_date, remark, operate_time, operater_id
- </sql>
- <select id="selectByExample" parameterType="com.idea.saleManage.model.CheckInExample" resultMap="BaseResultMap">
- select
- <if test="distinct">
- distinct
- </if>
- <include refid="Base_Column_List"/>
- from check_in
- <if test="_parameter != null">
- <include refid="Example_Where_Clause"/>
- </if>
- <if test="orderByClause != null">
- order by ${orderByClause}
- </if>
- </select>
- <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List"/>
- from check_in
- where id = #{id,jdbcType=VARCHAR}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
- delete
- from check_in
- where id = #{id,jdbcType=VARCHAR}
- </delete>
- <delete id="deleteByExample" parameterType="com.idea.saleManage.model.CheckInExample">
- delete from check_in
- <if test="_parameter != null">
- <include refid="Example_Where_Clause"/>
- </if>
- </delete>
- <insert id="insert" parameterType="com.idea.saleManage.model.CheckIn">
- insert into check_in (id, contract_manage_id, status,
- in_date, remark, operate_time,
- operater_id)
- values (#{id,jdbcType=VARCHAR}, #{contractManageId,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR},
- #{inDate,jdbcType=TIMESTAMP}, #{remark,jdbcType=VARCHAR}, #{operateTime,jdbcType=TIMESTAMP},
- #{operaterId,jdbcType=VARCHAR})
- </insert>
- <insert id="insertSelective" parameterType="com.idea.saleManage.model.CheckIn">
- insert into check_in
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">
- id,
- </if>
- <if test="contractManageId != null">
- contract_manage_id,
- </if>
- <if test="status != null">
- status,
- </if>
- <if test="inDate != null">
- in_date,
- </if>
- <if test="remark != null">
- remark,
- </if>
- <if test="operateTime != null">
- operate_time,
- </if>
- <if test="operaterId != null">
- operater_id,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null">
- #{id,jdbcType=VARCHAR},
- </if>
- <if test="contractManageId != null">
- #{contractManageId,jdbcType=VARCHAR},
- </if>
- <if test="status != null">
- #{status,jdbcType=VARCHAR},
- </if>
- <if test="inDate != null">
- #{inDate,jdbcType=TIMESTAMP},
- </if>
- <if test="remark != null">
- #{remark,jdbcType=VARCHAR},
- </if>
- <if test="operateTime != null">
- #{operateTime,jdbcType=TIMESTAMP},
- </if>
- <if test="operaterId != null">
- #{operaterId,jdbcType=VARCHAR},
- </if>
- </trim>
- </insert>
- <select id="countByExample" parameterType="com.idea.saleManage.model.CheckInExample" resultType="java.lang.Long">
- select count(*) from check_in
- <if test="_parameter != null">
- <include refid="Example_Where_Clause"/>
- </if>
- </select>
- <update id="updateByExampleSelective" parameterType="map">
- update check_in
- <set>
- <if test="record.id != null">
- id = #{record.id,jdbcType=VARCHAR},
- </if>
- <if test="record.contractManageId != null">
- contract_manage_id = #{record.contractManageId,jdbcType=VARCHAR},
- </if>
- <if test="record.status != null">
- status = #{record.status,jdbcType=VARCHAR},
- </if>
- <if test="record.inDate != null">
- in_date = #{record.inDate,jdbcType=TIMESTAMP},
- </if>
- <if test="record.remark != null">
- remark = #{record.remark,jdbcType=VARCHAR},
- </if>
- <if test="record.operateTime != null">
- operate_time = #{record.operateTime,jdbcType=TIMESTAMP},
- </if>
- <if test="record.operaterId != null">
- operater_id = #{record.operaterId,jdbcType=VARCHAR},
- </if>
- </set>
- <if test="_parameter != null">
- <include refid="Update_By_Example_Where_Clause"/>
- </if>
- </update>
- <update id="updateByExample" parameterType="map">
- update check_in
- set id = #{record.id,jdbcType=VARCHAR},
- contract_manage_id = #{record.contractManageId,jdbcType=VARCHAR},
- status = #{record.status,jdbcType=VARCHAR},
- in_date = #{record.inDate,jdbcType=TIMESTAMP},
- remark = #{record.remark,jdbcType=VARCHAR},
- operate_time = #{record.operateTime,jdbcType=TIMESTAMP},
- operater_id = #{record.operaterId,jdbcType=VARCHAR}
- <if test="_parameter != null">
- <include refid="Update_By_Example_Where_Clause"/>
- </if>
- </update>
- <update id="updateByPrimaryKeySelective" parameterType="com.idea.saleManage.model.CheckIn">
- update check_in
- <set>
- <if test="contractManageId != null">
- contract_manage_id = #{contractManageId,jdbcType=VARCHAR},
- </if>
- <if test="status != null">
- status = #{status,jdbcType=VARCHAR},
- </if>
- <if test="inDate != null">
- in_date = #{inDate,jdbcType=TIMESTAMP},
- </if>
- <if test="remark != null">
- remark = #{remark,jdbcType=VARCHAR},
- </if>
- <if test="operateTime != null">
- operate_time = #{operateTime,jdbcType=TIMESTAMP},
- </if>
- <if test="operaterId != null">
- operater_id = #{operaterId,jdbcType=VARCHAR},
- </if>
- </set>
- where id = #{id,jdbcType=VARCHAR}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.idea.saleManage.model.CheckIn">
- update check_in
- set contract_manage_id = #{contractManageId,jdbcType=VARCHAR},
- status = #{status,jdbcType=VARCHAR},
- in_date = #{inDate,jdbcType=TIMESTAMP},
- remark = #{remark,jdbcType=VARCHAR},
- operate_time = #{operateTime,jdbcType=TIMESTAMP},
- operater_id = #{operaterId,jdbcType=VARCHAR}
- where id = #{id,jdbcType=VARCHAR}
- </update>
- <!-- ================新增============================ -->
- <select id="findList" parameterType="com.idea.saleManage.model.CheckInMore"
- resultType="com.idea.saleManage.model.CheckInMore">
- SELECT
- contract_manage.id as contract_manage_id2,
- contract_manage.customer_management_id,
- contract_manage.buyer_Name,
- contract_manage.contract_Number,
- contract_manage.house_Name,
- frame_user.username as operater,
- check_in.*
- FROM
- contract_manage
- LEFT JOIN check_in ON check_in.contract_manage_id = contract_manage.id
- left join frame_user on frame_user.id=check_in.operater_id
- left join park_room on park_room.id = contract_manage.house_id
- WHERE
- fund_collection_status =2 and contract_manage.contract_status != 3
- <if test="record.buyerName != null and record.buyerName != ''">
- and contract_manage.buyer_Name like concat('%',#{record.buyerName},'%')
- </if>
- <if test="record.houseName != null and record.houseName != ''">
- and contract_manage.house_Name like concat('%',#{record.houseName},'%')
- </if>
- <if test="record.status != null and record.status != ''">
- <if test="record.status = '0'">
- and check_in.status is null
- </if>
- <if test="record.status = '1'">
- and check_in.status = '1'
- </if>
- <if test="record.status = '2'">
- and check_in.status = '2'
- </if>
- </if>
- <if test="record.buyerIdentityCard != null and record.buyerIdentityCard != ''">
- and customer_management_id in (select customer_management_id from buyer where identity_card like concat('%',#{record.buyerIdentityCard},'%'))
- </if>
- <if test="record.batchNumber != null and record.batchNumber != ''">
- and customer_management_id in (select id from customer_management where batch_number like concat('%',#{record.batchNumber},'%'))
- </if>
- order by park_room.group_name , park_room.disc_name , park_room.build_name , park_room.room_no + 0
- </select>
- </mapper>
|