智慧工地项目
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
intelligence-site/src/main/resources/mappers/IProgressMapper.xml

68 lines
3.4 KiB

<?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.zilber.boot.intelligencesite.mapper.IProgressMapper">
<resultMap id="IProgressResult" type="com.zilber.boot.intelligencesite.entity.IProgress">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="planId" column="plan_id" jdbcType="INTEGER"/>
<result property="planName" column="plan_name" jdbcType="VARCHAR"/>
<result property="dayProgress" column="day_progress" jdbcType="INTEGER"/>
<result property="accumulativeProgress" column="accumulative_progress" jdbcType="INTEGER"/>
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
<result property="creator" column="creator" jdbcType="VARCHAR"/>
<result property="startTime" column="start_time" jdbcType="TIMESTAMP"/>
<result property="endTime" column="end_time" jdbcType="TIMESTAMP"/>
<result property="processDate" column="process_date" jdbcType="TIMESTAMP"/>
</resultMap>
<sql id="selectIProgressVo">
select
id, plan_id, plan_name, day_progress, accumulative_progress, create_time, creator,process_date from i_progress
</sql>
<select id="queryList" parameterType="com.zilber.boot.intelligencesite.entity.IProgress" resultMap="IProgressResult">
<include refid="selectIProgressVo"/>
<where>
<if test="planId != null"> and plan_id=#{planId}</if>
<if test="planName != null and planName != ''"> and plan_name like concat('%', #{planName}, '%')</if>
<if test="dayProgress != null"> and day_progress like concat('%', #{dayProgress}, '%')</if>
<if test="accumulativeProgress != null"> and accumulative_progress like concat('%', #{accumulativeProgress}, '%')</if>
<if test="createTime != null"> and create_time=#{createTime}</if>
<if test="creator != null and creator != ''"> and creator=#{creator}</if>
<if test="processDate != null"> and date_format(login_time,'%y%m%d')=date_format(#{processDate},'%y%m%d')</if>
</where>
order by create_time desc
</select>
<select id="queryListByContion" parameterType="com.zilber.boot.intelligencesite.entity.IProgress" resultMap="IProgressResult" >
<!-- SELECT
ip.id,
ip.plan_id,
ip.plan_name,
ip.day_progress,
ip.accumulative_progress,
ip.create_time,
ip.creator,
ip.parent_id,
ipn.start_time,
ipn.end_time
FROM
i_progress ip
left JOIN i_production_plan ipn ON ip.plan_id = ipn.id-->
select
id, plan_id, plan_name, day_progress, accumulative_progress, create_time, creator,process_date,parent_id from i_progress
<where>
<if test="planId != null"> and plan_id=#{planId}</if>
<if test="planName != null and planName != ''"> and plan_name like concat('%', #{planName}, '%')</if>
<if test="dayProgress != null"> and day_progress like concat('%', #{dayProgress}, '%')</if>
<if test="accumulativeProgress != null"> and accumulative_progress like concat('%', #{accumulativeProgress}, '%')</if>
<if test="createTime != null"> and create_time=#{createTime}</if>
<if test="creator != null and creator != ''"> and creator=#{creator}</if>
</where>
</select>
<select id="queryYsg" resultMap="IProgressResult">
select * from i_progress where accumulative_progress is not null GROUP BY plan_id
</select>
</mapper>