| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128 |
- <?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.hotent.project.dao.CostProjectMemoDao">
- <!-- 通用查询映射结果 -->
- <resultMap id="BaseResultMap" type="com.hotent.project.model.CostProjectMemo">
- <id column="id" property="id" />
- <result column="project_id" property="projectId" />
- <result column="title" property="title" />
- <result column="content" property="content" />
- <result column="memo_date" property="memoDate" />
- <result column="time_period" property="timePeriod" />
- <result column="reminder_type" property="reminderType" />
- <result column="attachment_url" property="attachmentUrl" />
- <result column="attachment_name" property="attachmentName" />
- <result column="attachment_size" property="attachmentSize" />
- <result column="area_code" property="areaCode" />
- <result column="area_level" property="areaLevel" />
- <result column="create_by" property="createBy" />
- <result column="create_time" property="createTime" />
- <result column="update_by" property="updateBy" />
- <result column="update_time" property="updateTime" />
- </resultMap>
- <!-- 通用查询结果列 -->
- <sql id="Base_Column_List">
- id, project_id, title, content, memo_date, time_period, reminder_type, attachment_url, attachment_name, attachment_size, area_code, area_level, create_by, create_time, update_time,update_by
- </sql>
- <update id="updateMemo">
- update cost_project_memo
- <trim prefix="set" suffixOverrides=",">
- <if test="projectId!= null">
- project_id = #{projectId},
- </if>
- <if test="title != null">
- title = #{title},
- </if>
- <if test="content != null">
- content = #{content},
- </if>
- <if test="memoDate != null">
- memo_date = #{memoDate},
- </if>
- <if test="timePeriod != null">
- time_period = #{timePeriod},
- </if>
- <if test="reminderType != null">
- reminder_type = #{reminderType},
- </if>
- <if test="attachmentUrl != null">
- attachment_url = #{attachmentUrl},
- </if>
- where id = #{id}
- </trim>
- </update>
- <select id="selectPage" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List"/>
- from
- cost_project_memo
- ${ew.customSqlSegment}
- </select>
-
- <select id="selectList" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List"/>
- from
- cost_project_memo
- ${ew.customSqlSegment}
- </select>
-
- <select id="selectById" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List"/>
- from
- cost_project_memo
- where
- id = ${id}
- </select>
- <select id="getCostProjectMemoPage" resultMap="BaseResultMap">
- SELECT
- cpm.id,
- cpm.project_id,
- cpa.project_name,
- cpm.memo_date,
- cpm.title,
- cpm.content,
- cpm.reminder_type
- FROM
- cost_project_memo cpm,
- cost_project_approval cpa,
- uc_user uc
- WHERE
- cpm.project_id = cpa.project_id
- AND uc.ACCOUNT_ = cpm.create_by
- <if test=" projectId != null and projectId != '' ">
- AND cpm.project_id=#{projectId}
- </if>
- <if test=" content != null and content != '' ">
- AND cpm.content LIKE CONCAT('%', #{content}, '%')
- </if>
- <if test=" year != null and year != '' ">
- AND cpm.year LIKE CONCAT('%', #{year}, '%')
- </if>
- <if test="startTime != null and endTime != null
- and startTime != '' and endTime != ''">
- AND #{param.startTime} <= DATE_FORMAT(cpm.create_time, '%Y-%m-%d')
- AND #{param.endTime} >= DATE_FORMAT(cpm.create_time, '%Y-%m-%d')
- </if>
- <if test=" dataScope != null and dataScope != ''">
- <if test=" dataScope ==1">
- and (uc.CITY_CODE=#{ cityCode} or cpm.area_code=#{ cityCode})
- </if>
- <if test=" dataScope ==2">
- and (uc.COUNTY_CODE=#{ countyCode} or cpm.area_code=#{ countyCode})
- </if>
- </if>
- ORDER BY cpm.create_time DESC
- </select>
- </mapper>
|