|
@@ -17,7 +17,7 @@
|
|
|
<result column="product_id" property="productId" />
|
|
|
<result column="status" property="status" />
|
|
|
<result column="priority" property="priority" />
|
|
|
- <result column="repeat" property="repeat" />
|
|
|
+ <result column="is_repeat" property="isRepeat" />
|
|
|
<result column="repeat_type" property="repeatType" />
|
|
|
<result column="repeat_end_never" property="repeatEndNever" />
|
|
|
<result column="repeat_end_count" property="repeatEndCount" />
|
|
@@ -39,7 +39,133 @@
|
|
|
|
|
|
<!-- 通用查询结果列 -->
|
|
|
<sql id="Base_Column_List">
|
|
|
- id, task_name, company_id, owner_id, contacts_id, executor_id, clue_id, custom_id, business_opportunity_id, order_id, product_id, status, priority, repeat, repeat_type, repeat_end_never, repeat_end_count, repeat_end_date, repeat_design_day, task_desc, creater_id, creater_name, create_date, end_date, start_date, finish_date, plate1, plate2, plate3, plate4, plate5
|
|
|
+ id, task_name, company_id, owner_id, contacts_id, executor_id, clue_id, custom_id, business_opportunity_id, order_id, product_id, status, priority, is_repeat, repeat_type, repeat_end_never, repeat_end_count, repeat_end_date, repeat_design_day, task_desc, creater_id, creater_name, create_date, end_date, start_date, finish_date, plate1, plate2, plate3, plate4, plate5
|
|
|
</sql>
|
|
|
|
|
|
+ <resultMap id="TaskVoMap" type="com.management.platform.entity.vo.TasKVo">
|
|
|
+ <id column="id" property="id" />
|
|
|
+ <association property="custom" javaType="com.management.platform.entity.Custom">
|
|
|
+ <id column="custom_id" property="id"/>
|
|
|
+ <result column="custom_name" property="customName"/>
|
|
|
+ </association>
|
|
|
+ <association property="businessOpportunity" javaType="com.management.platform.entity.BusinessOpportunity">
|
|
|
+ <id column="business_opportunity_id" property="id"/>
|
|
|
+ <result column="businessName" property="name"/>
|
|
|
+ </association>
|
|
|
+ <association property="order" javaType="com.management.platform.entity.Order">
|
|
|
+ <id column="order_id" property="id"/>
|
|
|
+ <result column="order_name" property="orderName"/>
|
|
|
+ </association>
|
|
|
+ <association property="clue" javaType="com.management.platform.entity.Clue">
|
|
|
+ <id column="clue_id" property="id"/>
|
|
|
+ <result column="clue_name" property="clueName"/>
|
|
|
+ </association>
|
|
|
+ <association property="contacts" javaType="com.management.platform.entity.Contacts">
|
|
|
+ <id column="contacts_id" property="id"/>
|
|
|
+ <result column="contacts_name" property="name"/>
|
|
|
+ </association>
|
|
|
+ <collection property="taskExecutors" ofType="com.management.platform.entity.TaskExecutor">
|
|
|
+ <id column="task_executor_id" property="taskExecutorId"/>
|
|
|
+ <result column="taskExecutor_executor_id" property="executorId"/>
|
|
|
+ <result column="executor_name" property="executorName"/>
|
|
|
+ </collection>
|
|
|
+
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <select id="pageTask" resultMap="TaskVoMap">
|
|
|
+ select task.* ,
|
|
|
+ custom.custom_name,
|
|
|
+ business_opportunity.name businessName,
|
|
|
+ `order`.order_name ,
|
|
|
+ clue.clue_name,
|
|
|
+ contacts.name contacts_name ,contacts.phone,
|
|
|
+ task_executor.task_executor_id, task_executor.executor_id taskExecutor_executor_id,task_executor.executor_name
|
|
|
+ from task
|
|
|
+ left join custom on task.custom_id=custom.id
|
|
|
+ left join business_opportunity on task.business_opportunity_id=business_opportunity.id
|
|
|
+ left join `order` on task.order_id=`order`.id
|
|
|
+ left join clue on task.clue_id=clue.id
|
|
|
+ left join contacts on task.contacts_id=contacts.id
|
|
|
+ left join task_executor on task.id=task_executor.task_id
|
|
|
+
|
|
|
+ <where>
|
|
|
+ <if test=" taskName!= null and taskName != ''">
|
|
|
+ AND task.task_name LIKE CONCAT('%', #{taskName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test=" priority!= null ">
|
|
|
+ AND task.priority =#{priority}
|
|
|
+ </if>
|
|
|
+ <if test=" customName!= null and customName != ''">
|
|
|
+ AND custom.custom_name LIKE CONCAT('%', #{customName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test=" businessName!= null and businessName != ''">
|
|
|
+ AND business_opportunity.name LIKE CONCAT('%', #{businessName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test=" orderName!= null and orderName != ''">
|
|
|
+ AND `order`.order_name LIKE CONCAT('%', #{orderName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test=" clueName!= null and clueName != ''">
|
|
|
+ AND clue.clue_name LIKE CONCAT('%', #{clueName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test=" phone!= null and phone != ''">
|
|
|
+ AND contacts.phone LIKE CONCAT('%', #{phone}, '%')
|
|
|
+ </if>
|
|
|
+ <if test=" status!= null ">
|
|
|
+ AND task.status = #{status}
|
|
|
+ </if>
|
|
|
+ <if test=" executorName!= null and executorName != '' ">
|
|
|
+ AND task_executor.executor_name LIKE CONCAT('%', #{executorName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test=" startDate!= null and startDate != '' ">
|
|
|
+ AND task.start_date > #{startDate}
|
|
|
+ </if>
|
|
|
+ <if test=" endDate!= null and endDate != '' ">
|
|
|
+ AND task.end_date < #{endDate}
|
|
|
+ </if>
|
|
|
+ <if test=" companyId!= null ">
|
|
|
+ AND task.company_id = #{companyId}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ </where>
|
|
|
+ limit #{pageIndex},#{pageSize}
|
|
|
+
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <resultMap id="testMap" type="com.management.platform.entity.vo.TasKVo">
|
|
|
+ <id column="id" property="id" />
|
|
|
+ <result column="task_name" property="taskName" />
|
|
|
+ <result column="company_id" property="companyId" />
|
|
|
+ <result column="owner_id" property="ownerId" />
|
|
|
+ <result column="contacts_id" property="contactsId" />
|
|
|
+ <result column="executor_id" property="executorId" />
|
|
|
+ <result column="clue_id" property="clueId" />
|
|
|
+ <result column="custom_id" property="customId" />
|
|
|
+ <result column="business_opportunity_id" property="businessOpportunityId" />
|
|
|
+ <result column="order_id" property="orderId" />
|
|
|
+ <result column="product_id" property="productId" />
|
|
|
+ <result column="status" property="status" />
|
|
|
+ <result column="priority" property="priority" />
|
|
|
+ <result column="is_repeat" property="isRepeat" />
|
|
|
+ <result column="repeat_type" property="repeatType" />
|
|
|
+ <result column="repeat_end_never" property="repeatEndNever" />
|
|
|
+ <result column="repeat_end_count" property="repeatEndCount" />
|
|
|
+ <result column="repeat_end_date" property="repeatEndDate" />
|
|
|
+ <result column="repeat_design_day" property="repeatDesignDay" />
|
|
|
+ <result column="task_desc" property="taskDesc" />
|
|
|
+ <result column="creater_id" property="createrId" />
|
|
|
+ <result column="creater_name" property="createrName" />
|
|
|
+ <result column="create_date" property="createDate" />
|
|
|
+ <result column="end_date" property="endDate" />
|
|
|
+ <result column="start_date" property="startDate" />
|
|
|
+ <result column="finish_date" property="finishDate" />
|
|
|
+ <collection property="taskExecutors" ofType="com.management.platform.entity.TaskExecutor">
|
|
|
+ <id column="task_executor_id" property="taskExecutorId"/>
|
|
|
+ <result column="executor_name" property="executorName"/>
|
|
|
+ </collection>
|
|
|
+
|
|
|
+ </resultMap>
|
|
|
+ <select id="test" resultMap="testMap">
|
|
|
+ select t.*,e.task_executor_id,e.executor_name from task t left join task_executor e ON t.id = e.task_id limit #{pageIndex},#{pageSize}
|
|
|
+ </select>
|
|
|
+
|
|
|
</mapper>
|