Skip to content

Commit

Permalink
ignore
Browse files Browse the repository at this point in the history
  • Loading branch information
chliam committed Oct 8, 2015
2 parents b342096 + deb4cff commit cc87c1e
Show file tree
Hide file tree
Showing 17 changed files with 805 additions and 3 deletions.
Binary file modified com.tk.dam.v11.suo
Binary file not shown.
3 changes: 2 additions & 1 deletion com.tk.dam/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ static void Main()
//i = ALARMAPPENDDao.Update(model);
//IList<ALARMAPPEND> list = ALARMAPPENDDao.QueryForList(null);
//IList<station> list = stationDao.QueryForList(null);
IList<sat> list =satDao.QueryForList(null);
//IList<sat> list =satDao.QueryForList(null);
IList<DEVICE_STATUS_CLEAN> list = DEVICE_STATUS_CLEANDao.QueryForList("0+175_clean");
Application.Run(new MainForm());
}
}
Expand Down
3 changes: 3 additions & 0 deletions com.tk.dam/SqlMap.config
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@
<sqlMap embedded="${project_path}.satMapper.xml,${project_assembly}" />
<sqlMap embedded="${project_path}.SB_STATUSMapper.xml,${project_assembly}" />
<sqlMap embedded="${project_path}.stationMapper.xml,${project_assembly}" />

<sqlMap embedded="${project_path}.DEVICE_STATUSMapper.xml,${project_assembly}" />
<sqlMap embedded="${project_path}.DEVICE_STATUS_CLEANMapper.xml,${project_assembly}" />
</sqlMaps>

</sqlMapConfig>
Binary file added com.tk.orm/bin/Debug/com.tk.orm.dll
Binary file not shown.
Binary file added com.tk.orm/bin/Debug/com.tk.orm.pdb
Binary file not shown.
124 changes: 124 additions & 0 deletions com.tk.orm/bin/Debug/mappers/DEVICE_STATUS_CLEANMapper.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
<?xml version="1.0" encoding="UTF-8" ?>
<sqlMap namespace="EntityModel" xmlns="http://ibatis.apache.org/mapping"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<alias>
<!--类的别名-->
<typeAlias alias="DEVICE_STATUS_CLEAN" type="com.tk.orm.model.DEVICE_STATUS_CLEAN,com.tk.orm"/>
</alias>
<parameterMaps>
<parameterMap id="DEVICE_STATUS_CLEAN_params">
<parameter property="GPSIndex" column="GPSIndex" type="long" dbType="bigint" ></parameter>
<parameter property="aDatetime" column="aDatetime" type="DateTime" dbType="datetime" ></parameter>
<parameter property="X" column="X" type="double" dbType="float" ></parameter>
<parameter property="Y" column="Y" type="double" dbType="float" ></parameter>
<parameter property="Height" column="Height" type="double" dbType="float" ></parameter>
<parameter property="XSpeed" column="XSpeed" type="double" dbType="float" ></parameter>
<parameter property="YSpeed" column="YSpeed" type="double" dbType="float" ></parameter>
<parameter property="Hspeed" column="Hspeed" type="double" dbType="float" ></parameter>
<parameter property="Style" column="Style" type="int" dbType="int" ></parameter>
<parameter property="tableName" column="tableName" ></parameter>
</parameterMap>
</parameterMaps>
<resultMaps>
<resultMap id="DEVICE_STATUS_CLEANResult" class="DEVICE_STATUS_CLEAN">
<result property="GPSIndex" column="GPSIndex"/>
<result property="aDatetime" column="aDatetime"/>
<result property="X" column="X"/>
<result property="Y" column="Y"/>
<result property="Height" column="Height"/>
<result property="XSpeed" column="XSpeed"/>
<result property="YSpeed" column="YSpeed"/>
<result property="Hspeed" column="Hspeed"/>
<result property="Style" column="Style"/>
</resultMap>
</resultMaps>
<statements>
<!--查询所有记录-->
<select id="SelectAllDEVICE_STATUS_CLEAN" resultMap="DEVICE_STATUS_CLEANResult">
<![CDATA[SELECT
GPSIndex,
aDatetime,
X,
Y,
Height,
XSpeed,
YSpeed,
Hspeed,
Style
FROM [$tableName$]]]>
</select>
<!--查询单条记录-->
<select id="SelectDEVICE_STATUS_CLEANById" parameterMap="DEVICE_STATUS_CLEAN_params" resultMap="DEVICE_STATUS_CLEANResult" extends="SelectAllDEVICE_STATUS_CLEAN">
<![CDATA[ where GPSIndex = #GPSIndex# ]]>
</select>



<!--插入新记录-->
<insert id="InsertDEVICE_STATUS_CLEAN" parameterMap="DEVICE_STATUS_CLEAN_params">
select 1;
<!--id自动生成的示例用法-->
<selectKey property="GPSIndex" type="post" resultClass="int">
<![CDATA[
INSERT into [$tableName$](aDatetime, X, Y, Height, XSpeed, YSpeed, Hspeed, Style )
VALUES(#aDatetime#, #X#, #Y#, #Height#, #XSpeed#, #YSpeed#, #Hspeed#, #Style# )
SELECT SCOPE_IDENTITY() as GPSIndex
]]>
</selectKey>

</insert>

<!--更新单条记录-->
<update id="UpdateDEVICE_STATUS_CLEAN" parameterMap="DEVICE_STATUS_CLEAN_params">
<![CDATA[Update [$tableName$]
SET
aDatetime=#aDatetime#
,
X=#X#
,
Y=#Y#
,
Height=#Height#
,
XSpeed=#XSpeed#
,
YSpeed=#YSpeed#
,
Hspeed=#Hspeed#
,
Style=#Style#
Where GPSIndex=#GPSIndex#]]>
</update>

<!--根据主键删除单条记录-->
<delete id="DeleteDEVICE_STATUS_CLEANById" parameterMap="DEVICE_STATUS_CLEAN_params">
<![CDATA[Delete From [$tableName$] Where GPSIndex=#value#]]>
</delete>
<select id="SelectDEVICE_STATUS_CLEANQuery" parameterMap="DEVICE_STATUS_CLEAN_params" resultMap="DEVICE_STATUS_CLEANResult" extends="SelectAllDEVICE_STATUS_CLEAN">
<dynamic prepend="where">
<isPropertyAvailable prepend="" property="GPSIndex">
<isGreaterThan prepend="and" property="GPSIndex" compareValue="0">
GPSIndex = #GPSIndex#
</isGreaterThan>
</isPropertyAvailable>
<isPropertyAvailable prepend="and" property="aDatetime">
aDatetime =#aDatetime#
</isPropertyAvailable>
</dynamic>
<!--order by-->
<dynamic>
order by
GPSIndex
</dynamic>
</select>
</statements>
</sqlMap>
10 changes: 10 additions & 0 deletions com.tk.orm/com.tk.orm.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@
<Compile Include="dao\ALARMGOALDao.cs" />
<Compile Include="dao\ALARMSETTINGDao.cs" />
<Compile Include="dao\BaseDA.cs" />
<Compile Include="dao\DEVICE_STATUSDao.cs" />
<Compile Include="dao\DEVICE_STATUS_CLEANDao.cs" />
<Compile Include="dao\OPLOGDao.cs" />
<Compile Include="dao\PROJECTDao.cs" />
<Compile Include="dao\RIGHTDao.cs" />
Expand All @@ -77,6 +79,8 @@
<Compile Include="model\ALARMAPPEND.cs" />
<Compile Include="model\ALARMGOAL.cs" />
<Compile Include="model\ALARMSETTING.cs" />
<Compile Include="model\DEVICE_STATUS.cs" />
<Compile Include="model\DEVICE_STATUS_CLEAN.cs" />
<Compile Include="model\OPLOG.cs" />
<Compile Include="model\PROJECT.cs" />
<Compile Include="model\RIGHT.cs" />
Expand Down Expand Up @@ -114,6 +118,12 @@
<ItemGroup>
<EmbeddedResource Include="mappers\stationMapper.xml" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="mappers\DEVICE_STATUSMapper.xml" />
<EmbeddedResource Include="mappers\DEVICE_STATUS_CLEANMapper.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</EmbeddedResource>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
29 changes: 27 additions & 2 deletions com.tk.orm/dao/BaseDA.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,15 @@ public static object Insert<T>(string statementName, T t)
}
return null;
}

public static object Insert2(string statementName, object t)
{
ISqlMapper iSqlMapper = Mapper.Instance();
if (iSqlMapper != null)
{
return (object)iSqlMapper.Insert(statementName, t);
}
return null;
}
public static int Update<T>(string statementName, T t)
{
ISqlMapper iSqlMapper = Mapper.Instance();
Expand All @@ -25,6 +33,15 @@ public static int Update<T>(string statementName, T t)
return 0;
}

public static int Update2(string statementName, object t)
{
ISqlMapper iSqlMapper = Mapper.Instance();
if (iSqlMapper != null)
{
return iSqlMapper.Update(statementName, t);
}
return 0;
}
public static int Delete(string statementName, int primaryKeyId)
{
ISqlMapper iSqlMapper = Mapper.Instance();
Expand All @@ -34,7 +51,15 @@ public static int Delete(string statementName, int primaryKeyId)
}
return 0;
}

public static int Delete2(string statementName, object primaryKeyId)
{
ISqlMapper iSqlMapper = Mapper.Instance();
if (iSqlMapper != null)
{
return iSqlMapper.Delete(statementName, primaryKeyId);
}
return 0;
}
public static T Get<T>(string statementName, int primaryKeyId) where T : class
{
ISqlMapper iSqlMapper = Mapper.Instance();
Expand Down
128 changes: 128 additions & 0 deletions com.tk.orm/dao/DEVICE_STATUSDao.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.tk.orm.model;
using System.Collections;
namespace com.tk.orm.dao
{
public class DEVICE_STATUSDao
{
public static object Insert(DEVICE_STATUS parameterObject, string tableName)
{
Hashtable inparam = new Hashtable();
if (parameterObject != null)
{
if (parameterObject.aDatetime != null)
{
inparam.Add("aDatetime", parameterObject.aDatetime);
}
if (parameterObject.dltaH != null)
{
inparam.Add("dltaH", parameterObject.dltaH);
}
if (parameterObject.dltaX != null)
{
inparam.Add("dltaX", parameterObject.dltaX);
}
if (parameterObject.dltaY != null)
{
inparam.Add("dltaY", parameterObject.dltaY);
}
if (parameterObject.GPSIndex != null)
{
inparam.Add("GPSIndex", parameterObject.GPSIndex);
}
if (parameterObject.Height != null)
{
inparam.Add("Height", parameterObject.Height);
}
if (parameterObject.X != null)
{
inparam.Add("X", parameterObject.X);
}
if (parameterObject.Y != null)
{
inparam.Add("Y", parameterObject.Y);
}
}
inparam.Add("tableName", tableName);

return BaseDA.Insert2("InsertDEVICE_STATUS", inparam);
}

public static int Update(DEVICE_STATUS parameterObject, string tableName)
{
Hashtable inparam = new Hashtable();
if (parameterObject != null)
{
if (parameterObject.aDatetime != null)
{
inparam.Add("aDatetime", parameterObject.aDatetime);
}
if (parameterObject.dltaH != null)
{
inparam.Add("dltaH", parameterObject.dltaH);
}
if (parameterObject.dltaX != null)
{
inparam.Add("dltaX", parameterObject.dltaX);
}
if (parameterObject.dltaY != null)
{
inparam.Add("dltaY", parameterObject.dltaY);
}
if (parameterObject.GPSIndex != null)
{
inparam.Add("GPSIndex", parameterObject.GPSIndex);
}
if (parameterObject.Height != null)
{
inparam.Add("Height", parameterObject.Height);
}
if (parameterObject.X != null)
{
inparam.Add("X", parameterObject.X);
}
if (parameterObject.Y != null)
{
inparam.Add("Y", parameterObject.Y);
}
}
inparam.Add("tableName", tableName);
return BaseDA.Update2("UpdateDEVICE_STATUS", inparam);
}

public static int Delete(int primaryKeyId, string tableName)
{
Hashtable inparam = new Hashtable();
inparam.Add("GPSIndex", primaryKeyId);
inparam.Add("tableName", tableName);
return BaseDA.Delete2("DeleteDEVICE_STATUSById", inparam);
}

public static DEVICE_STATUS Get(int primaryKeyId, string tableName)
{
Hashtable inparam = new Hashtable();
inparam.Add("GPSIndex", primaryKeyId);
inparam.Add("tableName", tableName);
return BaseDA.QueryForObject<DEVICE_STATUS>("SelectDEVICE_STATUSById", inparam);
}

public static IList<DEVICE_STATUS> QueryForList(string tableName, DEVICE_STATUS parameterObject = null)
{
Hashtable inparam = new Hashtable();
if (parameterObject != null)
{
if (parameterObject.aDatetime != null)
{
inparam.Add("aDatetime", parameterObject.aDatetime);
}

}
inparam.Add("tableName", tableName);
return BaseDA.QueryForList<DEVICE_STATUS>("SelectDEVICE_STATUSQuery", inparam);
}
}
}

Loading

0 comments on commit cc87c1e

Please sign in to comment.