|
@@ -0,0 +1,230 @@
|
|
|
+<?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.ygj.yuemum.dao.equipment.EquipmenteHireHeadDao" >
|
|
|
+
|
|
|
+ <resultMap id="BaseResultMap" type="com.ygj.yuemum.domain.equipment.EquipmenteHireHead" >
|
|
|
+ <id column="id" property="id" jdbcType="INTEGER" />
|
|
|
+ <result column="eh_code" property="eh_code" jdbcType="VARCHAR" />
|
|
|
+ <result column="eh_mortagage" property="eh_mortagage" jdbcType="INTEGER" />
|
|
|
+ <result column="eh_rental" property="eh_rental" jdbcType="INTEGER" />
|
|
|
+ <result column="eh_cmname" property="eh_cmname" jdbcType="VARCHAR" />
|
|
|
+ <result column="eh_cmphone" property="eh_cmphone" jdbcType="VARCHAR" />
|
|
|
+ <result column="eh_cmidcard" property="eh_cmidcard" jdbcType="VARCHAR" />
|
|
|
+ <result column="eh_cmaddress" property="eh_cmaddress" jdbcType="VARCHAR" />
|
|
|
+ <result column="eh_usercode" property="eh_usercode" jdbcType="VARCHAR" />
|
|
|
+ <result column="eh_date" property="eh_date" jdbcType="DATE" />
|
|
|
+ <result column="eh_status" property="eh_status" jdbcType="INTEGER" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="Base_Column_List" >
|
|
|
+ id,eh_code,eh_mortagage,eh_rental,eh_cmname,eh_cmphone,eh_cmidcard,eh_cmaddress,eh_usercode,eh_date,eh_status
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="getAll" resultMap="BaseResultMap" >
|
|
|
+ SELECT
|
|
|
+ eh_code,
|
|
|
+ eh_cmname,
|
|
|
+ eh_cmphone,
|
|
|
+ eh_rental,
|
|
|
+ eh_mortagage,
|
|
|
+ eh_status,
|
|
|
+ eh_date
|
|
|
+ FROM
|
|
|
+ equipment_hire_head
|
|
|
+ order by eh_date desc , eh_status asc
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getSeq" resultType="java.lang.Integer" >
|
|
|
+ select
|
|
|
+ count(1)
|
|
|
+ from equipment_hire_head
|
|
|
+ where eh_date = date_format(now(),'%Y-%m-%d')
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="queryEquipmenteHireHead" resultMap="BaseResultMap" parameterType="com.ygj.yuemum.domain.equipment.EquipmenteHireHead">
|
|
|
+ select
|
|
|
+ equipment_hire_head.eh_code,
|
|
|
+ equipment_hire_head.eh_cmname,
|
|
|
+ equipment_hire_head.eh_cmphone,
|
|
|
+ equipment_hire_head.eh_rental,
|
|
|
+ equipment_hire_head.eh_mortagage,
|
|
|
+ equipment_hire_head.eh_status,
|
|
|
+ equipment_hire_head.eh_date
|
|
|
+ from equipment_hire_head
|
|
|
+ where eh_code in (
|
|
|
+ SELECT
|
|
|
+ equipment_hire_head.eh_code
|
|
|
+ FROM
|
|
|
+ equipment_hire_head
|
|
|
+ LEFT JOIN equipment_hire_detail ON equipment_hire_head.eh_code = equipment_hire_detail.eh_code
|
|
|
+ where 1=1
|
|
|
+ <if test="eh_code != null and eh_code != ''">and equipment_hire_head.eh_code = #{eh_code,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="eh_status != null and eh_status != ''">
|
|
|
+ and equipment_hire_head.eh_status = #{eh_status,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="eh_date != null and eh_date != ''">
|
|
|
+ and equipment_hire_head.eh_date = #{eh_date,jdbcType=DATE}
|
|
|
+ </if>
|
|
|
+ <if test="eh_usercode != null and eh_usercode != ''">
|
|
|
+ and equipment_hire_head.eh_usercode = #{eh_usercode,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="eh_cmphone != null and eh_cmphone != ''">
|
|
|
+ and equipment_hire_head.eh_cmphone = #{eh_cmphone,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="eh_cmname != null and eh_cmname != ''">
|
|
|
+ and equipment_hire_head.eh_cmname = #{eh_cmname,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="eh_cmaddress != null and eh_cmaddress != ''">
|
|
|
+ and equipment_hire_head.eh_cmaddress like "%"#{eh_cmaddress,jdbcType=VARCHAR}"%"
|
|
|
+ </if>
|
|
|
+ <if test="eh_cmidcard != null and eh_cmidcard != ''">
|
|
|
+ and equipment_hire_head.eh_cmidcard = #{eh_cmidcard,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="eh_rental != null and eh_rental != ''">
|
|
|
+ and equipment_hire_head.eh_rental = #{eh_rental,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="et_type != null and eh_mortagage != ''">
|
|
|
+ and eequipment_hire_head.h_mortagage = #{eh_mortagage,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="et_type != null and et_type != ''">
|
|
|
+ and equipment_hire_detail.et_type = #{et_type,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="ed_emcode != null and ed_emcode != ''">
|
|
|
+ and equipment_hire_detail.ed_emcode = #{ed_emcode,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="ed_startdate != null and ed_startdate != ''">
|
|
|
+ and equipment_hire_detail.ed_startdate = #{ed_startdate,jdbcType=DATE}
|
|
|
+ </if>
|
|
|
+ <if test="ed_enddate != null and ed_enddate != ''">
|
|
|
+ and equipment_hire_detail.ed_enddate = #{ed_enddate,jdbcType=DATE}
|
|
|
+ </if>
|
|
|
+ )
|
|
|
+ ORDER BY
|
|
|
+ equipment_hire_head.eh_date desc,
|
|
|
+ equipment_hire_head.eh_status ASC
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List" />
|
|
|
+ from equipment_hire_head
|
|
|
+ where eh_code = #{eh_code,jdbcType=INTEGER}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getEquipmenteHireHead" resultMap="BaseResultMap" parameterType="java.lang.String" >
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List" />
|
|
|
+ from equipment_hire_head
|
|
|
+ where eh_code = #{eh_code,jdbcType=INTEGER}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
|
|
|
+ delete from equipment_hire_head
|
|
|
+ where eh_code = #{eh_code,jdbcType=VARCHAR}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <!-- 插入一条培训信息 -->
|
|
|
+ <insert id="insertSelective" parameterType="com.ygj.yuemum.domain.equipment.EquipmenteHireHead" >
|
|
|
+ insert into equipment_hire_head
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides="," >
|
|
|
+ <if test="eh_code != null" >
|
|
|
+ eh_code,
|
|
|
+ </if>
|
|
|
+ <if test="eh_mortagage != null" >
|
|
|
+ eh_mortagage,
|
|
|
+ </if>
|
|
|
+ <if test="eh_rental != null" >
|
|
|
+ eh_rental,
|
|
|
+ </if>
|
|
|
+ <if test="eh_cmname != null" >
|
|
|
+ eh_cmname,
|
|
|
+ </if>
|
|
|
+ <if test="eh_cmphone != null" >
|
|
|
+ eh_cmphone,
|
|
|
+ </if>
|
|
|
+ <if test="eh_cmidcard != null" >
|
|
|
+ eh_cmidcard,
|
|
|
+ </if>
|
|
|
+ <if test="eh_cmaddress != null" >
|
|
|
+ eh_cmaddress,
|
|
|
+ </if>
|
|
|
+ <if test="eh_usercode != null" >
|
|
|
+ eh_usercode,
|
|
|
+ </if>
|
|
|
+ <if test="eh_date != null" >
|
|
|
+ eh_date,
|
|
|
+ </if>
|
|
|
+ <if test="eh_status != null" >
|
|
|
+ eh_status
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides="," >
|
|
|
+ <if test="eh_code != null" >
|
|
|
+ #{eh_code,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="eh_mortagage != null" >
|
|
|
+ #{eh_mortagage,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="eh_rental != null" >
|
|
|
+ #{eh_rental,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="eh_cmname != null" >
|
|
|
+ #{eh_cmname,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="eh_cmphone != null" >
|
|
|
+ #{eh_cmphone,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="eh_cmidcard != null" >
|
|
|
+ #{eh_cmidcard,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="eh_cmaddress != null" >
|
|
|
+ #{eh_cmaddress,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="eh_usercode != null" >
|
|
|
+ #{eh_usercode,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="eh_date != null" >
|
|
|
+ #{eh_date,jdbcType=DATE},
|
|
|
+ </if>
|
|
|
+ <if test="eh_status != null" >
|
|
|
+ #{eh_status,jdbcType=DATE}
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <!-- 根据id更新一条培训信息 -->
|
|
|
+ <update id="updateByPrimaryKeySelective" parameterType="com.ygj.yuemum.domain.equipment.EquipmenteHireHead" >
|
|
|
+ update equipment_hire_head
|
|
|
+ <set >
|
|
|
+ <if test="eh_mortagage != null" >
|
|
|
+ eh_mortagage = #{eh_mortagage,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="eh_rental != null" >
|
|
|
+ eh_rental = #{eh_rental,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="eh_cmname != null" >
|
|
|
+ eh_cmname = #{eh_cmname,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="eh_cmphone != null" >
|
|
|
+ eh_cmphone = #{eh_cmphone,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="eh_cmidcard != null" >
|
|
|
+ eh_cmidcard = #{eh_cmidcard,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="eh_cmaddress != null" >
|
|
|
+ eh_cmaddress = #{eh_cmaddress,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="eh_usercode != null" >
|
|
|
+ eh_usercode = #{eh_usercode,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="eh_date != null" >
|
|
|
+ eh_date = #{eh_date,jdbcType=DATE},
|
|
|
+ </if>
|
|
|
+ <if test="eh_status != null" >
|
|
|
+ eh_status = #{eh_status,jdbcType=DATE}
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where eh_code = #{eh_code,jdbcType=INTEGER}
|
|
|
+ </update>
|
|
|
+</mapper>
|