| | |
| | | <?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.yuanchu.mom.mapper.AuxiliaryOutputWorkingHoursMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.yuanchu.mom.pojo.AuxiliaryOutputWorkingHours"> |
| | | <id column="id" property="id" /> |
| | |
| | | <result column="create_user" property="createUser" /> |
| | | <result column="update_user" property="updateUser" /> |
| | | </resultMap> |
| | | <select id="selectAuxiliaryOutputWorkingHours" resultType="com.yuanchu.mom.pojo.AuxiliaryOutputWorkingHours"> |
| | | select data.* |
| | | from ( |
| | | <select id="selectAuxiliaryOutputWorkingHours" resultType="com.yuanchu.mom.dto.AuxiliaryOutputWorkingHoursDto"> |
| | | select * |
| | | FROM auxiliary_output_working_hours |
| | | from ( |
| | | select aowh.id, |
| | | inspect_project, |
| | | overtime_order_no, |
| | | overtime_work_time, |
| | | overtime_amount, |
| | | order_no, |
| | | work_time, |
| | | amount, |
| | | output_work_time, |
| | | date_time, |
| | | week, |
| | | week_day, |
| | | name |
| | | FROM auxiliary_output_working_hours aowh |
| | | left join user on user.id=aowh.`check` |
| | | <if test="ids !=null and ids != ''"> |
| | | WHERE `check` in |
| | | <foreach collection="ids" index="index" open="(" separator="," close=")" item="val"> |
| | | #{val} |
| | | </foreach> |
| | | </if> |
| | | ) data |
| | | <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> |
| | | ${ew.customSqlSegment} |
| | | </if> |
| | | </select> |
| | | <select id="selectDataByUser" resultType="com.yuanchu.mom.dto.AuxiliaryOutputWorkingHoursDto"> |
| | | select aowh.*,name |
| | | FROM auxiliary_output_working_hours aowh |
| | | left join user on user.id=aowh.`check` |
| | | <if test="ids !=null and ids != ''"> |
| | | WHERE `check` in |
| | | <foreach collection="ids" index="index" open="(" separator="," close=")" item="val"> |
| | | #{val} |
| | | </foreach> |
| | | </if> |
| | | </select> |
| | | <select id="totalHours" resultType="java.util.Map"> |
| | | select A.name, |
| | | A.month, |
| | | A.output_work_time |
| | | from( |
| | | select user.name, |
| | | user.id, |
| | | depart_lims_id, |
| | | output_work_time, |
| | | date_time as month |
| | | from auxiliary_output_working_hours aowh |
| | | left join user on user.id=aowh.`check` |
| | | left join department_lims dl on depart_lims_id=dl.id |
| | | where date_time between #{startTime} and #{endTime} |
| | | <if test="ids !=null and ids != ''"> |
| | | and `check` in |
| | | <foreach collection="ids" index="index" open="(" separator="," close=")" item="val"> |
| | | #{val} |
| | | </foreach> |
| | | </if> |
| | | order by date_time |
| | | )A |
| | | where 1=1 |
| | | <if test="userId !=null and userId != ''"> |
| | | and A.user_id=#{userId} |
| | | </if> |
| | | <if test="departId !=null and departId != ''"> |
| | | and A.depart_lims_id=#{departId} |
| | | </if> |
| | | group by A.name,A.month |
| | | </select> |
| | | <select id="selectListByIds" resultType="com.yuanchu.mom.pojo.AuxiliaryOutputWorkingHours"> |
| | | select * from auxiliary_output_working_hours |
| | | where 1=1 |
| | | <if test="ids !=null and ids != ''"> |
| | | and `check` in |
| | | <foreach collection="ids" index="index" open="(" separator="," close=")" item="val"> |
| | | #{val} |
| | | </foreach> |
| | | </if> |
| | | </select> |
| | | </mapper> |