Commit 9c08069c authored by 竹天卫's avatar 竹天卫

优化

parent 1db86881
......@@ -74,7 +74,6 @@
<where>
b.DrillingDate=#{params.DrillingDate}
</where>
</update>
......
......@@ -332,6 +332,7 @@ public class TProcessesDrillingServiceImpl extends ServiceImpl<TProcessesDrillin
//封装条件
Map<String, Object> params = new HashMap<>();
params.put("DrillingDate",DrillingDate);
//封装实体
TProcessesDrilling tProcessesDrilling = new TProcessesDrilling();
tProcessesDrilling.setBlastDate(query.getBlastDate());
......
<?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="cn.wise.sc.acquisition.business.mapper.DataStatisticsMapper">
<select id="countByPhoto" resultType="cn.wise.sc.acquisition.business.model.vo.DataStatisticsVo">
SELECT Convert(varchar(10),tw.Rq,120) as name, SUM(tw.Jz) as value
FROM T_Weight tw
where 1=1
<if test="params.TruckID != null and params.TruckID != ''">
and tw.TruckID = #{params.TruckID}
</if>
<if test="params.startDate != null and params.startDate != ''">
and Convert(varchar(10),tw.Rq,120) <![CDATA[ >= ]]> #{params.startDate}
</if>
<if test="params.endDate != null and params.endDate != ''">
and Convert(varchar(10),tw.Rq,120) <![CDATA[ <= ]]> #{params.endDate}
</if>
<if test="(params.startDate == null or params.startDate == '')
and (params.endDate == null or params.endDate == '')">
and datediff(week, tw.Rq,getdate())=0
</if>
group by Convert(varchar(10),tw.Rq,120)
</select>
<select id="countByTable" resultType="cn.wise.sc.acquisition.business.model.vo.DataStatisticsTableVo">
SELECT tw.ID as Uid,Convert(varchar(19),tw.Rq,120)as Rq,tw.TruckID,'发货单位' as clientName,tpt.WorkType,tw.Mz,tw.Pz,tw.Jz
FROM T_Weight tw
left join T_Processes_Truck tpt on tpt.TruckID = tw.TruckID
where 1=1
<if test="params.TruckID != null and params.TruckID != ''">
and tw.TruckID = #{params.TruckID}
</if>
<if test="params.startDate != null and params.startDate != ''">
and Convert(varchar(10),tw.Rq,120) <![CDATA[ >= ]]> #{params.startDate}
</if>
<if test="params.endDate != null and params.endDate != ''">
and Convert(varchar(10),tw.Rq,120) <![CDATA[ <= ]]> #{params.endDate}
</if>
<if test="(params.startDate == null or params.startDate == '')
and (params.endDate == null or params.endDate == '')">
and datediff(week, tw.Rq,getdate())=0
</if>
</select>
</mapper>
<?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="cn.wise.sc.acquisition.business.mapper.TAnnouncementMapper">
</mapper>
<?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="cn.wise.sc.acquisition.business.mapper.TEquipmentAccountMapper">
</mapper>
<?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="cn.wise.sc.acquisition.business.mapper.TEquipmentCheckContentMapper">
</mapper>
<?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="cn.wise.sc.acquisition.business.mapper.TEquipmentCheckDetailMapper">
<select id="getDetailList" resultType="cn.wise.sc.acquisition.business.model.vo.TEquipmentCheckMainVo">
select tecm.*
from T_Equipment_Check_Main tecm
<include refid="where"/>
order by tecm.Djrq desc
</select>
<sql id="where">
<where>
<if test="params.selectMonth != null and params.selectMonth != ''">
and tecm.Tag = #{params.selectMonth}
</if>
<if test="params.EquipmentName != null and params.EquipmentName != ''">
and tecm.EquipmentName like concat('%', #{params.EquipmentName}, '%')
</if>
</where>
</sql>
</mapper>
<?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="cn.wise.sc.acquisition.business.mapper.TEquipmentCheckMapper">
<select id="getPage" resultType="cn.wise.sc.acquisition.business.model.vo.TEquipmentCheckMainVo">
select tecm.*
from T_Equipment_Check_Main tecm
<include refid="where"/>
order by tecm.Djrq desc
</select>
<sql id="where">
<where>
<if test="params.selectMonth != null and params.selectMonth != ''">
and tecm.Tag = #{params.selectMonth}
</if>
<if test="params.EquipmentName != null and params.EquipmentName != ''">
and tecm.EquipmentName like concat('%', #{params.EquipmentName}, '%')
</if>
</where>
</sql>
</mapper>
<?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="cn.wise.sc.acquisition.business.mapper.TEquipmentRunMapper">
<select id="getPage" resultType="cn.wise.sc.acquisition.business.model.vo.TEquipmentRunVo">
select tea.EquipmentID,tea.EquipmentName,
ter.Uid,ter.RunDate,ter.RunHour,ter.StopHour,ter.StopType,ter.Driver,ter.Txr,ter.Tag
from T_Equipment_Account tea
left join T_Equipment_Run ter on ter.EquipmentID = tea.EquipmentID
<include refid="where"/>
order by tea.Ccrq desc
</select>
<sql id="where">
<where>
and tea.Zsb = 1
<if test="params.Txr != null and params.Txr != ''">
and ter.Txr = #{params.Txr}
</if>
<if test="params.EquipmentName != null and params.EquipmentName != ''">
and tea.EquipmentName like concat('%', #{params.EquipmentName}, '%')
</if>
<if test="params.ProcessesName != null and params.ProcessesName != ''">
and tea.ProcessesName = #{params.ProcessesName}
</if>
</where>
</sql>
</mapper>
<?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="cn.wise.sc.acquisition.business.mapper.TEquipmentTroubleMapper">
<select id="getPage" resultType="cn.wise.sc.acquisition.business.model.vo.TEquipmentTroubleVo">
select tea.EquipmentID,tea.EquipmentName,
tet.Uid,tet.Fxr,tet.Fxrq,tet.Yhms,tet.Clcs,tet.Clrq,tet.Txr,tet.Txrq,tet.Clzt
from T_Equipment_Account tea
left join T_Equipment_Trouble tet on tet.EquipmentID = tea.EquipmentID
<include refid="where"/>
order by tea.Ccrq desc
</select>
<sql id="where">
<where>
<if test="params.Txr != null and params.Txr != ''">
and tet.Txr = #{params.Txr}
</if>
<if test="params.EquipmentName != null and params.EquipmentName != ''">
and tea.EquipmentName like concat('%', #{params.EquipmentName}, '%')
</if>
<if test="params.ProcessesName != null and params.ProcessesName != ''">
and tea.ProcessesName = #{params.ProcessesName}
</if>
</where>
</sql>
</mapper>
<?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="cn.wise.sc.acquisition.business.mapper.TMaterialEntryMapper">
</mapper>
<?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="cn.wise.sc.acquisition.business.mapper.TMaterialInventoryMapper">
</mapper>
<?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="cn.wise.sc.acquisition.business.mapper.TMaterialOutMapper">
</mapper>
<?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="cn.wise.sc.acquisition.business.mapper.TMineStopeMapper">
<select id="getStopeName" resultType="cn.wise.sc.acquisition.business.entity.TMineStope">
select StopeName,StepName,BlastAreaName from T_Mine_Stope
</select>
<select id="getStopeNewList" resultType="cn.wise.sc.acquisition.business.entity.TMineStope">
select Uid,StopeName,StepName,BlastAreaName,IsUsing,AddDate FROM T_Mine_Stope a
where Isusing =1 and 
        not exists (
        select StopeName , StepName , BlastAreaName  from T_Processes_BlastDesign_Hole b
        where (a.StopeName=b.StopeName and a.StepName=b.StepName and a.BlastAreaName=b.BlastAreaName)
<if test="designDate != null and designDate != ''">
and Convert(varchar(100),DesignDate,23) <![CDATA[ <> ]]> #{designDate}
</if>
        group by  StopeName, StepName, BlastAreaName
        ) 
order by AddDate desc
</select>
</mapper>
<?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="cn.wise.sc.acquisition.business.mapper.TMineWorkemployeesMapper">
</mapper>
<?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="cn.wise.sc.acquisition.business.mapper.TProcessesAuxiliaryMapper">
</mapper>
<?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="cn.wise.sc.acquisition.business.mapper.TProcessesBlastMapper">
<select id="getNewPage" resultType="cn.wise.sc.acquisition.business.model.vo.TProcessesBlastVo">
select
a.Uid,
a.BlastPeople,
a.CheckHoleDate,
a.CheckHolePeople,
a.Manager,
a.Supervisor,
a.TechDepart,
a.Tabulator,
a.Bz,
a.Tag,
b.StopeName,
b.StepName,
b.BlastAreaName,
b.BlastHoleID AS HoleID,
b.HoleBlastVolume,
b.depth AS DesignDepth,
c.BlastDate,
c.Depth
from T_Processes_Blast a
left join T_Processes_Drilling c on c.Uid = a.Uid
left join T_Processes_BlastDesign_Hole b on b.Uid = c.Uid
where 1=1
<if test="params.blastDate != null and params.blastDate != ''">
and Convert(varchar(10),c.BlastDate,120) <![CDATA[ = ]]> #{params.blastDate}
</if>
</select>
<!-- 表和实体字段对照关系, 类似RestultMap -->
<sql id="TProcessesBlastColumns">
a.Uid,
a.BlastPeople,
a.CheckHoleDate,
a.CheckHolePeople,
a.Manager,
a.Supervisor,
a.TechDepart,
a.Tabulator,
a.Bz,
a.Tag
</sql>
<sql id="TProcessesBlastdesignColumns">
b.StopeName,
b.StepName,
b.BlastAreaName,
b.BlastHoleID AS HoleID,
b.HoleBlastVolume,
b.depth AS DesignDepth,<!-- 设计孔深,将爆破工序里的depth去掉,用设计炮孔里的替代 -->
</sql>
<sql id="TProcessesDrillingColumns">
c.BlastDate,
c.Depth,
</sql>
<sql id="TProcessesDrillingJoins">
left join T_Processes_Drilling c on a.Uid = c.Uid
</sql>
<sql id="TProcessesBlastDesignHoleJoins">
left join T_Processes_BlastDesign_Hole b on c.Uid = b.Uid
</sql>
<!-- 获取所有getPage列表 -->
<select id="getPage" resultType="cn.wise.sc.acquisition.business.model.vo.TProcessesBlastVo">
SELECT
a.Uid,
b.BlastHoleID AS HoleID,
b.HoleBlastVolume,
b.depth AS DesignDepth,
c.Depth
FROM T_Processes_Blast a
<include refid="TProcessesDrillingJoins"/>
<include refid="TProcessesBlastDesignHoleJoins"/>
<where>
${ew.sqlSegment}
</where>
</select>
<!-- 获取所有getByUid列表 -->
<select id="getByQuery" resultType="cn.wise.sc.acquisition.business.model.vo.TProcessesBlastVo">
SELECT
<include refid="TProcessesBlastdesignColumns"/>
<include refid="TProcessesDrillingColumns"/>
<include refid="TProcessesBlastColumns"/>
FROM T_Processes_Blast a
<include refid="TProcessesDrillingJoins"/>
<include refid="TProcessesBlastDesignHoleJoins"/>
<where>
${ew.sqlSegment}
</where>
</select>
</mapper>
<?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="cn.wise.sc.acquisition.business.mapper.TProcessesBlastdesignHoleMapper">
<!-- 表和实体字段对照关系, 类似RestultMap -->
<sql id="TProcessesBlastdesignHoleColumns">
a.Uid,
a.StopeName,
a.StepName,
a.BlastAreaName,
a.BlastHoleID,
a.Depth,
a.RowSpace,
a.HoleSpace,
a.Azimuth,
a.Inclination,
a.Aperture,
a.x,
a.y,
a.z,
a.StepHeight,
a.HoleBlastVolume,
a.DrillingDate,
a.DesignDate,
a.Tag
</sql>
<sql id="TProcessesBlastdesignVolumeColumns">
b.BlastVolume,
</sql>
<sql id="TProcessesBlastdesignHoleJoins">
left join T_Processes_BlastDesign_Volume b on a.StopeName=b.StopeName and a.StepName=b.StepName and a.BlastAreaName=b.BlastAreaName
</sql>
<!-- 获取所有getPage列表 -->
<select id="getPage" resultType="cn.wise.sc.acquisition.business.model.vo.TProcessesBlastdesignHoleVo">
SELECT
a.Uid,
a.BlastHoleID,
a.Depth,
a.RowSpace,
a.HoleSpace,
a.Azimuth,
a.Inclination,
a.Aperture,
a.x,
a.y,
a.z,
a.StepHeight,
a.DrillingDate,
a.DesignDate
FROM T_Processes_BlastDesign_Hole a
where 1=1
<if test="params.designDate != null and params.designDate != ''">
and Convert(varchar(10),a.DesignDate,120) <![CDATA[ = ]]> #{params.designDate}
</if>
</select>
<!-- 获取所有getByQuery列表 -->
<select id="getByQuery" resultType="cn.wise.sc.acquisition.business.model.vo.TProcessesBlastdesignHoleVo">
SELECT
<include refid="TProcessesBlastdesignVolumeColumns"/>
<include refid="TProcessesBlastdesignHoleColumns"/>
FROM T_Processes_BlastDesign_Hole a
<include refid="TProcessesBlastdesignHoleJoins"/>
<where>
${ew.sqlSegment}
</where>
</select>
<!-- 获取所有getByQuery列表 -->
<select id="getSumByCondition" resultType="Double">
SELECT
sum(${condition})
FROM T_Processes_BlastDesign_Hole a
<include refid="TProcessesBlastdesignHoleJoins"/>
<where>
${ew.sqlSegment}
</where>
</select>
<select id="getBalestHoleId" resultType="java.lang.String">
select BlastHoleID from T_Processes_BlastDesign_Hole
</select>
<select id="getBalestVolume" resultType="cn.wise.sc.acquisition.business.model.vo.TProcessesBlastdesignHoleVo">
select sum(HoleBlastVolume) BlastVolume from T_Processes_BlastDesign_Hole
<where>
${ew.sqlSegment}
</where>
</select>
</mapper>
<?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="cn.wise.sc.acquisition.business.mapper.TProcessesBlastdesignVolumeMapper">
</mapper>
<?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="cn.wise.sc.acquisition.business.mapper.TProcessesCrusherMapper">
<!-- 表和实体字段对照关系, 类似RestultMap -->
<sql id="TProcessesCrusherColumns">
a.Uid,
a.CrusherStationID,
a.CrushDate,
a.Manager,
a.Supervisor,
a.TechDepart,
a.Tabulator,
a.EquipmentID,
a.WorkType,
a.WorkTime,
/* a.Wcdw, 吨位 查吨位表中的吨位*/
a.Price,
a.TotalMoney,
a.Bz,
a.Tag
</sql>
<sql id="TWeightColumns">
b.Wcdw, /*吨位 替换破碎工序中的吨位*/
</sql>
<sql id="TProcessesCrusherJoins">
LEFT JOIN (
SELECT
Rq,
SUM (Jz) AS Wcdw /*吨位 替换破碎工序中的吨位*/
FROM
T_Weight
GROUP BY
Rq
) b ON a.CrushDate = b.Rq
</sql>
<!-- 获取所有getPage列表 -->
<select id="getPage" resultType="cn.wise.sc.acquisition.business.model.vo.TProcessesCrusherVo">
SELECT
a.Uid,
a.EquipmentID,
a.WorkType,
a.WorkTime,
a.Price,
a.TotalMoney,
b.Wcdw
FROM T_Processes_Crusher a
<include refid="TProcessesCrusherJoins"/>
<where>
${ew.sqlSegment}
</where>
</select>
<!-- 获取所有getPage列表 -->
<select id="getByQuery" resultType="cn.wise.sc.acquisition.business.model.vo.TProcessesCrusherVo">
SELECT
<include refid="TWeightColumns"/>
<include refid="TProcessesCrusherColumns"/>
FROM T_Processes_Crusher a
<include refid="TProcessesCrusherJoins"/>
<where>
${ew.sqlSegment}
</where>
</select>
</mapper>
<?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="cn.wise.sc.acquisition.business.mapper.TProcessesDiggingMapper">
</mapper>
<?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="cn.wise.sc.acquisition.business.mapper.TProcessesDrillingMapper">
<!-- 表和实体字段对照关系, 类似RestultMap -->
<sql id="TProcessesDrillingColumns">
a.Uid,
a.Manager,
a.Supervisor,
a.TechDepart,
a.Tabulator,
a.EquipmentID,
a.Driver,
a.StartTime,
a.EndTime,
a.WorkTime,
a.HoleBlastVolume,
a.Depth,
a.RowSpace,
a.HoleSpace,
a.Azimuth,
a.Inclination,
a.Aperture,
a.x,
a.y,
a.z,
a.BlastDate,
a.Operator,
a.Accepter,
a.Bz,
a.Tag
</sql>
<sql id="TProcessesBlastDesignHoleColumns">
b.StopeName,
b.StepName,
b.BlastAreaName,
b.BlastHoleID AS HoleId,
b.DrillingDate,
b.Depth AS DesignDepth,
b.RowSpace AS DesignRowSpace,
b.HoleSpace AS DesignHoleSpace,
b.Azimuth AS DesignAzimuth,
b.Inclination AS DesignInclination,
b.Aperture AS DesignAperture,
b.StepHeight,
</sql>
<sql id="TProcessesBlastdesignVolumeColumns">
d.BlastVolume,
d.DesignDate,
</sql>
<sql id="TProcessesBlastDesignHoleJoins">
left join T_Processes_BlastDesign_Hole b on a.Uid = b.Uid
</sql>
<sql id="TProcessesBlastDesignVolumeJoins">
left join T_Processes_BlastDesign_Volume d on b.StopeName=d.StopeName and b.StepName=d.StepName and b.BlastAreaName=d.BlastAreaName
</sql>
<update id="updateByDrillingDate">
UPDATE a
set
<if test="params.BlastDate != null">
a.BlastDate= #{params.BlastDate}
</if>
from T_Processes_Drilling a
INNER JOIN T_Processes_BlastDesign_Hole b
on a.Uid=b.Uid
<where>
b.DrillingDate=#{params.DrillingDate}
</where>
</update>
<select id="getUidList" resultType="java.lang.String">
select tpd.Uid from T_Processes_Drilling tpd where tpd.BlastDate=#{blastDate}
</select>
<!-- 获取所有getPage列表 -->
<select id="getPage" resultType="cn.wise.sc.acquisition.business.model.vo.TProcessesDrillingVo">
SELECT
a.Uid,
a.Depth,
a.RowSpace,
a.HoleSpace,
a.HoleBlastVolume,
a.BlastDate,
b.BlastHoleID AS HoleId,
b.Depth AS DesignDepth,
b.RowSpace AS DesignRowSpace,
b.HoleSpace AS DesignHoleSpace,
b.StepHeight
FROM T_Processes_Drilling a
<include refid="TProcessesBlastDesignHoleJoins"/>
<include refid="TProcessesBlastDesignVolumeJoins"/>
<where>
${ew.sqlSegment}
</where>
</select>
<!-- 获取所有getPage列表 -->
<select id="getByQuery" resultType="cn.wise.sc.acquisition.business.model.vo.TProcessesDrillingVo">
SELECT
<include refid="TProcessesBlastDesignHoleColumns"/>
<include refid="TProcessesBlastdesignVolumeColumns"/>
<include refid="TProcessesDrillingColumns"/>
FROM T_Processes_Drilling a
<include refid="TProcessesBlastDesignHoleJoins"/>
<include refid="TProcessesBlastDesignVolumeJoins"/>
<where>
${ew.sqlSegment}
</where>
</select>
<!-- 根据条件求和某字段 -->
<select id="getSumByCondition" resultType="Double">
SELECT
sum(${condition})
FROM T_Processes_Drilling a
<include refid="TProcessesBlastDesignHoleJoins"/>
<where>
${ew.sqlSegment}
</where>
</select>
</mapper>
<?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="cn.wise.sc.acquisition.business.mapper.TProcessesTruckMapper">
</mapper>
<?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="cn.wise.sc.acquisition.business.mapper.TSafeTroubleImgMapper">
</mapper>
<?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="cn.wise.sc.acquisition.business.mapper.TSafeTroubleMapper">
</mapper>
<?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="cn.wise.sc.acquisition.business.mapper.TSampleLaboratorysheetMapper">
<select id="getList" resultType="cn.wise.sc.acquisition.business.entity.TSampleLaboratorysheet">
select * from T_Sample_LaboratorySheet
</select>
<select id="pageByYhOrSysj" resultType="cn.wise.sc.acquisition.business.entity.TSampleLaboratorysheet">
select a.* from T_Sample_LaboratorySheet a
where
a.Yh=#{param.Yh}
or a.Sysj= #{param.Sysj}
</select>
</mapper>
<?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="cn.wise.sc.acquisition.business.mapper.TSampleListMapper">
<!-- 表和实体字段对照关系, 类似RestultMap -->
<sql id="TSampleListColumns">
a.Yh,
a.QRCode,
a.StopeName,
a.StepName,
a.BlastAreaName,
a.HolesID,
a.Start,
a.EndTo,
a.Syr,
a.Syrq,
a.Bz
</sql>
<sql id="TSampleListJoins">
</sql>
<select id="pageByYhOrSyrq" resultType="cn.wise.sc.acquisition.business.entity.TSampleList">
select a.* from T_Sample_List a
where
a.Yh=#{param.Yh}
or a.Syrq= #{param.Syrq}
</select>
</mapper>
<?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="cn.wise.sc.acquisition.business.mapper.TSysDeptMapper">
</mapper>
<?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="cn.wise.sc.acquisition.business.mapper.TSysDictMapper">
</mapper>
<?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="cn.wise.sc.acquisition.business.mapper.TSysPowerMapper">
<select id="getPowerByRole" resultType="cn.wise.sc.acquisition.business.entity.TSysPower">
select p.*
from T_Sys_Power p
left join T_Sys_RolePower rp on rp.PowerID = p.ID
where rp.RoleID = #{params.roleId}
</select>
</mapper>
<?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="cn.wise.sc.acquisition.business.mapper.TSysRoleMapper">
</mapper>
<?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="cn.wise.sc.acquisition.business.mapper.TSysRolepowerMapper">
</mapper>
<?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="cn.wise.sc.acquisition.business.mapper.TSysUserLoginMapper">
</mapper>
<?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="cn.wise.sc.acquisition.business.mapper.TSysUserMapper">
</mapper>
<?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="cn.wise.sc.acquisition.business.mapper.TWeightMapper">
<!-- 根据条件求和某字段 -->
<select id="getSumByCondition" resultType="Double">
SELECT
sum(${condition})
FROM T_Weight a
<where>
${ew.sqlSegment}
</where>
</select>
<select id="getWeightCount" resultType="cn.wise.sc.acquisition.business.model.vo.TWeightCountVo">
SELECT CONVERT(varchar(100), Rq, 23) AS Rq, TruckID, TruckName,
SUM(Mz)/1000 AS Zmz, SUM(Pz)/1000 AS Zpz, SUM(Jz)/1000 AS Zjz, SUM(Cs) AS Zcs,
SUM( CASE when Kslx ='黏土' THEN Mz ELSE 0 END)/1000 as Ntmz ,
SUM( CASE when Kslx ='黏土' THEN Pz ELSE 0 END)/1000 as Ntpz ,
SUM( CASE when Kslx ='黏土' THEN Jz ELSE 0 END)/1000 as Ntjz ,
SUM( CASE when Kslx ='黏土' THEN Cs ELSE 0 END) as Ntcs ,
SUM( CASE when Kslx ='矿石' THEN Mz ELSE 0 END)/1000 as Ksmz ,
SUM( CASE when Kslx ='矿石' THEN Pz ELSE 0 END)/1000 as Kspz ,
SUM( CASE when Kslx ='矿石' THEN Jz ELSE 0 END)/1000 as Ksjz ,
SUM( CASE when Kslx ='矿石' THEN Cs ELSE 0 END) as Kscs
FROM V_WeightRock
where Jz > 0
<if test="params.TruckID != null and params.TruckID != ''">
and TruckID like concat('%', #{params.TruckID}, '%')
</if>
<if test="params.startDate != null and params.startDate != ''">
and Rq >= #{params.startDate}
</if>
<if test="params.endDate != null and params.endDate != ''">
and Rq &lt; #{params.endDate}
</if>
GROUP BY CONVERT(varchar(100), Rq, 23), TruckID, TruckName
</select>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment