<?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.qunzhixinxi.hnqz.admin.mapper.WmContractMapper" >
  <resultMap id="wmContractMapper" type="com.qunzhixinxi.hnqz.admin.entity.WmContract" >
    <id column="id" property="id"/>
    <result column="contract_number" property="contractNumber"/>
    <result column="contract_name" property="contractName"/>
    <result column="sign_jia" property="signJia"/>
    <result column="dept_id" property="deptId"/>
    <result column="sign_yi" property="signYi"/>
    <result column="sign_time" property="signTime"/>
    <result column="filing_time" property="filingTime"/>
    <result column="state" property="state"/>
    <result column="annex_contract" property="annexContract"/>
    <result column="remark" property="remark"/>
	<result column="create_time" property="createTime"/>
	<result column="update_user" property="updateUser"/>
	<result column="update_time" property="updateTime"/>
  </resultMap>
	<sql id="Base_Column_List">
    id, contract_number, contract_name,sign_jia, sign_yi, sign_time, filing_time,
     state, annex_contract, remark, create_time, update_time, dept_id
  </sql>
	<select id="selectContractList" resultMap="wmContractMapper">
		select
		<include refid="Base_Column_List"/>
		from wm_contract0609 where 1=1
		<if test="query.contractNumber != null and query.contractNumber !=''">
			AND contract_number like CONCAT('%',#{query.contractNumber},'%')
		</if>
		<if test="query.contractName != null and query.contractName !=''">
			AND contract_name like CONCAT('%',#{query.contractName},'%')
		</if>
		<if test="query.signJia != null and query.signJia !=''">
			AND sign_jia like CONCAT('%',#{query.signJia},'%')
		</if>
		<if test="query.signYi != null and query.signYi!=''">
			AND sign_yi = #{query.signYi,jdbcType=VARCHAR}
		</if>
		<if test="query.deptId != null and query.deptId!=''">
			AND dept_id = #{query.deptId,jdbcType=VARCHAR}
		</if>
		<if test="query.signTime != null and query.signTime !=''">
			AND sign_time = #{query.signTime,jdbcType=VARCHAR}
		</if>
		<if test="query.filingTime != null and query.filingTime!='' ">
			AND filing_time = #{query.filingTime,jdbcType=VARCHAR}
		</if>
		<if test="query.state != null and query.state!='' ">
			AND state = #{query.state,jdbcType=VARCHAR}
		</if>
		<if test="query.annexContract != null and query.annexContract!='' ">
			AND annex_contract = #{query.annexContract,jdbcType=VARCHAR}
		</if>
		<if test="query.remark != null and query.remark!='' ">
			AND remark = #{query.remark,jdbcType=VARCHAR}
		</if>
		<if test="query.createTime != null and query.createTime!=''">
			AND create_time = #{query.createTime,jdbcType=VARCHAR}
		</if>
		<if test="query.updateUser != null and query.updateUser!=''">
			AND update_user = #{query.updateUser,jdbcType=VARCHAR}
		</if>
		<if test="query.updateTime != null and query.updateTime!=''">
			AND update_time = #{query.updateTime,jdbcType=VARCHAR}
		</if>
		order by id desc
	</select>
</mapper>