# yhbatis

> Like Mybatis for nodejs By YYH.

Latest version **0.0.12** (published 2015-06-25) · 0 weekly downloads

## Install

```sh
npm install yhbatis
pnpm add yhbatis
yarn add yhbatis
bun add yhbatis
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.12 |
| Published | 2015-06-25 |
| First published | 2015-05-15 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.10.35 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | yyh |
| Maintainers | dbtlek |
| Keywords | mybatis, yh, mybatis for nodejs, yhbatis |

## Links

- npm: https://www.npmjs.com/package/yhbatis
- npm.io page: https://npm.io/package/yhbatis

## Recent versions

- 0.0.12 (latest) — 2015-06-25
- 0.0.11 — 2015-05-19
- 0.0.10 — 2015-05-18
- 0.0.9 — 2015-05-18
- 0.0.8 — 2015-05-18
- 0.0.7 — 2015-05-18
- 0.0.6 — 2015-05-15
- 0.0.5 — 2015-05-15
- 0.0.4 — 2015-05-15
- 0.0.3 — 2015-05-15
- 0.0.2 — 2015-05-15
- 0.0.1 — 2015-05-15

## README

## Usage

```javascript
//Init Part
var mysql = require('mysql');
global.yhbatis = require('yhbatis').yhbatis;

global.pool = mysql.createPool({
    host    :'localhost',
    port : 3306,
    user : 'root',
    password : '1234',
    connectionLimit:20,
    waitForConnections:true,
    typeCast : true,
    multipleStatements: true
});

yhbatis.createYHBatis(
[
	"C:/Users/yh/Desktop/project/homepage/mapper/query_question.xml"
]);

//XML Part
<?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="query_question">
	<select id="getAlgorithm">
		SELECT
			B.*
			,IF(isnull(C.result_code) ,FALSE,TRUE) AS `CHECK`
		FROM
			(
				SELECT
					*
					,DATE_FORMAT(A.registed_date,'%X.%m.%d') AS registed_date_format
				FROM
					simuruk.algorithm_question A
			) B
		LEFT OUTER JOIN simuruk.algorithm_user_answer C ON
			C.question_num = B.num
			AND C.user_uuid = #{user_uuid}
			AND C.result_code = "0"
		GROUP BY B.num
	</select>
</mapper>

//Use Part
var mapping = {};
mapping.user_uuid = user_uuid;
yhbatis.sqlSection("getAlgorithm",mapping,function(row){
	
});
```

---
_Source: https://npm.io/package/yhbatis · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
