123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247 |
- <?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.management.platform.mapper.TaskMapper">
- <!-- 通用查询映射结果 -->
- <resultMap id="BaseResultMap" type="com.management.platform.entity.Task">
- <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="repeat_design_sameday" property="repeatDesignSameday" />
- <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" />
- <result column="is_delete" property="isDelete" />
- <result column="plate1" property="plate1" />
- <result column="plate2" property="plate2" />
- <result column="plate3" property="plate3" />
- <result column="plate4" property="plate4" />
- <result column="plate5" property="plate5" />
- </resultMap>
- <!-- 通用查询结果列 -->
- <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, is_repeat, repeat_type, repeat_end_never, repeat_end_count, repeat_end_date, repeat_design_day, repeat_design_sameday, task_desc, creater_id, creater_name, create_date, end_date, start_date, finish_date, is_delete, plate1, plate2, plate3, plate4, plate5
- </sql>
- <resultMap id="TaskVoMap" 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="repeat_design_sameday" property="repeatDesignSameday" />
- <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" />
- <result column="is_delete" property="isDelete" />
- <result column="plate1" property="plate1" />
- <result column="plate2" property="plate2" />
- <result column="plate3" property="plate3" />
- <result column="plate4" property="plate4" />
- <result column="plate5" property="plate5" />
- <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"/>
- <result column="phone" property="phone"/>
- </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="getPageListTask" 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>
- and 1=1 and task.is_delete=0
- <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=" contactsName!= null and contactsName != ''">
- AND contacts.name LIKE CONCAT('%', #{contactsName}, '%')
- </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>
- <if test="pageIndex != null and pageSize != null">
- LIMIT #{pageIndex}, #{pageSize}
- </if>
- </select>
- <select id="getPageListTotalTask" 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>
- and 1=1 and task.is_delete=0
- <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=" contactsName!= null and contactsName != ''">
- AND contacts.name LIKE CONCAT('%', #{contactsName}, '%')
- </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>
- </select>
- <update id="updateRepeatConfig">
- update task
- <set>
- repeat_type=#{repeatType},repeat_end_never=#{repeatEndNever},repeat_end_count=#{repeatEndCount},
- repeat_end_date=#{repeatEndDate},repeat_design_day=#{repeatDesignDay},repeat_design_sameday=#{repeatDesignSameday}
- </set>
- where id=#{id}
- </update>
- </mapper>
|