123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
- <?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.zglc.fm.dao.master.FaultDao">
- <!-- 可根据自己的需求,是否要使用 -->
- <resultMap type="com.zglc.fm.entity.FaultEntity" id="faultMap">
- <result property="id" column="id"/>
- <result property="fault_name" column="fault_name"/>
- <result property="fault_number" column="fault_number"/>
- <result property="author" column="author"/>
- <result property="department" column="department"/>
- <result property="aircraft_type" column="aircraft_type"/>
- <result property="major_type" column="major_type"/>
- <result property="description" column="description"/>
- <result property="file_path" column="file_path"/>
- <result property="input_time" column="input_time"/>
- <result property="fault_time" column="fault_time"/>
- <result property="book_name" column="book_name"/>
- <result property="chapter" column="chapter"/>
- <result property="remarks" column="remarks"/>
- </resultMap>
- <resultMap type="com.zglc.fm.entity.aircraftStaEntity" id="staMap">
- <result property="aircraftType" column="aircraftType"/>
- <result property="num" column="num"/>
- </resultMap>
- <select id="listAll" resultMap="faultMap">
- select id,fault_name,fault_number,author,aircraft_type,major_type,description,file_path,input_time,fault_time,book_name,chapter,remarks
- from t_fault
- where id > 0
- </select>
- <select id="getCount" resultType="java.lang.Integer">
- select count(1)
- from t_fault
- </select>
- <select id="getCountByAircaft" parameterType="String" resultType="java.lang.Integer">
- select count(1)
- from t_fault
- where aircraft_type = #{aircraftType}
- </select>
- <select id="aircraftSta" parameterType="java.util.ArrayList" resultMap="staMap">
- select aircraft_type,count(aircraft_type) as num from t_fault group by aircraft_type
- </select>
- <!-- <insert id="batchAdd" parameterType="java.util.List">-->
- <!-- <foreach collection="list" item="equ" separator=";">-->
- <!-- insert into t_equipment (equipment_type)-->
- <!-- SELECT #{equ.equipment_type}-->
- <!-- FROM DUAL WHERE NOT EXISTS (SELECT equipment_type FROM t_equipment WHERE equipment_type = #{equ.equipment_type})-->
- <!-- </foreach>-->
- <!-- </insert>-->
- <select id="findByName" parameterType="String" resultMap="faultMap">
- select id,fault_name,fault_number,author,aircraft_type,major_type,description,file_path,input_time,fault_time,book_name,chapter,remarks from t_fault where fault_name
- like #{fault_name}
- </select>
- <select id="findByBookName" parameterType="String" resultMap="faultMap">
- select * from t_fault where book_name
- like #{name}
- and major_type = #{major}
- and aircraft_type = #{aircraftType}
- </select>
- <select id="findByFaultName" parameterType="String" resultMap="faultMap">
- select * from t_fault where fault_name
- like #{name}
- and major_type = #{major}
- and aircraft_type = #{aircraftType}
- </select>
- <select id="findByAuthor" parameterType="String" resultMap="faultMap">
- select * from t_fault where author
- like #{name}
- and major_type = #{major}
- and aircraft_type = #{aircraftType}
- </select>
- <select id="findByDepartment" parameterType="String" resultMap="faultMap">
- select * from t_fault where department
- like #{name}
- and major_type = #{major}
- and aircraft_type = #{aircraftType}
- </select>
- <select id="findByDescription" parameterType="String" resultMap="faultMap">
- select * from t_fault where description
- like #{name}
- and major_type = #{major}
- and aircraft_type = #{aircraftType}
- </select>
- <select id="findByMultiple" parameterType="String" resultMap="faultMap">
- select * from t_fault where (book_name like #{name} and major_type = #{major})
- or (fault_name like #{name} and major_type = #{major})
- </select>
- <select id="findByFaultTime" parameterType="com.zglc.fm.entity.FaultFind" resultMap="faultMap">
- select *
- from t_fault where 1=1
- <if test="major !=null">
- and major_type = #{major}
- </if>
- <if test="aircraftType !=null">
- and aircraft_type = #{aircraftType}
- </if>
- <if test="beginTime != null">
- and fault_time <![CDATA[>=]]> #{beginTime}
- </if>
- <if test="finishTime !=null">
- and fault_time <![CDATA[<=]]> #{finishTime}
- </if>
- </select>
- </mapper>
|